Skip to content

Instantly share code, notes, and snippets.

@jessicaowensby
Created September 25, 2012 18:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jessicaowensby/3783634 to your computer and use it in GitHub Desktop.
Save jessicaowensby/3783634 to your computer and use it in GitHub Desktop.
Does the Hector BatchMutator object allow for batch inserts of Composite Columns?
Composite composite = new Composite();
composite.addComponent("abc",ser);
composite.addComponent("123", StringSerializer.get());
HColumn<Composite, String> col = HFactory.createColumn(composite, "xyz", new CompositeSerializer(), ser);
Column cassandraColumn = new Column();
cassandraColumn.setName(col.getNameBytes());
cassandraColumn.setValue(col.getValueBytes());
cassandraColumn.setTimestamp(System.currentTimeMillis());
batchMutate.addInsertion("myKey", "MyColumnFamily", cassandraColumn);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment