/** * collapse the state of the active HSuperColumn */ void updateInternal() { // HSuperColumnImpl needs a refactor, this construction is lame. // the value serializer is not used in HSuperColumnImpl, so this is safe for name if ( !subColumns.isEmpty() ) { log.debug("Adding column {} for key {} and cols {}", new Object[]{getCurrentSuperColumn(), getCurrentKey(), subColumns}); HSuperColumnImpl<SN, N, ?> column = new HSuperColumnImpl(getCurrentSuperColumn(), subColumns, 0, template.getTopSerializer(), template.getSubSerializer(), TypeInferringSerializer.get()); mutator.addInsertion(getCurrentKey(), template.getColumnFamily(), column); } }
/** * Deletes the super column and all of its sub columns */ public void deleteSuperColumn() { //template.getMutator().addDeletion(getCurrentKey(), template.getColumnFamily(), // getCurrentSuperColumn(), template.getTopSerializer()); mutator.addSuperDelete(getCurrentKey(), template.getColumnFamily(), getCurrentSuperColumn(), template.getTopSerializer()); }
public void deleteSubColumn(N columnName) { mutator.addSubDelete(getCurrentKey(), template.getColumnFamily(), getCurrentSuperColumn(), columnName, template.getTopSerializer(), template.getSubSerializer()); }
@Test public void testSuperCfInsertReadTemplate() { SuperCfTemplate<String, String, String> sTemplate = new ThriftSuperCfTemplate<String, String, String>(keyspace, "Super1", se, se, se); SuperCfUpdater<String,String,String> sUpdater = sTemplate.createUpdater("skey1","super1"); sUpdater.setString("sub_col_1", "sub_val_1"); sTemplate.update(sUpdater); SuperCfResult<String,String,String> result = sTemplate.querySuperColumn("skey1", "super1"); assertEquals("sub_val_1",result.getString("super1","sub_col_1")); sUpdater.deleteSuperColumn(); sTemplate.update(sUpdater); assertEquals("super1",sUpdater.getCurrentSuperColumn()); result = sTemplate.querySuperColumn("skey1", "super1"); assertFalse(result.hasResults()); }
/** * collapse the state of the active HSuperColumn */ void updateInternal() { // HSuperColumnImpl needs a refactor, this construction is lame. // the value serializer is not used in HSuperColumnImpl, so this is safe for name if ( !subColumns.isEmpty() ) { log.debug("Adding column {} for key {} and cols {}", new Object[]{getCurrentSuperColumn(), getCurrentKey(), subColumns}); HSuperColumnImpl<SN, N, ?> column = new HSuperColumnImpl(getCurrentSuperColumn(), subColumns, 0, template.getTopSerializer(), template.getSubSerializer(), TypeInferringSerializer.get()); mutator.addInsertion(getCurrentKey(), template.getColumnFamily(), column); } }
/** * collapse the state of the active HSuperColumn */ void updateInternal() { // HSuperColumnImpl needs a refactor, this construction is lame. // the value serializer is not used in HSuperColumnImpl, so this is safe for name if ( !subColumns.isEmpty() ) { log.debug("Adding column {} for key {} and cols {}", new Object[]{getCurrentSuperColumn(), getCurrentKey(), subColumns}); HSuperColumnImpl<SN, N, ?> column = new HSuperColumnImpl(getCurrentSuperColumn(), subColumns, 0, template.getTopSerializer(), template.getSubSerializer(), TypeInferringSerializer.get()); mutator.addInsertion(getCurrentKey(), template.getColumnFamily(), column); } }
/** * Deletes the super column and all of its sub columns */ public void deleteSuperColumn() { //template.getMutator().addDeletion(getCurrentKey(), template.getColumnFamily(), // getCurrentSuperColumn(), template.getTopSerializer()); mutator.addSuperDelete(getCurrentKey(), template.getColumnFamily(), getCurrentSuperColumn(), template.getTopSerializer()); }
/** * Deletes the super column and all of its sub columns */ public void deleteSuperColumn() { //template.getMutator().addDeletion(getCurrentKey(), template.getColumnFamily(), // getCurrentSuperColumn(), template.getTopSerializer()); mutator.addSuperDelete(getCurrentKey(), template.getColumnFamily(), getCurrentSuperColumn(), template.getTopSerializer()); }
public void deleteSubColumn(N columnName) { mutator.addSubDelete(getCurrentKey(), template.getColumnFamily(), getCurrentSuperColumn(), columnName, template.getTopSerializer(), template.getSubSerializer()); }
public void deleteSubColumn(N columnName) { mutator.addSubDelete(getCurrentKey(), template.getColumnFamily(), getCurrentSuperColumn(), columnName, template.getTopSerializer(), template.getSubSerializer()); }