Java Code Examples for org.apache.hadoop.hbase.KeyValue#KVComparator

The following examples show how to use org.apache.hadoop.hbase.KeyValue#KVComparator . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SpliceHRegionInfo.java    From spliceengine with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
/**
 * @return Comparator to use comparing {@link org.apache.hadoop.hbase.KeyValue}s.
 */
public KeyValue.KVComparator getComparator() {
    return SpliceKVComparator.INSTANCE;
}
 
Example 2
Source File: TransactionState.java    From hbase-secondary-index with GNU General Public License v3.0 5 votes vote down vote up
TransactionScanner(final Scan scan) {
	super(new KeyValue.KVComparator() {

		@Override
		public int compare(final KeyValue left, final KeyValue right) {
			int result = super.compare(left, right);
			if (result != 0) {
				return result;
			}
			if (left == right) {
				return 0;
			}
			int put1Number = getTransactionSequenceIndex(left);
			int put2Number = getTransactionSequenceIndex(right);
			return put2Number - put1Number;
		}
	}, getAllKVs(scan));

	// We want transaction scanner to always take priority over store
	// scanners.
	setSequenceID(Long.MAX_VALUE);

	// matcher = new ScanQueryMatcher(scan, null, null,
	// HConstants.FOREVER, KeyValue.KEY_COMPARATOR,
	// scan.getMaxVersions());
	matcher = new ScanQueryMatcher(scan, null, null,
			null, Long.MAX_VALUE, HConstants.LATEST_TIMESTAMP,
                  EnvironmentEdgeManager.currentTimeMillis());
}
 
Example 3
Source File: KeyValueListScanner.java    From hbase-secondary-index with GNU General Public License v3.0 5 votes vote down vote up
public KeyValueListScanner(final KeyValue.KVComparator comparator, final KeyValue ... incData) {
    this.comparator = comparator;

    data = new ArrayList<KeyValue>(incData.length);
    for (int i = 0; i < incData.length; ++i) {
        data.add(incData[i]);
    }
    Collections.sort(data, this.comparator);
    this.iter = data.iterator();
    if (!data.isEmpty()) {
        this.current = KeyValue.createFirstOnRow(data.get(0).getRow());
    }
}
 
Example 4
Source File: KeyValueSkipListSet.java    From phoenix with Apache License 2.0 4 votes vote down vote up
KeyValueSkipListSet(final KeyValue.KVComparator c) {
  this.delegatee = new ConcurrentSkipListMap<KeyValue, KeyValue>(c);
}
 
Example 5
Source File: SpliceKVComparator.java    From spliceengine with GNU Affero General Public License v3.0 4 votes vote down vote up
private SpliceKVComparator(KeyValue.KVComparator kvComparator) {
    this.kvComparator = kvComparator;
}