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

The following examples show how to use org.apache.hadoop.hbase.KeyValue#COMPARATOR . 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: SICompactionStateMutate.java    From spliceengine with GNU Affero General Public License v3.0 5 votes vote down vote up
SICompactionStateMutate(PurgeConfig purgeConfig, long lowWatermarkTransaction) {
    this.purgeConfig = purgeConfig;
    this.dataToReturn = new TreeSet<>(KeyValue.COMPARATOR);
    this.maxTombstoneTimestamp = 0;
    this.lowWatermarkTransaction = lowWatermarkTransaction;
    this.firstWriteToken = false;
    this.deleteRightAfterFirstWriteTimestamp = 0;
}
 
Example 2
Source File: MemstoreKeyValueScannerTest.java    From spliceengine with GNU Affero General Public License v3.0 5 votes vote down vote up
private ResultScanner generateResultScanner(KeyValue... kvs) {
    TreeSet<KeyValue> set = new TreeSet<>(KeyValue.COMPARATOR);

    set.addAll(Arrays.asList(kvs));

    KeyValue[] sortedKvs = new KeyValue[set.size()];
    set.toArray(sortedKvs);

    final Result result = Result.create(kvs);

    return new ResultScanner() {
        @Override
        public Result next() throws IOException {
            return result;
        }

        @Override
        public Result[] next(int nbRows) throws IOException {
            return new Result[] {result};
        }

        @Override
        public void close() {

        }

        public boolean renewLease() {
            return false;
        }

        public ScanMetrics getScanMetrics() {
            return null;
        }

        @Override
        public Iterator<Result> iterator() {
            return Arrays.asList(result).iterator();
        }
    };
}
 
Example 3
Source File: GenericKeyValueBuilder.java    From phoenix with Apache License 2.0 4 votes vote down vote up
@Override
public KVComparator getKeyValueComparator() {
    return KeyValue.COMPARATOR;
}