Class LocalSearchBackend
- java.lang.Object
-
- org.eclipse.viatra.query.runtime.localsearch.matcher.integration.LocalSearchBackend
-
- All Implemented Interfaces:
IQueryBackend
public abstract class LocalSearchBackend extends java.lang.Object implements IQueryBackend
- No Extend:
- This class is not intended to be subclassed by clients.
-
-
Constructor Summary
Constructors Constructor Description LocalSearchBackend(IQueryBackendContext context)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addAdapter(ILocalSearchAdapter adapter)
void
dispose()
Disposes the query backend.void
flushUpdates()
Propagates all pending updates in this query backend.java.util.List<ILocalSearchAdapter>
getAdapters()
Return a copy of the current adaptersIQueryBackendContext
getBackendContext()
ICache
getCache()
Returns the internal cache of the backendIQueryBackendHintProvider
getHintProvider()
QueryAnalyzer
getQueryAnalyzer()
IQueryResultProvider
getResultProvider(PQuery query)
Returns a result provider for a given query.IQueryResultProvider
getResultProvider(PQuery query, QueryEvaluationHint hints)
Returns a result provider for a given query.ResultProviderRequestor
getResultProviderRequestor(PQuery query, QueryEvaluationHint userHints)
Returns a requestor that this backend uses while processing pattern calls from this query.IQueryRuntimeContext
getRuntimeContext()
IPlanDescriptor
getSearchPlan(PQuery query, java.util.Set<PParameter> adornment)
Returns a search plan for a given query and adornment if such plan is already calculated.protected abstract AbstractLocalSearchResultProvider
initializeResultProvider(PQuery query, QueryEvaluationHint hints)
boolean
isCaching()
AbstractLocalSearchResultProvider
peekExistingResultProvider(PQuery query)
Returns an existing result provider for a given query, if it was previously constructed, returns null otherwise.void
recomputePlans()
Updates the previously stored search plans for one or more given queries, computing a new set of plans if necessary The new plans created are the same that would be created by executing prepare on the given query definitions.void
recomputePlans(java.util.Collection<PQuery> queries)
Updates the previously stored search plans for one or more given queries, computing a new set of plans if necessary The new plans created are the same that would be created by executing prepare on the given query definitions.void
recomputePlans(PQuery... queries)
Updates the previously stored search plans for one or more given queries, computing a new set of plans if necessary.void
removeAdapter(ILocalSearchAdapter adapter)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.viatra.query.runtime.matchers.backend.IQueryBackend
getFactory
-
-
-
-
Constructor Detail
-
LocalSearchBackend
public LocalSearchBackend(IQueryBackendContext context)
- Since:
- 1.5
-
-
Method Detail
-
flushUpdates
public void flushUpdates()
Description copied from interface:IQueryBackend
Propagates all pending updates in this query backend. The implementation of this method is optional, and it can be ignored entirely if the backend does not delay updates.- Specified by:
flushUpdates
in interfaceIQueryBackend
-
getResultProvider
public IQueryResultProvider getResultProvider(PQuery query)
Description copied from interface:IQueryBackend
Returns a result provider for a given query. Repeated calls may return the same instance.- Specified by:
getResultProvider
in interfaceIQueryBackend
-
getResultProvider
public IQueryResultProvider getResultProvider(PQuery query, QueryEvaluationHint hints)
Description copied from interface:IQueryBackend
Returns a result provider for a given query. Repeated calls may return the same instance.- Specified by:
getResultProvider
in interfaceIQueryBackend
- Since:
- 1.4
-
getResultProviderRequestor
public ResultProviderRequestor getResultProviderRequestor(PQuery query, QueryEvaluationHint userHints)
Returns a requestor that this backend uses while processing pattern calls from this query.- Since:
- 2.1
- No Reference:
- This method is not intended to be referenced by clients.
-
initializeResultProvider
protected abstract AbstractLocalSearchResultProvider initializeResultProvider(PQuery query, QueryEvaluationHint hints)
- Throws:
ViatraQueryRuntimeException
- Since:
- 1.7
-
dispose
public void dispose()
Description copied from interface:IQueryBackend
Disposes the query backend.- Specified by:
dispose
in interfaceIQueryBackend
-
isCaching
public boolean isCaching()
- Specified by:
isCaching
in interfaceIQueryBackend
- Returns:
- true iff this backend is incremental, i.e. it caches the results of queries for quick retrieval, and can provide update notifications on result set changes.
-
peekExistingResultProvider
public AbstractLocalSearchResultProvider peekExistingResultProvider(PQuery query)
Description copied from interface:IQueryBackend
Returns an existing result provider for a given query, if it was previously constructed, returns null otherwise. Will not construct and initialize new result providers.- Specified by:
peekExistingResultProvider
in interfaceIQueryBackend
- Since:
- 2.0
-
getRuntimeContext
public IQueryRuntimeContext getRuntimeContext()
- Since:
- 1.4
-
getQueryAnalyzer
public QueryAnalyzer getQueryAnalyzer()
- Since:
- 1.5
-
getHintProvider
public IQueryBackendHintProvider getHintProvider()
- Since:
- 1.4
-
addAdapter
public void addAdapter(ILocalSearchAdapter adapter)
- Since:
- 1.5
-
removeAdapter
public void removeAdapter(ILocalSearchAdapter adapter)
- Since:
- 1.5
-
getAdapters
public java.util.List<ILocalSearchAdapter> getAdapters()
Return a copy of the current adapters- Since:
- 1.7
-
getBackendContext
public IQueryBackendContext getBackendContext()
- Since:
- 1.5
-
getCache
public ICache getCache()
Returns the internal cache of the backend- Since:
- 1.7
- No Reference:
- This method is not intended to be referenced by clients.
-
recomputePlans
public void recomputePlans(PQuery... queries)
Updates the previously stored search plans for one or more given queries, computing a new set of plans if necessary. The new plans created are the same that would be created by executing prepare on the given query definitions.- Since:
- 2.0
-
recomputePlans
public void recomputePlans(java.util.Collection<PQuery> queries)
Updates the previously stored search plans for one or more given queries, computing a new set of plans if necessary The new plans created are the same that would be created by executing prepare on the given query definitions.- Since:
- 2.0
-
recomputePlans
public void recomputePlans()
Updates the previously stored search plans for one or more given queries, computing a new set of plans if necessary The new plans created are the same that would be created by executing prepare on the given query definitions.- Since:
- 2.0
-
getSearchPlan
public IPlanDescriptor getSearchPlan(PQuery query, java.util.Set<PParameter> adornment)
Returns a search plan for a given query and adornment if such plan is already calculated.- Returns:
- a previously calculated search plan for the given query and adornment, or null if no such plan exists
- Since:
- 2.0
-
-