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
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.
|
equals, get, getBeanFactory, getConf, getFields, getFieldsToQuery, getKeyClass, getOrCreateConf, getPersistentClass, getSchemaName, initialize, newKey, newPersistent, readFields, setBeanFactory, setConf, setKeyClass, setPersistentClass, truncateSchema, write
public String getSchemaName()
DataStore
public boolean delete(K key)
DataStore
key
- the key of the objectpublic long deleteByQuery(Query<K,T> query)
DataStore
query
- matching records to this query will be deletedpublic Result<K,T> execute(Query<K,T> query)
DataStore
query
- the query to execute.Result
object.public T get(K key, String[] fields)
DataStore
key
- the key of the objectfields
- the fields required in the object. Pass null, to retrieve all fieldspublic Query<K,T> newQuery()
DataStore
public void put(K key, T obj)
DataStore
public List<PartitionQuery<K,T>> getPartitions(Query<K,T> query)
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)public void close()
DataStore
public void createSchema()
DataStore
public void deleteSchema()
DataStore
public boolean schemaExists()
DataStore
public void flush()
DataStore
Copyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.