|
||||||||||
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.accumulo.store.AccumuloStore<K,T>
public class AccumuloStore<K,T extends Persistent>
Field Summary | |
---|---|
protected static String |
DEFAULT_MAPPING_FILE
|
protected static String |
INSTANCE_NAME_PROPERTY
|
protected static String |
MOCK_PROPERTY
|
protected static String |
PASSWORD_PROPERTY
|
protected static String |
USERNAME_PROPERTY
|
protected static String |
ZOOKEEPERS_NAME_PROPERTY
|
Fields inherited from class org.apache.gora.store.impl.DataStoreBase |
---|
autoCreateSchema, beanFactory, conf, datumReader, datumWriter, fieldMap, keyClass, persistentClass, properties, schema |
Constructor Summary | |
---|---|
AccumuloStore()
|
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. |
|
K |
fromBytes(Class<K> clazz,
byte[] val)
|
|
static
|
fromBytes(Encoder encoder,
Class<K> clazz,
byte[] val)
|
|
static Object |
fromBytes(Encoder encoder,
org.apache.avro.Schema schema,
byte[] data)
|
|
Object |
fromBytes(org.apache.avro.Schema schema,
byte[] data)
|
|
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 |
|
void |
initialize(Class<K> keyClass,
Class<T> persistentClass,
Properties properties)
Initializes this DataStore. |
|
Query<K,T> |
newQuery()
Constructs and returns a new Query. |
|
org.apache.accumulo.core.data.ByteSequence |
populate(Iterator<Map.Entry<org.apache.accumulo.core.data.Key,org.apache.accumulo.core.data.Value>> iter,
T persistent)
|
|
void |
put(K key,
T val)
Inserts the persistent object with the given key. |
|
protected AccumuloMapping |
readMapping(String filename)
|
|
boolean |
schemaExists()
Returns whether the schema that holds the data exists in the datastore. |
|
static byte[] |
toBytes(Encoder encoder,
Object o)
|
|
byte[] |
toBytes(Object o)
|
Methods inherited from class org.apache.gora.store.impl.DataStoreBase |
---|
equals, get, getBeanFactory, getConf, getFieldsToQuery, getKeyClass, getOrCreateConf, getPersistentClass, getSchemaName, 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 |
---|
protected static final String MOCK_PROPERTY
protected static final String INSTANCE_NAME_PROPERTY
protected static final String ZOOKEEPERS_NAME_PROPERTY
protected static final String USERNAME_PROPERTY
protected static final String PASSWORD_PROPERTY
protected static final String DEFAULT_MAPPING_FILE
Constructor Detail |
---|
public AccumuloStore()
Method Detail |
---|
public Object fromBytes(org.apache.avro.Schema schema, byte[] data)
public static Object fromBytes(Encoder encoder, org.apache.avro.Schema schema, byte[] data)
public K fromBytes(Class<K> clazz, byte[] val)
public static <K> K fromBytes(Encoder encoder, Class<K> clazz, byte[] val)
public byte[] toBytes(Object o)
public static byte[] toBytes(Encoder encoder, Object o)
public void initialize(Class<K> keyClass, Class<T> persistentClass, Properties properties) throws IOException
DataStore
initialize
in interface DataStore<K,T extends Persistent>
initialize
in class DataStoreBase<K,T extends Persistent>
keyClass
- the class of the keyspersistentClass
- the class of the persistent objectsproperties
- extra metadata
IOException
protected AccumuloMapping readMapping(String filename) throws IOException
IOException
public String getSchemaName()
DataStore
public void createSchema() throws IOException
DataStore
IOException
public void deleteSchema() throws IOException
DataStore
IOException
public boolean schemaExists() throws IOException
DataStore
IOException
public org.apache.accumulo.core.data.ByteSequence populate(Iterator<Map.Entry<org.apache.accumulo.core.data.Key,org.apache.accumulo.core.data.Value>> iter, T persistent) throws IOException
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 void put(K key, T val) throws IOException
DataStore
IOException
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 Query<K,T> newQuery()
DataStore
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 flush() throws IOException
DataStore
IOException
public void close() throws IOException
DataStore
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |