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

org.apache.gora.query.impl
Class PartitionQueryImpl<K,T extends Persistent>

java.lang.Object
  extended by org.apache.gora.query.impl.QueryBase<K,T>
      extended by org.apache.gora.query.impl.PartitionQueryImpl<K,T>
All Implemented Interfaces:
PartitionQuery<K,T>, Query<K,T>, org.apache.hadoop.conf.Configurable, org.apache.hadoop.io.Writable
Direct Known Subclasses:
FileSplitPartitionQuery

public class PartitionQueryImpl<K,T extends Persistent>
extends QueryBase<K,T>
implements PartitionQuery<K,T>

Implementation for PartitionQuery.


Field Summary
protected  Query<K,T> baseQuery
           
protected  String[] locations
           
 
Fields inherited from class org.apache.gora.query.impl.QueryBase
dataStore, endKey, endTime, fields, filter, isCompiled, limit, queryString, startKey, startTime
 
Constructor Summary
PartitionQueryImpl()
           
PartitionQueryImpl(Query<K,T> baseQuery, K startKey, K endKey, String... locations)
           
PartitionQueryImpl(Query<K,T> baseQuery, String... locations)
           
 
Method Summary
 boolean equals(Object obj)
           
 Query<K,T> getBaseQuery()
           
 DataStore<K,T> getDataStore()
          Returns the DataStore, that this Query is associated with.
 long getEndTime()
           
 String[] getFields()
           
 long getLimit()
          Returns the maximum number of results
 String[] getLocations()
          Returns the locations on which this partial query will run locally.
 long getStartTime()
           
 long getTimestamp()
           
 void readFields(DataInput in)
           
 void setEndTime(long endTime)
           
 void setFields(String... fields)
           
 void setLimit(long limit)
          Sets the maximum number of results to return.
 void setStartTime(long startTime)
           
 void setTimeRange(long startTime, long endTime)
           
 void setTimestamp(long timestamp)
           
 void write(DataOutput out)
           
 
Methods inherited from class org.apache.gora.query.impl.QueryBase
execute, getConf, getEndKey, getKey, getStartKey, hashCode, setConf, setDataStore, setEndKey, setKey, setKeyRange, setStartKey, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.gora.query.Query
execute, getEndKey, getKey, getStartKey, setDataStore, setEndKey, setKey, setKeyRange, setStartKey
 
Methods inherited from interface org.apache.hadoop.conf.Configurable
getConf, setConf
 

Field Detail

baseQuery

protected Query<K,T extends Persistent> baseQuery

locations

protected String[] locations
Constructor Detail

PartitionQueryImpl

public PartitionQueryImpl()

PartitionQueryImpl

public PartitionQueryImpl(Query<K,T> baseQuery,
                          String... locations)

PartitionQueryImpl

public PartitionQueryImpl(Query<K,T> baseQuery,
                          K startKey,
                          K endKey,
                          String... locations)
Method Detail

getLocations

public String[] getLocations()
Description copied from interface: PartitionQuery
Returns the locations on which this partial query will run locally.

Specified by:
getLocations in interface PartitionQuery<K,T extends Persistent>
Returns:
the addresses of machines

getBaseQuery

public Query<K,T> getBaseQuery()

getFields

public String[] getFields()
Specified by:
getFields in interface Query<K,T extends Persistent>
Overrides:
getFields in class QueryBase<K,T extends Persistent>

getDataStore

public DataStore<K,T> getDataStore()
Description copied from interface: Query
Returns the DataStore, that this Query is associated with.

Specified by:
getDataStore in interface Query<K,T extends Persistent>
Overrides:
getDataStore in class QueryBase<K,T extends Persistent>
Returns:
the DataStore of the Query

getTimestamp

public long getTimestamp()
Specified by:
getTimestamp in interface Query<K,T extends Persistent>
Overrides:
getTimestamp in class QueryBase<K,T extends Persistent>

getStartTime

public long getStartTime()
Specified by:
getStartTime in interface Query<K,T extends Persistent>
Overrides:
getStartTime in class QueryBase<K,T extends Persistent>

getEndTime

public long getEndTime()
Specified by:
getEndTime in interface Query<K,T extends Persistent>
Overrides:
getEndTime in class QueryBase<K,T extends Persistent>

getLimit

public long getLimit()
Description copied from interface: Query
Returns the maximum number of results

Specified by:
getLimit in interface Query<K,T extends Persistent>
Overrides:
getLimit in class QueryBase<K,T extends Persistent>
Returns:
the limit if it is set, otherwise a negative number

setFields

public void setFields(String... fields)
Specified by:
setFields in interface Query<K,T extends Persistent>
Overrides:
setFields in class QueryBase<K,T extends Persistent>

setTimestamp

public void setTimestamp(long timestamp)
Specified by:
setTimestamp in interface Query<K,T extends Persistent>
Overrides:
setTimestamp in class QueryBase<K,T extends Persistent>

setStartTime

public void setStartTime(long startTime)
Specified by:
setStartTime in interface Query<K,T extends Persistent>
Overrides:
setStartTime in class QueryBase<K,T extends Persistent>

setEndTime

public void setEndTime(long endTime)
Specified by:
setEndTime in interface Query<K,T extends Persistent>
Overrides:
setEndTime in class QueryBase<K,T extends Persistent>

setTimeRange

public void setTimeRange(long startTime,
                         long endTime)
Specified by:
setTimeRange in interface Query<K,T extends Persistent>
Overrides:
setTimeRange in class QueryBase<K,T extends Persistent>

setLimit

public void setLimit(long limit)
Description copied from interface: Query
Sets the maximum number of results to return.

Specified by:
setLimit in interface Query<K,T extends Persistent>
Overrides:
setLimit in class QueryBase<K,T extends Persistent>

write

public void write(DataOutput out)
           throws IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Overrides:
write in class QueryBase<K,T extends Persistent>
Throws:
IOException

readFields

public void readFields(DataInput in)
                throws IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Overrides:
readFields in class QueryBase<K,T extends Persistent>
Throws:
IOException

equals

public boolean equals(Object obj)
Overrides:
equals in class QueryBase<K,T extends Persistent>


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