|
||||||||||
| 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.hbase.store.HBaseStore<K,T>
public class HBaseStore<K,T extends Persistent>
DataStore for HBase. Thread safe.
| Field Summary | |
|---|---|
static String |
DEFAULT_MAPPING_FILE
|
static org.apache.commons.logging.Log |
log
|
static String |
PARSE_MAPPING_FILE_KEY
|
| Fields inherited from class org.apache.gora.store.impl.DataStoreBase |
|---|
beanFactory, datumReader, datumWriter, fieldMap, keyClass, persistentClass, properties, schema |
| Constructor Summary | |
|---|---|
HBaseStore()
|
|
| Method Summary | |
|---|---|
void |
close()
Close the DataStore. |
org.apache.hadoop.hbase.client.ResultScanner |
createScanner(Query<K,T> query)
|
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. |
void |
delete(T obj)
|
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. |
org.apache.hadoop.conf.Configuration |
getConf()
|
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 |
void |
initialize(Class<K> keyClass,
Class<T> persistentClass,
Properties properties)
Initializes this DataStore. |
T |
newInstance(org.apache.hadoop.hbase.client.Result result,
String[] fields)
|
Query<K,T> |
newQuery()
Constructs and returns a new Query. |
void |
put(K key,
T persistent)
Inserts the persistent object with the given key. |
boolean |
schemaExists()
Returns whether the schema that holds the data exists in the datastore. |
void |
setConf(org.apache.hadoop.conf.Configuration conf)
|
| Methods inherited from class org.apache.gora.store.impl.DataStoreBase |
|---|
equals, get, getBeanFactory, getFieldsToQuery, getKeyClass, getOrCreateConf, getPersistentClass, getSchemaName, newKey, newPersistent, readFields, setBeanFactory, 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.apache.commons.logging.Log log
public static final String PARSE_MAPPING_FILE_KEY
public static final String DEFAULT_MAPPING_FILE
| Constructor Detail |
|---|
public HBaseStore()
| Method Detail |
|---|
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
IOExceptionpublic String getSchemaName()
DataStore
getSchemaName in interface DataStore<K,T extends Persistent>
public void createSchema()
throws IOException
DataStore
createSchema in interface DataStore<K,T extends Persistent>IOException
public void deleteSchema()
throws IOException
DataStore
deleteSchema in interface DataStore<K,T extends Persistent>IOException
public boolean schemaExists()
throws IOException
DataStore
schemaExists in interface DataStore<K,T extends Persistent>IOException
public T get(K key,
String[] fields)
throws IOException
DataStore
get in interface DataStore<K,T extends Persistent>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 persistent)
throws IOException
DataStore
put in interface DataStore<K,T extends Persistent>IOExceptionpublic void delete(T obj)
public boolean delete(K key)
throws IOException
delete in interface DataStore<K,T extends Persistent>key - the key of the object
IOException
public long deleteByQuery(Query<K,T> query)
throws IOException
DataStore
deleteByQuery in interface DataStore<K,T extends Persistent>query - matching records to this query will be deleted
IOException
public void flush()
throws IOException
DataStore
flush in interface DataStore<K,T extends Persistent>IOExceptionpublic Query<K,T> newQuery()
DataStore
newQuery in interface DataStore<K,T extends Persistent>
public List<PartitionQuery<K,T>> getPartitions(Query<K,T> query)
throws IOException
DataStorePartitionQuerys,
which will execute on local data.
getPartitions in interface DataStore<K,T extends Persistent>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 Result<K,T> execute(Query<K,T> query)
throws IOException
DataStore
execute in interface DataStore<K,T extends Persistent>query - the query to execute.
Result object.
IOException
public org.apache.hadoop.hbase.client.ResultScanner createScanner(Query<K,T> query)
throws IOException
IOException
public T newInstance(org.apache.hadoop.hbase.client.Result result,
String[] fields)
throws IOException
IOException
public void close()
throws IOException
DataStore
close in interface Closeableclose in interface DataStore<K,T extends Persistent>IOExceptionpublic org.apache.hadoop.conf.Configuration getConf()
getConf in interface DataStore<K,T extends Persistent>getConf in interface org.apache.hadoop.conf.ConfigurablegetConf in class DataStoreBase<K,T extends Persistent>public void setConf(org.apache.hadoop.conf.Configuration conf)
setConf in interface DataStore<K,T extends Persistent>setConf in interface org.apache.hadoop.conf.ConfigurablesetConf in class DataStoreBase<K,T extends Persistent>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||