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.EvaluationException; 27 import org.objectweb.medor.datasource.api.WrapperFactory; 28 import org.objectweb.medor.eval.prefetch.api.PrefetchBuffer; 29 import org.objectweb.medor.expression.api.ParameterOperand; 30 import org.objectweb.medor.query.api.QueryTree; 31 import org.objectweb.medor.tuple.api.TupleCollection; 32 33 import java.util.Map; 34 35 /** 36 * This interface represents the MEDOR evaluator. It permits to evaluate an 37 * evaluable (optimized) query Tree. 38 * 39 */ 40 public interface QueryEvaluator { 41 42 /** 43 * Launch the evaluation of a query. 44 * @param parameters is the array of query parameter (never null). 45 * @param ressources is a ConnectionResources containing associations between 46 * the DataStore names used in the QueryTree and the connection objects to 47 * use for the evaluation. It can be null. 48 * @param evalMDMap contains a map associating an EvaluationMetaData object 49 * to each of the query nodes of the query tree currently associated to the 50 * QueryEvaluator. 51 */ 52 TupleCollection evaluate(ParameterOperand[] parameters, 53 ConnectionResources ressources, 54 Map evalMDMap) 55 throws EvaluationException; 56 /** 57 * Launch the evaluation of a query. This method is able to prefetch data 58 * of the query in a prefetch buffer. 59 * @param parameters is the array of query parameter (Never null). 60 * @param ressources is a ConnectionResources containing associations between 61 * the DataStore names used in the QueryTree and the connection objects to 62 * use for the evaluation.It can be null. 63 * @param pb is the prefetch buffer which must be fill with query results. 64 * If this parameter is null then no data prefetching is done. 65 */ 66 TupleCollection evaluate(ParameterOperand[] parameters, 67 ConnectionResources ressources, 68 PrefetchBuffer pb, 69 Map evalMDMap) 70 throws EvaluationException; 71 72 ConnectionResources getRequiredConnectionResources(); 73 74 /** 75 * @return the cache size used in different node of the QueryNode tree. 76 */ 77 long getCacheSize(); 78 79 /** 80 * @return the evaluable (optimized) query tree associated to the current 81 * QueryEvaluator. 82 */ 83 QueryTree getQueryTree(); 84 85 /** 86 * Returns the associated WrapperFactory. This is used to be able to 87 * bind specific Wrappers to DataStore types. 88 * @return the associated WrapperFactory 89 */ 90 WrapperFactory getWrapperFactory(); 91 } 92