public byte[] getNextRowHint(byte[] rowKey) { byte[] nextRowKey = null; // Searching for the "smallest" row key that satisfies at least one fuzzy row key for (ImmutablePair<byte[], byte[]> fuzzyData : fuzzyKeysData) { byte[] nextRowKeyCandidate = getNextForFuzzyRule(rowKey, fuzzyData.getFirst(), fuzzyData.getSecond()); if (nextRowKeyCandidate == null) { continue; } if (nextRowKey == null || Bytes.compareTo(nextRowKeyCandidate, nextRowKey) < 0) { nextRowKey = nextRowKeyCandidate; } } if (nextRowKey == null) { // SHOULD NEVER happen // TODO: is there a better way than throw exception? (stop the scanner?) throw new IllegalStateException("No next row key that satisfies fuzzy exists when" + " getNextKeyHint() is invoked." + " Filter: " + this.toString() + " RowKey: " + Bytes.toStringBinary(rowKey)); } return nextRowKey; }
public byte[] getNextRowHint(byte[] rowKey) { byte[] nextRowKey = null; // Searching for the "smallest" row key that satisfies at least one fuzzy row key for (ImmutablePair<byte[], byte[]> fuzzyData : fuzzyKeysData) { byte[] nextRowKeyCandidate = getNextForFuzzyRule(rowKey, fuzzyData.getFirst(), fuzzyData.getSecond()); if (nextRowKeyCandidate == null) { continue; } if (nextRowKey == null || Bytes.compareTo(nextRowKeyCandidate, nextRowKey) < 0) { nextRowKey = nextRowKeyCandidate; } } if (nextRowKey == null) { // SHOULD NEVER happen // TODO: is there a better way than throw exception? (stop the scanner?) throw new IllegalStateException("No next row key that satisfies fuzzy exists when" + " getNextKeyHint() is invoked." + " Filter: " + this.toString() + " RowKey: " + Bytes.toStringBinary(rowKey)); } return nextRowKey; }