Phoenix Tips (5) 使用任意时间戳

在Property里面设置属性 "CurrentSCN"。

ts是一个long。


 

Properties props = new Properties();
props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts));
Connection conn = DriverManager.connect(myUrl, props);

conn.createStatement().execute("UPSERT INTO myTable VALUES ('a')");
conn.commit();

 

相当于:

myTable.put(Bytes.toBytes('a'),ts);

 




 

posted @ 2014-11-09 11:26  lihui1625  阅读(253)  评论(0编辑  收藏  举报