This project has retired. For details please refer to its Attic page.
Query (Apache Gora 0.2 API)

org.apache.gora.query
Interface Query<K,T extends Persistent>

All Superinterfaces:
org.apache.hadoop.conf.Configurable, org.apache.hadoop.io.Writable
All Known Subinterfaces:
PartitionQuery<K,T>
All Known Implementing Classes:
AccumuloQuery, AvroQuery, CassandraQuery, FileSplitPartitionQuery, HBaseQuery, MemStore.MemQuery, PartitionQueryImpl, QueryBase, SqlQuery

public interface Query<K,T extends Persistent>
extends org.apache.hadoop.io.Writable, org.apache.hadoop.conf.Configurable

A query to a data store to retrieve objects. Queries are constructed by the DataStore implementation via DataStore.newQuery().


Method Summary
 Result<K,T> execute()
          Executes the Query on the DataStore and returns the results.
 DataStore<K,T> getDataStore()
          Returns the DataStore, that this Query is associated with.
 K getEndKey()
           
 long getEndTime()
           
 String[] getFields()
           
 K getKey()
           
 long getLimit()
          Returns the maximum number of results
 K getStartKey()
           
 long getStartTime()
           
 long getTimestamp()
           
 void setDataStore(DataStore<K,T> dataStore)
          Sets the dataStore of this query.
 void setEndKey(K endKey)
           
 void setEndTime(long endTime)
           
 void setFields(String... fieldNames)
           
 void setKey(K key)
           
 void setKeyRange(K startKey, K endKey)
          Set the range of keys over which the query will execute.
 void setLimit(long limit)
          Sets the maximum number of results to return.
 void setStartKey(K startKey)
           
 void setStartTime(long startTime)
           
 void setTimeRange(long startTime, long endTime)
           
 void setTimestamp(long timestamp)
           
 
Methods inherited from interface org.apache.hadoop.io.Writable
readFields, write
 
Methods inherited from interface org.apache.hadoop.conf.Configurable
getConf, setConf
 

Method Detail

setDataStore

void setDataStore(DataStore<K,T> dataStore)
Sets the dataStore of this query. Under normal operation, this call is not necessary and it is potentially dangerous. So use this method only if you know what you are doing.

Parameters:
dataStore - the dataStore of the query

getDataStore

DataStore<K,T> getDataStore()
Returns the DataStore, that this Query is associated with.

Returns:
the DataStore of the Query

execute

Result<K,T> execute()
                                       throws IOException
Executes the Query on the DataStore and returns the results.

Returns:
the Result for the query.
Throws:
IOException

setFields

void setFields(String... fieldNames)

getFields

String[] getFields()

setKey

void setKey(K key)

setStartKey

void setStartKey(K startKey)
Parameters:
startKey - an inclusive start key

setEndKey

void setEndKey(K endKey)
Parameters:
endKey - an inclusive end key

setKeyRange

void setKeyRange(K startKey,
                 K endKey)
Set the range of keys over which the query will execute.

Parameters:
startKey - an inclusive start key
endKey - an inclusive end key

getKey

K getKey()

getStartKey

K getStartKey()

getEndKey

K getEndKey()

setTimestamp

void setTimestamp(long timestamp)

setStartTime

void setStartTime(long startTime)

setEndTime

void setEndTime(long endTime)

setTimeRange

void setTimeRange(long startTime,
                  long endTime)

getTimestamp

long getTimestamp()

getStartTime

long getStartTime()

getEndTime

long getEndTime()

setLimit

void setLimit(long limit)
Sets the maximum number of results to return.


getLimit

long getLimit()
Returns the maximum number of results

Returns:
the limit if it is set, otherwise a negative number


Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.