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

The following examples show how to use org.apache.hadoop.hbase.KeyValue#KVComparator . These examples are extracted from open source projects. 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
@Override
/**
 * @return Comparator to use comparing {@link org.apache.hadoop.hbase.KeyValue}s.
 */
public KeyValue.KVComparator getComparator() {
    return SpliceKVComparator.INSTANCE;
}
 
Example 2
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
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 Project: phoenix   File: KeyValueSkipListSet.java    License: Apache License 2.0 4 votes vote down vote up
KeyValueSkipListSet(final KeyValue.KVComparator c) {
  this.delegatee = new ConcurrentSkipListMap<KeyValue, KeyValue>(c);
}
 
Example 5
private SpliceKVComparator(KeyValue.KVComparator kvComparator) {
    this.kvComparator = kvComparator;
}