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 >> Possibly unnecessary check in Result.getColumnLatest(byte[] family, byte[] qualifier)


+
anil gupta 2013-01-22, 17:43
+
Ted Yu 2013-01-22, 18:18
+
anil gupta 2013-01-22, 22:49
Copy link to this message
-
Re: Possibly unnecessary check in Result.getColumnLatest(byte[] family, byte[] qualifier)
KeyValue.KVComparator in 0.94 looks similar to that in trunk.

Here is the compare() method:

    public int compare(final KeyValue left, final KeyValue right) {

      int ret = getRawComparator().compare(left.getBuffer(),

          left.getOffset() + ROW_OFFSET, left.getKeyLength(),

          right.getBuffer(), right.getOffset() + ROW_OFFSET,

          right.getKeyLength());

      if (ret != 0) return ret;

      // Negate this comparison so later edits show up first

      return -Longs.compare(left.getMemstoreTS(), right.getMemstoreTS());

    }
On Tue, Jan 22, 2013 at 2:49 PM, anil gupta <[EMAIL PROTECTED]> wrote:

> Hi Ted,
>
> Maybe it is out of sync with trunk. Here is the svn link for Result.java in
> HBase0.94.3:
>
> http://svn.apache.org/repos/asf/hbase/tags/0.94.3/src/main/java/org/apache/hadoop/hbase/client/Result.java
>
> ~Anil
>
>
> On Tue, Jan 22, 2013 at 10:18 AM, Ted Yu <[EMAIL PROTECTED]> wrote:
>
> > I am looking at trunk code.
> >
> > binarySearch() calls this method:
> >
> >     int pos = Arrays.binarySearch(kvs, searchTerm, KeyValue.COMPARATOR);
> > Here is the compare() method of KVComparator:
> >
> >     public int compare(final KeyValue left, final KeyValue right) {
> >
> >       int ret = getRawComparator().compare(left.getBuffer(),
> >
> >           left.getOffset() + ROW_OFFSET, left.getKeyLength(),
> >
> >           right.getBuffer(), right.getOffset() + ROW_OFFSET,
> >
> >           right.getKeyLength());
> >
> >       if (ret != 0) return ret;
> >
> >       // Negate this comparison so later edits show up first
> >
> >       return -Longs.compare(left.getMemstoreTS(), right.getMemstoreTS());
> >
> >     }
> > I don't see duplicate check.
> >
> > Cheers
> >
> > On Tue, Jan 22, 2013 at 9:43 AM, anil gupta <[EMAIL PROTECTED]>
> wrote:
> >
> > > Hi All,
> > >
> > > I was looking into the code of Result.getColumnLatest(byte[] family,
> > byte[]
> > > qualifier) in HBase0.94.3 tag.
> > > I feel like the following check is unnecessary on line #245 since we
> have
> > > already got the right column by preforming binary search previously:
> > >     if (kv.matchingColumn(family, qualifier)) {
> > >       return kv;
> > >     }
> > >
> > > Am i missing something over here?
> > > --
> > > Thanks & Regards,
> > > Anil Gupta
> > >
> >
>
>
>
> --
> Thanks & Regards,
> Anil Gupta
>
+
anil gupta 2013-01-22, 23:27
+
Minor, Eric 2014-12-11, 21:34
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