[ 
https://issues.apache.org/jira/browse/HBASE-1622?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12729890#action_12729890
 ] 

stack commented on HBASE-1622:
------------------------------

I started to work on this a little but gave up because need to make a bunch of 
constructors in the new KVC class.   Here is what I had:

{code}
/**
 * A {...@link java.lang.Comparable} KeyValue.
 * Compares the Key portion only of a KeyValue. Two KeyValues that have same
 * Key though different Value content will be equated.
 */
public class KeyValueComparable extends KeyValue
implements WritableComparable<KeyValue> {
  private final KeyValue.KVComparator comparator;

  public KeyValueComparable() {
    this(null);
  }

  /**
   * @param c Comparator to use.
   */
  public KeyValueComparable(final KeyValue.KVComparator c) {
    this.comparator = c == null? KeyValue.COMPARATOR: c;
  }

  public int compareTo(final KeyValue that) {
    return this.comparator.compare(this, that);
  }
}
{code}

> Make KeyValue implement the Comparable interface to make it work with 
> Cascading.
> --------------------------------------------------------------------------------
>
>                 Key: HBASE-1622
>                 URL: https://issues.apache.org/jira/browse/HBASE-1622
>             Project: Hadoop HBase
>          Issue Type: New Feature
>    Affects Versions: 0.20.0
>            Reporter: Erik Holstad
>            Assignee: Erik Holstad
>            Priority: Minor
>             Fix For: 0.20.0
>
>         Attachments: HBASE-1622-v1.patch, HBASE-1622-v2.patch
>
>
> As with making Result implement the Comparable interface, this is used for 
> making HBase interact tightly with cascading, so that KeyValues can be put 
> into Tuples.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to