|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.gora.store.impl.DataStoreBase<K,T> org.apache.gora.memory.store.MemStore<K,T>
public class MemStore<K,T extends Persistent>
Memory based DataStore
implementation for tests.
Nested Class Summary | |
---|---|
static class |
MemStore.MemQuery<K,T extends Persistent>
|
static class |
MemStore.MemResult<K,T extends Persistent>
|
Field Summary |
---|
Fields inherited from class org.apache.gora.store.impl.DataStoreBase |
---|
autoCreateSchema, beanFactory, conf, datumReader, datumWriter, fieldMap, keyClass, persistentClass, properties, schema |
Constructor Summary | |
---|---|
MemStore()
|
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()
Forces the write caches to be flushed. |
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 obj)
Inserts the persistent object with the given key. |
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 |
Constructor Detail |
---|
public MemStore()
Method Detail |
---|
public String getSchemaName()
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 Result<K,T> execute(Query<K,T> query) throws IOException
DataStore
query
- the query to execute.
Result
object.
IOException
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 Query<K,T> newQuery()
DataStore
public void put(K key, T obj) throws IOException
DataStore
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 void close() throws IOException
DataStore
IOException
public void createSchema() throws IOException
DataStore
IOException
public void deleteSchema() throws IOException
DataStore
IOException
public boolean schemaExists() throws IOException
DataStore
IOException
public void flush() throws IOException
DataStore
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |