Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
HBase >> mail # user >> Thread safety of Bytes.compareTo(byte[] left, byte[] right)


Copy link to this message
-
Thread safety of Bytes.compareTo(byte[] left, byte[] right)
Hi All,

I have to use
 *Bytes.compareTo<http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/util/Bytes.html#compareTo%28byte[],%20byte[]%29>
*(byte[] left, byte[] right) method in one of my coprocessor(HBASE-7474)
stuff. Basically, i want to do comparison on the basis of Lexicographical
order of byte[] of cell value. Similar to BinaryComparator in HBase.

Since, *Bytes.compareTo<http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/util/Bytes.html#compareTo%28byte[],%20byte[]%29>
*(byte[] left, byte[] right) is static method and it doesnt have any
synchronization. How do we guarantee that this method is thread safe? I am
curious to know is it safe to use the static method on
RegionServer(multithreaded environment)?

Please correct me if i stated something wrong above.

--
Thanks & Regards,
Anil Gupta
+
Adrien Mogenet 2013-10-10, 12:59
+
anil gupta 2013-10-12, 22:48
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB