hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bertrand Venzal <bven...@yahoo.com.INVALID>
Subject HBase : Check and Put method used with a long
Date Thu, 07 Jan 2016 13:01:33 GMT
Hello, 
I need to compare a long value and according to its value, set it to another one (in a concurrent
context), so I am using the checkAndPut method (cf below). I used the same method with a string
and the EQUAL comparator, and it is working well, but when I am doing the same thing with
a long and the comparator LESS, it is never working. Is the type long supported ?
Get get = new Get(ROW_CURRENT_SIZE_INDEXING);get.addColumn(FAM_EVENT_STATUS_BYTES, QUA_CURRENT_SIZE_INDEXED);Result
result = table.get(get);long value = Bytes.toLong(result.getValue(FAM_EVENT_STATUS_BYTES,
QUA_CURRENT_SIZE_INDEXED));
LOG.info("====> Get Current Indexing Size ... " + value);Put putSize = new Put(ROW_CURRENT_SIZE_INDEXING);putSize.addColumn(FAM_EVENT_STATUS_BYTES,
QUA_CURRENT_SIZE_INDEXED, Bytes.toBytes(value + docSize));checkAndPut = table.checkAndPut(ROW_CURRENT_SIZE_INDEXING,
FAM_EVENT_STATUS_BYTES, QUA_CURRENT_SIZE_INDEXED, CompareOp.LESS,Bytes.toBytes(maximumConcurrentSizeIndexing),
putSize);
LOG.info("====> Get Spare Size ... " + checkAndPut);
ThanksRegards
Bertrand
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message