1 /** 2 * MEDOR: Middleware Enabling Distributed Object Requests 3 * 4 * Copyright (C) 2001-2004 France Telecom R&D 5 * Contact: alexandre.lefebvre@rd.francetelecom.com 6 * 7 * This library is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU Lesser General Public 9 * License as published by the Free Software Foundation; either 10 * version 2.1 of the License, or (at your option) any later version. 11 * 12 * This library is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * Lesser General Public License for more details. 16 * 17 * You should have received a copy of the GNU Lesser General Public 18 * License along with this library; if not, write to the Free Software 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 * 21 * Initial developers: M. Alia, A. Lefebvre 22 */ 23 24 package org.objectweb.medor.eval.api; 25 26 import org.objectweb.medor.api.MedorException; 27 import org.objectweb.medor.expression.api.ParameterOperand; 28 import org.objectweb.medor.query.api.QueryNode; 29 import org.objectweb.medor.tuple.api.TupleCollection; 30 import org.objectweb.medor.eval.prefetch.api.PrefetchBuffer; 31 32 /** 33 * This interface defines the controller object for the evaluation of a given 34 * QueryNode within a QueryTree. It is created at evaluation time by the 35 * NodeEvaluatorFactory, on request from the QueryEvaluator. 36 * The QueryEvaluator controls the overall evaluation by activating/killing 37 * the NodeEvaluator instances. 38 */ 39 public interface NodeEvaluator { 40 /** 41 * Closes the links between the current NodeEvaluator and the NodeEvaluators 42 * of the children QueryTrees for pipelining operations. 43 * TODO complete comments 44 */ 45 boolean unlinkChildren(); 46 47 /** 48 * Opens the links between the current NodeEvaluator and the NodeEvaluators 49 * of the children QueryTrees for pipelining operations. 50 * TODO complete comments 51 */ 52 boolean linkChildren(); 53 54 /** 55 * This method executes the query on the underlying node. 56 * It controls the evaluation locally for this node. 57 * It returns the TupleCollection containing the result of the execution. 58 */ 59 TupleCollection fetchData(ParameterOperand[] parameters) 60 throws MedorException; 61 62 /** 63 * Associates a PrefetchBuffer to be filled by the collection computed by 64 * this evaluator. 65 * @param pb The PrefetchBuffer to be filled. 66 */ 67 void setPrefetchBuffer(PrefetchBuffer pb) throws MedorException; 68 69 long getCacheSize(); 70 71 void setCacheSize(long cacheSize); 72 73 /** 74 * Returns the evaluation meta data associated with this node evaluator. 75 * @return the associated EvaluationMetaData 76 */ 77 EvaluationMetaData getEvaluationMetaData(); 78 /** 79 * Returns the QueryNode to which the NodeEvaluator is attached. 80 */ 81 QueryNode getQueryNode(); 82 } 83