I hit this issue with latest asynchbase. Append with timestamp seems to ignore ordering based on timesamp.
Per doc:
-----
* if you send a first {@code AppendRequest}
* with timestamp T, and then later send another one for the same table,
* key, family and qualifier, but with timestamp T - 1, then the second
* write will look like it was applied before the first one when you read
* this cell back from HBase.
But from the code snippet below I see that its not honored.
===
String cq = "c";
String row = "r";
long tsPut = System.currentTimeMillis();
String myTableName = generateTableName(method.getName());
util.createTable(myTableName, cf1);
LOG.info("TS: " + tsPut);
PutRequest p = new PutRequest(
myTableName.getBytes(),
(row).getBytes(),
cf1.getBytes(),
cq.getBytes(),
("p1").getBytes()/*,
tsPut*/);
LOG.info(p);
Deferred d = client.put(p);
d.join();
long tsOldAppend = System.currentTimeMillis(); // 1st sec
Thread.sleep(1000);
AppendRequest a1 = new AppendRequest(
myTableName.getBytes(),
(row).getBytes(),
cf1.getBytes(),
cq.getBytes(),
("ax").getBytes(),
System.currentTimeMillis()); // append ax applied at 2nd sec
LOG.info(a1);
d = client.append(a1);
AppendRequest a2 = new AppendRequest(
myTableName.getBytes(),
(row).getBytes(),
cf1.getBytes(),
cq.getBytes(),
("ay").getBytes(),
tsOldAppend); // append ay applied at 1 am
LOG.info(a2);
d = client.append(a2);
//d.join();
client.flush();
// should look like p1ayax, but its p1axay.
Thread.sleep(5000);
GetRequest g = new GetRequest(myTableName, (row).getBytes());
Deferred<ArrayList<KeyValue>> defer = client.get(g);
ArrayList<KeyValue> result = defer.join();
for(int j = 0; j < result.size(); j++) {
KeyValue kv = result.get(j);
LOG.info("kv: " + kv);
}
=======
When I read back the cell I get
kv: KeyValue(key="r", family="CF-1", qualifier="c", value="p1axay", timestamp=1457375465057) => why p1axay ? It should be p1ayax right?