Thursday, June 23, 2011

Inserting a row with cassandra hector api 0.7

INSERT A SINGLE ROW WITH A SINGLE COLUMN
The following example inserts a Column with the column name "first" and the column value of "John" under the key "jsmith". The retrieving and instance of the Mutator class from HFactory makes this action straight-forward.
Mutator mutator = HFactory.createMutator(keyspace, stringSerializer);
mutator.insert("jsmith", "Standard1", HFactory.createStringColumn("first", "John"));

No comments:

Post a Comment