* A HashMap of field/value pairs to insert in the record
* @return Zero on success, a non-zero error code on error
*/
public int insert(String table, String key, HashMap<String, ByteIterator> values)
{
Mutator mutator =
Pelops.createMutator(_host + ":" + _port + ":" + _keyspace);
try
{
List<Column> columns = new ArrayList<Column>();
for (Map.Entry<String, ByteIterator> entry : values.entrySet())
{
Column col = new Column();
col.setName(ByteBuffer.wrap(entry.getKey().getBytes("UTF-8")));
col.setValue(ByteBuffer.wrap(entry.getValue().toArray()));
col.setTimestamp(System.currentTimeMillis());
columns.add(col);
}
mutator.writeColumns(column_family, Bytes.fromUTF8(key), columns);
mutator.execute(writeConsistencyLevel);
return Ok;
}
catch (Exception e)
{