public abstract class AbstractQueryExecutor extends Object implements IQueryExecutor
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractQueryExecutor.EntriesOrderByComparator
This private class implements the Comparator and is used to sort.
|
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
_logger |
protected AbstractDMLQuery |
query |
Constructor and Description |
---|
AbstractQueryExecutor() |
AbstractQueryExecutor(AbstractDMLQuery query) |
Modifier and Type | Method and Description |
---|---|
IEntryPacket |
aggregate(IQueryResultSet<IEntryPacket> entries)
Execute SQL function that processes the result entries and calculates one value -
sum,average,min,max
|
Number |
avg(SelectColumn funcColumn,
IQueryResultSet<IEntryPacket> entries)
Calculate the average value of the given column for all entries .
|
int |
clear(QueryTemplatePacket template,
ISpaceProxy space,
Transaction txn,
int modifiers)
Execute clear
|
ResultEntry |
convertEntriesToResultArrays(IQueryResultSet<IEntryPacket> entries)
Converts the list of ExternaEntries to 2 dimensional array that contains the values of the
entries.
|
int |
count(QueryTemplatePacket template,
ISpaceProxy space,
Transaction txn,
int readModifier) |
void |
execute(InnerQueryNode innerQueryNode,
ISpaceProxy space,
Transaction txn,
int readModifier,
int max)
Executes an inner query
|
IQueryResultSet<IEntryPacket> |
executeTemplate(QueryTemplatePacket template,
ISpaceProxy space,
Transaction txn,
int readModifier,
int max) |
IQueryResultSet<IEntryPacket> |
extractResults(ExpNode node) |
IQueryResultSet<IEntryPacket> |
filterDistinctEntries(IQueryResultSet<IEntryPacket> entries)
Removes duplicate entries from the result set.
|
Comparator<IEntryPacket> |
getGroupByComparator(IQueryResultSet<IEntryPacket> queryResult,
List<SelectColumn> groupColumns) |
protected HashMap<ExpNode,IQueryResultSet<IEntryPacket>> |
getIntermediateResults() |
Comparator<IEntryPacket> |
getOrderByComparator(IQueryResultSet<IEntryPacket> entries,
List<OrderColumn> orderColumns) |
AbstractDMLQuery |
getQuery() |
IQueryResultSet<IEntryPacket> |
groupBy(IQueryResultSet<IEntryPacket> entries,
List<SelectColumn> groupColumns)
Group the results according to the group by clause
|
Object |
minMax(SelectColumn funcColumn,
IQueryResultSet<IEntryPacket> entries,
boolean isMax)
Finds the minimum/maximum value of given column
|
void |
orderBy(IQueryResultSet<IEntryPacket> entries,
List<OrderColumn> orderColumns)
Order the results according to the order by clause
|
IQueryResultSet |
readAll(ISpaceProxy space,
Transaction txn) |
void |
readExternal(ObjectInput in) |
void |
setResults(ExpNode node,
IQueryResultSet<IEntryPacket> results) |
Number |
sum(SelectColumn funcColumn,
IQueryResultSet<IEntryPacket> entries)
Calculate the sum value of the given column for all entries
|
protected IQueryResultSet<IEntryPacket> |
traverseExpressionTree(ExpNode root,
ISpaceProxy space,
Transaction txn,
int readModifier,
int max)
Traverse the binary expression tree non-recursively using a custom stack The tree has to be
traversed in postorder - the parent is traversed after its children.
|
void |
writeExternal(ObjectOutput out) |
protected static final org.slf4j.Logger _logger
protected AbstractDMLQuery query
public AbstractQueryExecutor()
public AbstractQueryExecutor(AbstractDMLQuery query)
public int clear(QueryTemplatePacket template, ISpaceProxy space, Transaction txn, int modifiers) throws RemoteException, TransactionException, UnusableEntryException
IQueryExecutor
clear
in interface IQueryExecutor
RemoteException
TransactionException
UnusableEntryException
public int count(QueryTemplatePacket template, ISpaceProxy space, Transaction txn, int readModifier) throws SQLException
count
in interface IQueryExecutor
SQLException
public AbstractDMLQuery getQuery()
public IQueryResultSet<IEntryPacket> extractResults(ExpNode node)
public void setResults(ExpNode node, IQueryResultSet<IEntryPacket> results)
protected IQueryResultSet<IEntryPacket> traverseExpressionTree(ExpNode root, ISpaceProxy space, Transaction txn, int readModifier, int max) throws SQLException
SQLException
public IQueryResultSet readAll(ISpaceProxy space, Transaction txn) throws SQLException
readAll
in interface IQueryExecutor
SQLException
public IQueryResultSet<IEntryPacket> executeTemplate(QueryTemplatePacket template, ISpaceProxy space, Transaction txn, int readModifier, int max) throws SQLException
SQLException
protected HashMap<ExpNode,IQueryResultSet<IEntryPacket>> getIntermediateResults()
public IEntryPacket aggregate(IQueryResultSet<IEntryPacket> entries) throws SQLException
aggregate
in interface IQueryExecutor
SQLException
public IQueryResultSet<IEntryPacket> groupBy(IQueryResultSet<IEntryPacket> entries, List<SelectColumn> groupColumns) throws SQLException
groupBy
in interface IQueryExecutor
SQLException
public Comparator<IEntryPacket> getGroupByComparator(IQueryResultSet<IEntryPacket> queryResult, List<SelectColumn> groupColumns)
public void orderBy(IQueryResultSet<IEntryPacket> entries, List<OrderColumn> orderColumns) throws SQLException
orderBy
in interface IQueryExecutor
SQLException
public Comparator<IEntryPacket> getOrderByComparator(IQueryResultSet<IEntryPacket> entries, List<OrderColumn> orderColumns)
public Object minMax(SelectColumn funcColumn, IQueryResultSet<IEntryPacket> entries, boolean isMax)
public Number avg(SelectColumn funcColumn, IQueryResultSet<IEntryPacket> entries) throws SQLException
SQLException
public Number sum(SelectColumn funcColumn, IQueryResultSet<IEntryPacket> entries) throws SQLException
SQLException
public IQueryResultSet<IEntryPacket> filterDistinctEntries(IQueryResultSet<IEntryPacket> entries)
filterDistinctEntries
in interface IQueryExecutor
public ResultEntry convertEntriesToResultArrays(IQueryResultSet<IEntryPacket> entries)
convertEntriesToResultArrays
in interface IQueryExecutor
public void execute(InnerQueryNode innerQueryNode, ISpaceProxy space, Transaction txn, int readModifier, int max) throws SQLException
execute
in interface IQueryExecutor
SQLException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
Copyright © GigaSpaces.