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;
}
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 );
}
}