本文整理了Java中org.apache.accumulo.core.data.Range.beforeStartKey
方法的一些代码示例,展示了Range.beforeStartKey
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Range.beforeStartKey
方法的具体详情如下:
包路径:org.apache.accumulo.core.data.Range
类名称:Range
方法名:beforeStartKey
[英]Determines if the given key is before the start key of this range.
[中]确定给定的键是否在该范围的开始键之前。
代码示例来源:origin: prestodb/presto
/**
* Gets a Boolean value indicating if the given value is in one of the Ranges in the given collection
*
* @param text Text object to check against the Range collection
* @param ranges Ranges to look into
* @return True if the text object is in one of the ranges, false otherwise
*/
private static boolean inRange(Text text, Collection<Range> ranges)
{
Key kCq = new Key(text);
return ranges.stream().anyMatch(r -> !r.beforeStartKey(kCq) && !r.afterEndKey(kCq));
}
}
代码示例来源:origin: apache/accumulo
/**
* Determines if the given key falls within this range.
*
* @param key
* key to consider
* @return true if the given key falls within the range, false otherwise
*/
public boolean contains(Key key) {
return !beforeStartKey(key) && !afterEndKey(key);
}
代码示例来源:origin: apache/accumulo
@Override
public void readFields(DataInput in) throws IOException {
infiniteStartKey = in.readBoolean();
infiniteStopKey = in.readBoolean();
if (!infiniteStartKey) {
start = new Key();
start.readFields(in);
} else {
start = null;
}
if (!infiniteStopKey) {
stop = new Key();
stop.readFields(in);
} else {
stop = null;
}
startKeyInclusive = in.readBoolean();
stopKeyInclusive = in.readBoolean();
if (!infiniteStartKey && !infiniteStopKey && beforeStartKey(stop)) {
throw new InvalidObjectException(
"Start key must be less than end key in range (" + start + ", " + stop + ")");
}
}
代码示例来源:origin: apache/accumulo
@Override
public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive)
throws IOException {
if (interruptFlag != null && interruptFlag.get())
throw new IterationInterruptedException();
this.range = range;
Key key = range.getStartKey();
if (key == null) {
key = new Key();
}
iter = map.tailMap(key).entrySet().iterator();
if (iter.hasNext()) {
entry = iter.next();
if (range.afterEndKey(entry.getKey())) {
entry = null;
}
} else
entry = null;
while (hasTop() && range.beforeStartKey(getTopKey())) {
next();
}
}
代码示例来源:origin: apache/accumulo
@Override
public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive)
throws IOException {
if (columnFamilies.size() != 0 || inclusive) {
throw new IllegalArgumentException("I do not know how to filter column families");
}
if (range == null)
throw new IllegalArgumentException("Cannot seek to null range");
if (interruptFlag != null && interruptFlag.get())
throw new IterationInterruptedException();
Key key = range.getStartKey();
if (key == null) {
key = new Key();
}
reader.seek(key);
while (hasTop() && range.beforeStartKey(getTopKey())) {
next();
}
}
代码示例来源:origin: apache/accumulo
while (currentPosition < keys.size() && range.beforeStartKey(keys.get(currentPosition)))
currentPosition++;
代码示例来源:origin: apache/accumulo
@Override
public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive)
throws IOException {
Range seekRange = IteratorUtil.maximizeStartKeyTimeStamp(range);
seekRange = IteratorUtil.minimizeEndKeyTimeStamp(seekRange);
source.seek(seekRange, columnFamilies, inclusive);
this.range = range;
while (hasTop() && range.beforeStartKey(getTopKey())) {
next();
}
}
代码示例来源:origin: apache/accumulo
@Override
public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive)
throws IOException {
reader.seek(range, columnFamilies, inclusive);
this.range = range;
hasTop = reader.hasTop() && !range.afterEndKey(reader.getTopKey());
while (hasTop() && range.beforeStartKey(getTopKey())) {
next();
}
}
代码示例来源:origin: apache/accumulo
@Override
public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive)
throws IOException {
// do not want to seek to the middle of a row
Range seekRange = IteratorUtil.maximizeStartKeyTimeStamp(range);
this.range = seekRange;
this.columnFamilies = columnFamilies;
this.inclusive = inclusive;
super.seek(seekRange, columnFamilies, inclusive);
resetVersionCount();
if (range.getStartKey() != null)
while (hasTop() && range.beforeStartKey(getTopKey()))
next();
}
代码示例来源:origin: apache/accumulo
@Override
public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive) {
if (interruptFlag != null && interruptFlag.get())
throw new IterationInterruptedException();
iter.delete();
this.range = range;
Key key = range.getStartKey();
if (key == null) {
key = new MemKey();
}
iter = map.new ConcurrentIterator(key);
if (iter.hasNext()) {
entry = iter.next();
if (range.afterEndKey(entry.getKey())) {
entry = null;
}
} else
entry = null;
while (hasTop() && range.beforeStartKey(getTopKey())) {
next();
}
}
代码示例来源:origin: apache/accumulo
consumeEmptyColFams();
if (source.hasTop() && range.beforeStartKey(source.getTopKey())) {
source.seek(range, columnFamilies, inclusive);
consumeDeleted();
代码示例来源:origin: apache/accumulo
loc = null;
} else if (scanState.range.getEndKey() != null
&& dataRange.beforeStartKey(scanState.range.getEndKey())) {
代码示例来源:origin: apache/accumulo
@Override
public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive)
throws IOException {
// do not want to seek to the middle of a row
Range seekRange = IteratorUtil.maximizeStartKeyTimeStamp(range);
source.seek(seekRange, columnFamilies, inclusive);
findTop();
if (range.getStartKey() != null) {
while (source.hasTop() && source.getTopKey().compareTo(range.getStartKey(),
PartialKey.ROW_COLFAM_COLQUAL_COLVIS_TIME) < 0) {
next();
}
while (hasTop() && range.beforeStartKey(getTopKey())) {
next();
}
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-core
/**
* Determines if the given key falls within this range.
*
* @param key
* key to consider
* @return true if the given key falls within the range, false otherwise
*/
public boolean contains(Key key) {
return !beforeStartKey(key) && !afterEndKey(key);
}
代码示例来源:origin: apache/accumulo
@Override
public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive)
throws IOException {
// save parameters for future internal seeks
latestRange = range;
latestColumnFamilies = columnFamilies;
latestInclusive = inclusive;
lastRowFound = null;
Key startKey = range.getStartKey();
Range seekRange = new Range(startKey == null ? null : new Key(startKey.getRow()), true,
range.getEndKey(), range.isEndKeyInclusive());
super.seek(seekRange, columnFamilies, inclusive);
finished = false;
if (getSource().hasTop()) {
lastRowFound = getSource().getTopKey().getRow();
if (range.beforeStartKey(getSource().getTopKey()))
consume();
}
}
代码示例来源:origin: apache/accumulo
return null;
throw new IllegalArgumentException("Range " + range + " does not overlap " + this);
} else if (beforeStartKey(range.getStartKey())) {
sk = getStartKey();
ski = isStartKeyInclusive();
eki = isEndKeyInclusive();
} else if (beforeStartKey(range.getEndKey())
|| (getStartKey() != null && range.getEndKey().equals(getStartKey())
&& !(range.isEndKeyInclusive() && isStartKeyInclusive()))) {
代码示例来源:origin: apache/accumulo
@Override
public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive)
throws IOException {
// do not want to seek to the middle of a value that should be combined...
Range seekRange = IteratorUtil.maximizeStartKeyTimeStamp(range);
super.seek(seekRange, columnFamilies, inclusive);
findTop();
if (range.getStartKey() != null) {
while (hasTop()
&& getTopKey().equals(range.getStartKey(), PartialKey.ROW_COLFAM_COLQUAL_COLVIS)
&& getTopKey().getTimestamp() > range.getStartKey().getTimestamp()) {
// the value has a more recent time stamp, so pass it up
// log.debug("skipping "+getTopKey());
next();
}
while (hasTop() && range.beforeStartKey(getTopKey())) {
next();
}
}
}
代码示例来源:origin: io.fluo/fluo-accumulo
@Override
public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive)
throws IOException {
lastKeySet = false;
Range seekRange = IteratorUtil.maximizeStartKeyTimeStamp(range);
super.seek(seekRange, columnFamilies, inclusive);
while (hasTop() && range.beforeStartKey(getTopKey())) {
next();
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-core
@Override
public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive)
throws IOException {
Range seekRange = IteratorUtil.maximizeStartKeyTimeStamp(range);
seekRange = IteratorUtil.minimizeEndKeyTimeStamp(seekRange);
source.seek(seekRange, columnFamilies, inclusive);
this.range = range;
while (hasTop() && range.beforeStartKey(getTopKey())) {
next();
}
}
代码示例来源:origin: apache/accumulo
if (range.beforeStartKey(prevKey) && range.afterEndKey(getTopKey())) {
while (hasTop() && range.beforeStartKey(getTopKey())) {
next();
内容来源于网络,如有侵权,请联系作者删除!