I am having problems setting the timestamp string using java api.
When I try to add a timestamp value to place the constructor (or in put.add ()), nothing happens and after reading the rows from the table, I get the timestamps provided by the system.
public static boolean addRecord(String tableName, String rowKey,
String family, String qualifier, Object value)
{
try {
HTable table = new HTable(conf, tableName);
Put put = new Put(Bytes.toBytes(rowKey), 12345678l);
put.add(Bytes.toBytes(family), Bytes.toBytes(qualifier), Bytes.toBytes(value.toString()));
table.put(put);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
HBase 0.92.1 works offline.
Thanks in advance for your help!
source
share