|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.gora.store.impl.DataStoreBase<K,T>
org.apache.gora.cassandra.store.CassandraStore<K,T>
public class CassandraStore<K,T extends Persistent>
Field Summary | |
---|---|
static org.slf4j.Logger |
LOG
|
Fields inherited from class org.apache.gora.store.impl.DataStoreBase |
---|
autoCreateSchema, beanFactory, conf, datumReader, datumWriter, fieldMap, keyClass, persistentClass, properties, schema |
Constructor Summary | |
---|---|
CassandraStore()
|
Method Summary | |
---|---|
void |
close()
Close the DataStore. |
void |
createSchema()
Creates the optional schema or table (or similar) in the datastore to hold the objects. |
boolean |
delete(K key)
Deletes the object with the given key |
long |
deleteByQuery(Query<K,T> query)
Deletes all the objects matching the query. |
void |
deleteSchema()
Deletes the underlying schema or table (or similar) in the datastore that holds the objects. |
Result<K,T> |
execute(Query<K,T> query)
Executes the given query and returns the results. |
void |
flush()
Flush the buffer. |
T |
get(K key,
String[] fields)
Returns the object corresponding to the given key. |
List<PartitionQuery<K,T>> |
getPartitions(Query<K,T> query)
Partitions the given query and returns a list of PartitionQuery s,
which will execute on local data. |
String |
getSchemaName()
Returns the schema name given to this DataStore |
Query<K,T> |
newQuery()
Constructs and returns a new Query. |
void |
put(K key,
T value)
Duplicate instance to keep all the objects in memory till flushing. |
boolean |
schemaExists()
Returns whether the schema that holds the data exists in the datastore. |
Methods inherited from class org.apache.gora.store.impl.DataStoreBase |
---|
equals, get, getBeanFactory, getConf, getFieldsToQuery, getKeyClass, getOrCreateConf, getPersistentClass, getSchemaName, initialize, newKey, newPersistent, readFields, setBeanFactory, setConf, setKeyClass, setPersistentClass, truncateSchema, write |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.slf4j.Logger LOG
Constructor Detail |
---|
public CassandraStore() throws Exception
Exception
Method Detail |
---|
public void close() throws IOException
DataStore
IOException
public void createSchema()
DataStore
public boolean delete(K key) throws IOException
DataStore
key
- the key of the object
IOException
public long deleteByQuery(Query<K,T> query) throws IOException
DataStore
query
- matching records to this query will be deleted
IOException
public void deleteSchema() throws IOException
DataStore
IOException
public Result<K,T> execute(Query<K,T> query) throws IOException
DataStore
query
- the query to execute.
Result
object.
IOException
public void flush() throws IOException
IOException
DataStore.flush()
public T get(K key, String[] fields) throws IOException
DataStore
key
- the key of the objectfields
- the fields required in the object. Pass null, to retrieve all fields
IOException
public List<PartitionQuery<K,T>> getPartitions(Query<K,T> query) throws IOException
DataStore
PartitionQuery
s,
which will execute on local data.
query
- the base query to create the partitions for. If the query
is null, then the data store returns the partitions for the default query
(returning every object)
IOException
public String getSchemaName()
DataStore
public Query<K,T> newQuery()
DataStore
public void put(K key, T value) throws IOException
IOException
DataStore.put(java.lang.Object, org.apache.gora.persistency.Persistent)
public boolean schemaExists() throws IOException
DataStore
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |