|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object me.prettyprint.cassandra.service.KeyspaceServiceImpl
public class KeyspaceServiceImpl
Implementation of a Keyspace
Field Summary |
---|
Fields inherited from interface me.prettyprint.cassandra.service.KeyspaceService |
---|
CF_TYPE, CF_TYPE_STANDARD, CF_TYPE_SUPER |
Constructor Summary | |
---|---|
KeyspaceServiceImpl(String keyspaceName,
ConsistencyLevelPolicy consistencyLevel,
HConnectionManager connectionManager,
FailoverPolicy failoverPolicy)
|
|
KeyspaceServiceImpl(String keyspaceName,
ConsistencyLevelPolicy consistencyLevel,
HConnectionManager connectionManager,
FailoverPolicy failoverPolicy,
Map<String,String> credentials)
|
Method Summary | |
---|---|
void |
addCounter(ByteBuffer key,
org.apache.cassandra.thrift.ColumnParent columnParent,
org.apache.cassandra.thrift.CounterColumn counterColumn)
Add a counter with CL.ONE |
void |
addCounter(String key,
org.apache.cassandra.thrift.ColumnParent columnParent,
org.apache.cassandra.thrift.CounterColumn counterColumn)
Add a counter with CL.ONE |
void |
batchMutate(BatchMutation batchMutate)
Call batch mutate with the BatchMutation object which encapsulates some of the complexity of the batch_mutate API signature |
void |
batchMutate(Map<ByteBuffer,Map<String,List<org.apache.cassandra.thrift.Mutation>>> mutationMap)
Call batch mutate with the assembled mutationMap. |
CassandraHost |
getCassandraHost()
|
org.apache.cassandra.thrift.Column |
getColumn(ByteBuffer key,
org.apache.cassandra.thrift.ColumnPath columnPath)
Get the Column at the given columnPath. |
org.apache.cassandra.thrift.Column |
getColumn(String key,
org.apache.cassandra.thrift.ColumnPath columnPath)
|
HConsistencyLevel |
getConsistencyLevel(OperationType operationType)
|
int |
getCount(ByteBuffer key,
org.apache.cassandra.thrift.ColumnParent columnParent,
org.apache.cassandra.thrift.SlicePredicate predicate)
Counts the columns present in columnParent. |
org.apache.cassandra.thrift.CounterColumn |
getCounter(ByteBuffer key,
org.apache.cassandra.thrift.ColumnPath columnPath)
Get the Counter at the given columnPath. |
org.apache.cassandra.thrift.CounterColumn |
getCounter(String key,
org.apache.cassandra.thrift.ColumnPath columnPath)
|
List<org.apache.cassandra.thrift.CounterColumn> |
getCounterSlice(ByteBuffer key,
org.apache.cassandra.thrift.ColumnParent columnParent,
org.apache.cassandra.thrift.SlicePredicate predicate)
Get the group of counter columns contained by columnParent. |
List<org.apache.cassandra.thrift.CounterColumn> |
getCounterSlice(String key,
org.apache.cassandra.thrift.ColumnParent columnParent,
org.apache.cassandra.thrift.SlicePredicate predicate)
|
List<org.apache.cassandra.thrift.CounterSuperColumn> |
getCounterSuperSlice(ByteBuffer key,
org.apache.cassandra.thrift.ColumnParent columnParent,
org.apache.cassandra.thrift.SlicePredicate predicate)
Get the group of superColumn contained by columnParent. |
List<org.apache.cassandra.thrift.CounterSuperColumn> |
getCounterSuperSlice(String key,
org.apache.cassandra.thrift.ColumnParent columnParent,
org.apache.cassandra.thrift.SlicePredicate predicate)
|
Map<ByteBuffer,List<org.apache.cassandra.thrift.Column>> |
getIndexedSlices(org.apache.cassandra.thrift.ColumnParent columnParent,
org.apache.cassandra.thrift.IndexClause indexClause,
org.apache.cassandra.thrift.SlicePredicate predicate)
returns a subset of columns for a range of keys. |
String |
getName()
|
Map<ByteBuffer,List<org.apache.cassandra.thrift.CounterColumn>> |
getRangeCounterSlices(org.apache.cassandra.thrift.ColumnParent columnParent,
org.apache.cassandra.thrift.SlicePredicate predicate,
org.apache.cassandra.thrift.KeyRange keyRange)
returns a subset of counter columns for a range of keys |
Map<ByteBuffer,List<org.apache.cassandra.thrift.Column>> |
getRangeSlices(org.apache.cassandra.thrift.ColumnParent columnParent,
org.apache.cassandra.thrift.SlicePredicate predicate,
org.apache.cassandra.thrift.KeyRange keyRange)
returns a subset of columns for a range of keys. |
List<org.apache.cassandra.thrift.Column> |
getSlice(ByteBuffer key,
org.apache.cassandra.thrift.ColumnParent columnParent,
org.apache.cassandra.thrift.SlicePredicate predicate)
Get the group of columns contained by columnParent. |
List<org.apache.cassandra.thrift.Column> |
getSlice(String key,
org.apache.cassandra.thrift.ColumnParent columnParent,
org.apache.cassandra.thrift.SlicePredicate predicate)
|
org.apache.cassandra.thrift.SuperColumn |
getSuperColumn(ByteBuffer key,
org.apache.cassandra.thrift.ColumnPath columnPath)
Get the SuperColumn at the given columnPath. |
org.apache.cassandra.thrift.SuperColumn |
getSuperColumn(ByteBuffer key,
org.apache.cassandra.thrift.ColumnPath columnPath,
boolean reversed,
int size)
Get the SuperColumn at the given columnPath. |
org.apache.cassandra.thrift.SuperColumn |
getSuperColumn(String key,
org.apache.cassandra.thrift.ColumnPath columnPath)
|
Map<ByteBuffer,List<org.apache.cassandra.thrift.CounterSuperColumn>> |
getSuperRangeCounterSlices(org.apache.cassandra.thrift.ColumnParent columnParent,
org.apache.cassandra.thrift.SlicePredicate predicate,
org.apache.cassandra.thrift.KeyRange keyRange)
returns a subset of counter super columns for a range of keys |
Map<ByteBuffer,List<org.apache.cassandra.thrift.SuperColumn>> |
getSuperRangeSlices(org.apache.cassandra.thrift.ColumnParent columnParent,
org.apache.cassandra.thrift.SlicePredicate predicate,
org.apache.cassandra.thrift.KeyRange keyRange)
returns a subset of super columns for a range of keys. |
List<org.apache.cassandra.thrift.SuperColumn> |
getSuperSlice(ByteBuffer key,
org.apache.cassandra.thrift.ColumnParent columnParent,
org.apache.cassandra.thrift.SlicePredicate predicate)
Get the group of superColumn contained by columnParent. |
List<org.apache.cassandra.thrift.SuperColumn> |
getSuperSlice(String key,
org.apache.cassandra.thrift.ColumnParent columnParent,
org.apache.cassandra.thrift.SlicePredicate predicate)
|
void |
insert(ByteBuffer key,
org.apache.cassandra.thrift.ColumnParent columnParent,
org.apache.cassandra.thrift.Column column)
Inserts a column. |
void |
insert(String key,
org.apache.cassandra.thrift.ColumnPath columnPath,
ByteBuffer value)
|
void |
insert(String key,
org.apache.cassandra.thrift.ColumnPath columnPath,
ByteBuffer value,
long timestamp)
|
Map<ByteBuffer,Integer> |
multigetCount(List<ByteBuffer> keys,
org.apache.cassandra.thrift.ColumnParent columnParent,
org.apache.cassandra.thrift.SlicePredicate slicePredicate)
Returns a map of key to column count |
Map<ByteBuffer,List<org.apache.cassandra.thrift.CounterColumn>> |
multigetCounterSlice(List<ByteBuffer> keys,
org.apache.cassandra.thrift.ColumnParent columnParent,
org.apache.cassandra.thrift.SlicePredicate predicate)
Performs a get_slice for columnParent and predicate for the given keys in parallel. |
Map<ByteBuffer,List<org.apache.cassandra.thrift.CounterSuperColumn>> |
multigetCounterSuperSlice(List<ByteBuffer> keys,
org.apache.cassandra.thrift.ColumnParent columnParent,
org.apache.cassandra.thrift.SlicePredicate predicate)
Performs a get_slice for a superColumn columnParent and predicate for the given keys in parallel. |
Map<ByteBuffer,List<org.apache.cassandra.thrift.Column>> |
multigetSlice(List<ByteBuffer> keys,
org.apache.cassandra.thrift.ColumnParent columnParent,
org.apache.cassandra.thrift.SlicePredicate predicate)
Performs a get_slice for columnParent and predicate for the given keys in parallel. |
Map<ByteBuffer,org.apache.cassandra.thrift.SuperColumn> |
multigetSuperColumn(List<ByteBuffer> keys,
org.apache.cassandra.thrift.ColumnPath columnPath)
Performs a get for columnPath in parallel on the given list of keys. |
Map<ByteBuffer,org.apache.cassandra.thrift.SuperColumn> |
multigetSuperColumn(List<ByteBuffer> keys,
org.apache.cassandra.thrift.ColumnPath columnPath,
boolean reversed,
int size)
Perform a get for columnPath in parallel on the given list of keys. |
Map<ByteBuffer,List<org.apache.cassandra.thrift.SuperColumn>> |
multigetSuperSlice(List<ByteBuffer> keys,
org.apache.cassandra.thrift.ColumnParent columnParent,
org.apache.cassandra.thrift.SlicePredicate predicate)
Performs a get_slice for a superColumn columnParent and predicate for the given keys in parallel. |
void |
remove(ByteBuffer key,
org.apache.cassandra.thrift.ColumnPath columnPath)
|
void |
remove(ByteBuffer key,
org.apache.cassandra.thrift.ColumnPath columnPath,
long timestamp)
Same as two argument version, but the caller must specify their own clock |
void |
remove(String key,
org.apache.cassandra.thrift.ColumnPath columnPath)
|
void |
remove(String key,
org.apache.cassandra.thrift.ColumnPath columnPath,
long timestamp)
Same as two argument version, but the caller must specify their own timestamp |
void |
removeCounter(ByteBuffer key,
org.apache.cassandra.thrift.ColumnPath columnPath)
|
void |
removeCounter(String key,
org.apache.cassandra.thrift.ColumnPath columnPath)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public KeyspaceServiceImpl(String keyspaceName, ConsistencyLevelPolicy consistencyLevel, HConnectionManager connectionManager, FailoverPolicy failoverPolicy) throws HectorTransportException
HectorTransportException
public KeyspaceServiceImpl(String keyspaceName, ConsistencyLevelPolicy consistencyLevel, HConnectionManager connectionManager, FailoverPolicy failoverPolicy, Map<String,String> credentials) throws HectorTransportException
HectorTransportException
Method Detail |
---|
public void batchMutate(Map<ByteBuffer,Map<String,List<org.apache.cassandra.thrift.Mutation>>> mutationMap) throws HectorException
KeyspaceService
batchMutate
in interface KeyspaceService
HectorException
public void batchMutate(BatchMutation batchMutate) throws HectorException
KeyspaceService
batchMutate
in interface KeyspaceService
HectorException
public int getCount(ByteBuffer key, org.apache.cassandra.thrift.ColumnParent columnParent, org.apache.cassandra.thrift.SlicePredicate predicate) throws HectorException
KeyspaceService
getCount
in interface KeyspaceService
HectorException
public CassandraHost getCassandraHost()
getCassandraHost
in interface KeyspaceService
public Map<ByteBuffer,List<org.apache.cassandra.thrift.Column>> getRangeSlices(org.apache.cassandra.thrift.ColumnParent columnParent, org.apache.cassandra.thrift.SlicePredicate predicate, org.apache.cassandra.thrift.KeyRange keyRange) throws HectorException
KeyspaceService
getRangeSlices
in interface KeyspaceService
HectorException
public Map<ByteBuffer,List<org.apache.cassandra.thrift.CounterColumn>> getRangeCounterSlices(org.apache.cassandra.thrift.ColumnParent columnParent, org.apache.cassandra.thrift.SlicePredicate predicate, org.apache.cassandra.thrift.KeyRange keyRange) throws HectorException
KeyspaceService
getRangeCounterSlices
in interface KeyspaceService
HectorException
public Map<ByteBuffer,List<org.apache.cassandra.thrift.SuperColumn>> getSuperRangeSlices(org.apache.cassandra.thrift.ColumnParent columnParent, org.apache.cassandra.thrift.SlicePredicate predicate, org.apache.cassandra.thrift.KeyRange keyRange) throws HectorException
KeyspaceService
getSuperRangeSlices
in interface KeyspaceService
HectorException
public Map<ByteBuffer,List<org.apache.cassandra.thrift.CounterSuperColumn>> getSuperRangeCounterSlices(org.apache.cassandra.thrift.ColumnParent columnParent, org.apache.cassandra.thrift.SlicePredicate predicate, org.apache.cassandra.thrift.KeyRange keyRange) throws HectorException
KeyspaceService
getSuperRangeCounterSlices
in interface KeyspaceService
HectorException
public List<org.apache.cassandra.thrift.Column> getSlice(ByteBuffer key, org.apache.cassandra.thrift.ColumnParent columnParent, org.apache.cassandra.thrift.SlicePredicate predicate) throws HectorException
KeyspaceService
getSlice
in interface KeyspaceService
HectorException
public List<org.apache.cassandra.thrift.Column> getSlice(String key, org.apache.cassandra.thrift.ColumnParent columnParent, org.apache.cassandra.thrift.SlicePredicate predicate) throws HectorException
getSlice
in interface KeyspaceService
HectorException
public List<org.apache.cassandra.thrift.CounterColumn> getCounterSlice(ByteBuffer key, org.apache.cassandra.thrift.ColumnParent columnParent, org.apache.cassandra.thrift.SlicePredicate predicate) throws HectorException
KeyspaceService
getCounterSlice
in interface KeyspaceService
HectorException
public List<org.apache.cassandra.thrift.CounterColumn> getCounterSlice(String key, org.apache.cassandra.thrift.ColumnParent columnParent, org.apache.cassandra.thrift.SlicePredicate predicate) throws HectorException
getCounterSlice
in interface KeyspaceService
HectorException
public org.apache.cassandra.thrift.SuperColumn getSuperColumn(ByteBuffer key, org.apache.cassandra.thrift.ColumnPath columnPath) throws HectorException
KeyspaceService
getSuperColumn
in interface KeyspaceService
HNotFoundException
- when a supercolumn is not found
HectorException
public List<org.apache.cassandra.thrift.SuperColumn> getSuperSlice(String key, org.apache.cassandra.thrift.ColumnParent columnParent, org.apache.cassandra.thrift.SlicePredicate predicate) throws HectorException
getSuperSlice
in interface KeyspaceService
HectorException
public org.apache.cassandra.thrift.SuperColumn getSuperColumn(ByteBuffer key, org.apache.cassandra.thrift.ColumnPath columnPath, boolean reversed, int size) throws HectorException
KeyspaceService
getSuperColumn
in interface KeyspaceService
reversed
- the result Column sortsize
- the result column size
HNotFoundException
- when a supercolumn is not found
HectorException
public org.apache.cassandra.thrift.SuperColumn getSuperColumn(String key, org.apache.cassandra.thrift.ColumnPath columnPath) throws HectorException
getSuperColumn
in interface KeyspaceService
HectorException
public List<org.apache.cassandra.thrift.SuperColumn> getSuperSlice(ByteBuffer key, org.apache.cassandra.thrift.ColumnParent columnParent, org.apache.cassandra.thrift.SlicePredicate predicate) throws HectorException
KeyspaceService
getSuperSlice
in interface KeyspaceService
HectorException
public List<org.apache.cassandra.thrift.CounterSuperColumn> getCounterSuperSlice(String key, org.apache.cassandra.thrift.ColumnParent columnParent, org.apache.cassandra.thrift.SlicePredicate predicate) throws HectorException
getCounterSuperSlice
in interface KeyspaceService
HectorException
public List<org.apache.cassandra.thrift.CounterSuperColumn> getCounterSuperSlice(ByteBuffer key, org.apache.cassandra.thrift.ColumnParent columnParent, org.apache.cassandra.thrift.SlicePredicate predicate) throws HectorException
KeyspaceService
getCounterSuperSlice
in interface KeyspaceService
HectorException
public void insert(ByteBuffer key, org.apache.cassandra.thrift.ColumnParent columnParent, org.apache.cassandra.thrift.Column column) throws HectorException
KeyspaceService
insert
in interface KeyspaceService
HectorException
public void addCounter(ByteBuffer key, org.apache.cassandra.thrift.ColumnParent columnParent, org.apache.cassandra.thrift.CounterColumn counterColumn) throws HectorException
KeyspaceService
addCounter
in interface KeyspaceService
HectorException
public void addCounter(String key, org.apache.cassandra.thrift.ColumnParent columnParent, org.apache.cassandra.thrift.CounterColumn counterColumn) throws HectorException
KeyspaceService
addCounter
in interface KeyspaceService
HectorException
public void insert(String key, org.apache.cassandra.thrift.ColumnPath columnPath, ByteBuffer value) throws HectorException
insert
in interface KeyspaceService
HectorException
public void insert(String key, org.apache.cassandra.thrift.ColumnPath columnPath, ByteBuffer value, long timestamp) throws HectorException
insert
in interface KeyspaceService
HectorException
public Map<ByteBuffer,List<org.apache.cassandra.thrift.Column>> multigetSlice(List<ByteBuffer> keys, org.apache.cassandra.thrift.ColumnParent columnParent, org.apache.cassandra.thrift.SlicePredicate predicate) throws HectorException
KeyspaceService
multigetSlice
in interface KeyspaceService
HectorException
public Map<ByteBuffer,List<org.apache.cassandra.thrift.CounterColumn>> multigetCounterSlice(List<ByteBuffer> keys, org.apache.cassandra.thrift.ColumnParent columnParent, org.apache.cassandra.thrift.SlicePredicate predicate) throws HectorException
KeyspaceService
multigetCounterSlice
in interface KeyspaceService
HectorException
public Map<ByteBuffer,org.apache.cassandra.thrift.SuperColumn> multigetSuperColumn(List<ByteBuffer> keys, org.apache.cassandra.thrift.ColumnPath columnPath) throws HectorException
KeyspaceService
multigetSuperColumn
in interface KeyspaceService
HectorException
public Map<ByteBuffer,org.apache.cassandra.thrift.SuperColumn> multigetSuperColumn(List<ByteBuffer> keys, org.apache.cassandra.thrift.ColumnPath columnPath, boolean reversed, int size) throws HectorException
KeyspaceService
multigetSuperColumn
in interface KeyspaceService
HectorException
public Map<ByteBuffer,List<org.apache.cassandra.thrift.SuperColumn>> multigetSuperSlice(List<ByteBuffer> keys, org.apache.cassandra.thrift.ColumnParent columnParent, org.apache.cassandra.thrift.SlicePredicate predicate) throws HectorException
KeyspaceService
multigetSuperSlice
in interface KeyspaceService
HectorException
public Map<ByteBuffer,List<org.apache.cassandra.thrift.CounterSuperColumn>> multigetCounterSuperSlice(List<ByteBuffer> keys, org.apache.cassandra.thrift.ColumnParent columnParent, org.apache.cassandra.thrift.SlicePredicate predicate) throws HectorException
KeyspaceService
multigetCounterSuperSlice
in interface KeyspaceService
HectorException
public Map<ByteBuffer,List<org.apache.cassandra.thrift.Column>> getIndexedSlices(org.apache.cassandra.thrift.ColumnParent columnParent, org.apache.cassandra.thrift.IndexClause indexClause, org.apache.cassandra.thrift.SlicePredicate predicate) throws HectorException
KeyspaceService
getIndexedSlices
in interface KeyspaceService
HectorException
public void remove(ByteBuffer key, org.apache.cassandra.thrift.ColumnPath columnPath)
remove
in interface KeyspaceService
public Map<ByteBuffer,Integer> multigetCount(List<ByteBuffer> keys, org.apache.cassandra.thrift.ColumnParent columnParent, org.apache.cassandra.thrift.SlicePredicate slicePredicate) throws HectorException
KeyspaceService
multigetCount
in interface KeyspaceService
HectorException
public void remove(ByteBuffer key, org.apache.cassandra.thrift.ColumnPath columnPath, long timestamp) throws HectorException
KeyspaceService
remove
in interface KeyspaceService
HectorException
public void removeCounter(ByteBuffer key, org.apache.cassandra.thrift.ColumnPath columnPath) throws HectorException
removeCounter
in interface KeyspaceService
HectorException
public void removeCounter(String key, org.apache.cassandra.thrift.ColumnPath columnPath) throws HectorException
removeCounter
in interface KeyspaceService
HectorException
public void remove(String key, org.apache.cassandra.thrift.ColumnPath columnPath) throws HectorException
remove
in interface KeyspaceService
HectorException
public void remove(String key, org.apache.cassandra.thrift.ColumnPath columnPath, long timestamp) throws HectorException
remove
in interface KeyspaceService
HectorException
public String getName()
getName
in interface KeyspaceService
public org.apache.cassandra.thrift.Column getColumn(ByteBuffer key, org.apache.cassandra.thrift.ColumnPath columnPath) throws HectorException
KeyspaceService
getColumn
in interface KeyspaceService
HNotFoundException
- if no value exists for the column
HectorException
public org.apache.cassandra.thrift.CounterColumn getCounter(ByteBuffer key, org.apache.cassandra.thrift.ColumnPath columnPath) throws HectorException
KeyspaceService
getCounter
in interface KeyspaceService
HNotFoundException
- if no value exists for the counter
HectorException
public org.apache.cassandra.thrift.CounterColumn getCounter(String key, org.apache.cassandra.thrift.ColumnPath columnPath) throws HectorException
getCounter
in interface KeyspaceService
HectorException
public org.apache.cassandra.thrift.Column getColumn(String key, org.apache.cassandra.thrift.ColumnPath columnPath) throws HectorException
getColumn
in interface KeyspaceService
HectorException
public HConsistencyLevel getConsistencyLevel(OperationType operationType)
getConsistencyLevel
in interface KeyspaceService
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |