public class MemStore<K,T extends PersistentBase> extends DataStoreBase<K,T>
DataStore implementation for tests.| Modifier and Type | Class and Description |
|---|---|
static class |
MemStore.MemQuery<K,T extends PersistentBase> |
static class |
MemStore.MemResult<K,T extends PersistentBase> |
autoCreateSchema, beanFactory, conf, datumReader, datumWriter, fieldMap, keyClass, LOG, persistentClass, properties, schema| Constructor and Description |
|---|
MemStore() |
| Modifier and Type | Method and Description |
|---|---|
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
PartitionQuerys,
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.
|
equals, get, getBeanFactory, getConf, getFields, getFieldsToQuery, getKeyClass, getOrCreateConf, getPersistentClass, getSchemaName, initialize, newKey, newPersistent, readFields, setBeanFactory, setConf, setKeyClass, setPersistentClass, truncateSchema, writepublic String getSchemaName()
DataStorepublic boolean delete(K key)
DataStorekey - the key of the objectpublic long deleteByQuery(Query<K,T> query)
DataStorequery - matching records to this query will be deletedpublic Result<K,T> execute(Query<K,T> query)
DataStorequery - the query to execute.Result object.public T get(K key, String[] fields)
DataStorekey - the key of the objectfields - the fields required in the object. Pass null, to retrieve all fieldspublic Query<K,T> newQuery()
DataStorepublic void put(K key, T obj)
DataStorepublic List<PartitionQuery<K,T>> getPartitions(Query<K,T> query)
DataStorePartitionQuerys,
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)public void close()
DataStorepublic void createSchema()
DataStorepublic void deleteSchema()
DataStorepublic boolean schemaExists()
DataStorepublic void flush()
DataStoreCopyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.