I am new to Cassandra and have been using the Hector Template API's. My question here is how do I use Row Level Isolation when I am trying to update.
public String getAttributeValueForKey( String columnName, String key ) throws StoreException {
String result = null;
try {
ColumnFamilyResult<String, String> columnFamilyResult = getTemplate().queryColumns( key );
if( null != columnFamilyResult ) {
result = columnFamilyResult.getString( columnName );
}
}
catch( HectorException e ) {
LOGGER.error( e );
throw new StoreException( e );
}
return result;
}
And the puts looks something like:
public void putKeyWithValuesAndTimeout( String rowKey, Map<String, String> columns, long timeInMilliSeconds ) throws StoreException {
ColumnFamilyUpdater<String, String> updater = getTemplate().createUpdater(rowKey);
for( String attributeKey : columns.keySet() ) {
HColumn<String, String> column = new HColumnImpl<String,String>(StringSerializer.get(), StringSerializer.get());
column.setClock(getTemplate().getClock());
column.setName(attributeKey);
column.setValue( columns.get(attributeKey));
column.setTtl((int)timeInMilliSeconds);
updater.setColumn(column);
}
try {
getTemplate().update( updater );
}
catch( HectorException e ) {
LOGGER.error( e );
throw new StoreException( e );
}
}
You received this message because you are subscribed to the Google Groups "hector-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hector-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org