public interface SimpleStore
Store.
The expected data model is that one of column-oriented databases such as data models of BigTable, HBase or Cassandra.
To summarize, a data store should provide a set of maps (we'll call tables).
Each one of these tables is a map which contains rows that associate a String key with a set of column families.
It should be easy and efficient to find a row in a table using its key, or defining a key with a minimum value and a maximum value as if key would be organized in a dictionary (see String.compareTo(String)).
Each column family is a map which associates a qualifier with data, represented by a byte array.a default implementation| Modifier and Type | Method and Description |
|---|---|
long |
count(String table,
Constraint c)
Counts the number of element satisfying the constraint.
|
void |
delete(String table,
String id)
Deletes the given row
|
boolean |
exists(String table,
String row)
Tests for a row.
|
boolean |
exists(String table,
String row,
String family)
Tests whether a column family is empty.
|
CloseableKeyIterator |
get(String table,
Constraint c,
int limit,
Set<String> families)
Rows matching constraint sorted according to their key in ascending order.
|
Row.ColumnFamilyData |
get(String table,
String id,
Set<String> families)
Returns all elements in families ; no side-effect.
|
Map<String,byte[]> |
get(String table,
String id,
String family)
Returns all elements in a family ; no side-effect.
|
Map<String,byte[]> |
get(String table,
String id,
String family,
Constraint c)
Returns all elements in a family ; no side-effect.
|
byte[] |
get(String table,
String row,
String family,
String key)
Returns an element from a family.
|
boolean |
hasTable(String tableName)
Checks whether the given table exists in this store.
|
void |
start()
Called once the store is created ; only one store is instanciated with the same properties.
|
void |
storeChanges(String table,
String id,
Row.ColumnFamilyData changed,
Map<String,Set<String>> removed,
Map<String,Map<String,Number>> increments)
Stores given piece of information.
|
void start()
throws DatabaseNotReachedException
DatabaseNotReachedExceptionboolean hasTable(String tableName) throws DatabaseNotReachedException
DatabaseNotReachedExceptionboolean exists(String table, String row) throws DatabaseNotReachedException
DatabaseNotReachedExceptionboolean exists(String table, String row, String family) throws DatabaseNotReachedException
DatabaseNotReachedExceptionCloseableKeyIterator get(String table, Constraint c, int limit, Set<String> families) throws DatabaseNotReachedException
families - TODODatabaseNotReachedExceptionbyte[] get(String table, String row, String family, String key) throws DatabaseNotReachedException
DatabaseNotReachedExceptionMap<String,byte[]> get(String table, String id, String family) throws DatabaseNotReachedException
DatabaseNotReachedExceptionMap<String,byte[]> get(String table, String id, String family, Constraint c) throws DatabaseNotReachedException
DatabaseNotReachedExceptionRow.ColumnFamilyData get(String table, String id, Set<String> families) throws DatabaseNotReachedException
table - the table from which to find the elementid - the unique identifier (i.e. the key) with which the element was storedfamilies - the set of column families to be activated ; should never be null or emptyDatabaseNotReachedExceptionvoid storeChanges(String table, String id, Row.ColumnFamilyData changed, Map<String,Set<String>> removed, Map<String,Map<String,Number>> increments) throws DatabaseNotReachedException
DatabaseNotReachedExceptionvoid delete(String table, String id) throws DatabaseNotReachedException
DatabaseNotReachedExceptionlong count(String table, Constraint c) throws DatabaseNotReachedException
DatabaseNotReachedExceptionCopyright © 2016. All Rights Reserved.