我在使用
java api设置行时间戳时遇到问题.
当我试图添加时间戳值来放置构造函数(或put.add())时没有任何反应,在从表中读取行后,我得到系统提供的时间戳.
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以独立模式运行.
在此先感谢您的帮助!