use of org.hypertable.thriftgen.Key in project YCSB by brianfrankcooper.
the class HypertableClient method delete.
/**
* Delete a record from the database.
*
* @param table
* The name of the table
* @param key
* The record key of the record to delete.
* @return Zero on success, a non-zero error code on error
*/
@Override
public Status delete(String table, String key) {
if (debug) {
System.out.println("Doing delete for key: " + key);
}
Cell entry = new Cell();
entry.key = new Key();
entry.key.row = key;
entry.key.flag = KeyFlag.DELETE_ROW;
try {
connection.set_cell(ns, table, entry);
} catch (ClientException e) {
if (debug) {
System.err.println("Error doing delete: " + e.message);
}
return Status.ERROR;
} catch (TException e) {
if (debug) {
System.err.println("Error doing delete");
}
return Status.ERROR;
}
return Status.OK;
}
Aggregations