You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "binlijin (JIRA)" <ji...@apache.org> on 2012/07/27 03:27:35 UTC
[jira] [Updated] (HBASE-6458) new comparator twice in checkAndPut,
just reuse the first one
[ https://issues.apache.org/jira/browse/HBASE-6458?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
binlijin updated HBASE-6458:
----------------------------
Description:
public boolean checkAndPut(final byte[] regionName, final byte[] row,
final byte[] family, final byte[] qualifier, final byte[] value,
final Put put) throws IOException {
WritableByteArrayComparable comparator = new BinaryComparator(value);
boolean result = checkAndMutate(regionName, row, family, qualifier,
CompareOp.EQUAL, new BinaryComparator(value), put,lock);
}
The comparator creates twice, because the comparator is not changed, so we can reuse the comparator, the second is useless.
Summary: new comparator twice in checkAndPut, just reuse the first one (was: reuse BinaryComparator)
> new comparator twice in checkAndPut, just reuse the first one
> -------------------------------------------------------------
>
> Key: HBASE-6458
> URL: https://issues.apache.org/jira/browse/HBASE-6458
> Project: HBase
> Issue Type: Improvement
> Affects Versions: 0.94.1
> Reporter: binlijin
> Fix For: 0.94.2
>
> Attachments: HBASE-6458-0.94-2.patch, HBASE-6458-0.94.patch
>
>
> public boolean checkAndPut(final byte[] regionName, final byte[] row,
> final byte[] family, final byte[] qualifier, final byte[] value,
> final Put put) throws IOException {
> WritableByteArrayComparable comparator = new BinaryComparator(value);
> boolean result = checkAndMutate(regionName, row, family, qualifier,
> CompareOp.EQUAL, new BinaryComparator(value), put,lock);
> }
> The comparator creates twice, because the comparator is not changed, so we can reuse the comparator, the second is useless.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira