本文整理汇总了Java中org.apache.accumulo.core.data.Range.getEndKey方法的典型用法代码示例。如果您正苦于以下问题:Java Range.getEndKey方法的具体用法?Java Range.getEndKey怎么用?Java Range.getEndKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.accumulo.core.data.Range
的用法示例。
在下文中一共展示了Range.getEndKey方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRangeFromPair
import org.apache.accumulo.core.data.Range; //导入方法依赖的package包/类
@Override
public Range getRangeFromPair(final Pair<ElementId, ElementId> pairRange, final GraphFilters operation)
throws RangeFactoryException {
final ArrayList<Range> ran = new ArrayList<>();
// set the in out flag to null to disable it
ran.addAll(getRange(pairRange.getFirst(), operation, null));
ran.addAll(getRange(pairRange.getSecond(), operation, null));
Range min = null;
Range max = null;
for (final Range range : ran) {
if (null == min) {
min = range;
max = range;
}
if (range.compareTo(min) < 0) {
min = range;
} else if (range.compareTo(max) > 0) {
max = range;
}
}
return new Range(min.getStartKey(), max.getEndKey());
}
示例2: logStartIterator
import org.apache.accumulo.core.data.Range; //导入方法依赖的package包/类
private void logStartIterator(String table, Range range, SortedSet<Column> fetchedColumns) {
String fetchedColumnsString = fetchedColumnsToString(fetchedColumns);
if (range == null || (range.getStartKey() == null && range.getEndKey() == null)) {
queryLogger.trace("begin accumulo iterator %s: (%s): all items", table, fetchedColumnsString);
} else {
queryLogger.trace("begin accumulo iterator %s: (%s): %s - %s", table, fetchedColumnsString, keyToString(range.getStartKey()), keyToString(range.getEndKey()));
}
}
示例3: rangeContainsRange
import org.apache.accumulo.core.data.Range; //导入方法依赖的package包/类
private static boolean rangeContainsRange(final Range r1, final Range r2) {
// 1. If r1.start is infinite, r1 contains r2.start
if (!r1.isInfiniteStartKey()) {
// 2. Otherwise, if r2.start is infinite, r1 can't contain r2
if (r2.isInfiniteStartKey()) {
return false;
}
final Key start2 = r2.getStartKey();
// 3. If r2 is inclusive, r1 needs to contain r2's start key.
if (r2.isStartKeyInclusive()) {
if (!r1.contains(start2)) {
return false;
}
}
// 4. Otherwise, the only failure is if r2's start key comes first (they can be equal)
else if (start2.compareTo(r1.getStartKey()) < 0) {
return false;
}
}
// Similar logic for end points
if (!r1.isInfiniteStopKey()) {
if (r2.isInfiniteStopKey()) {
return false;
}
final Key end2 = r2.getEndKey();
if (r2.isEndKeyInclusive()) {
if (!r1.contains(end2)) {
return false;
}
}
else if (end2.compareTo(r1.getEndKey()) > 0) {
return false;
}
}
return true;
}
示例4: transform
import org.apache.accumulo.core.data.Range; //导入方法依赖的package包/类
/**
* Transforms a {@link org.apache.accumulo.core.data.Range} into a
* BloomFilter key. If the first vertices in the start and end keys of the
* range are the same, then we can create the appropriate BloomFilter key.
* If the key does not correspond to either an
* {@link uk.gov.gchq.gaffer.data.element.Entity} or an {@link uk.gov.gchq.gaffer.data.element.Edge}
* then we return {@code null} to indicate that the range cannot be
* converted into a single key for the Bloom filter.
*/
@Override
public org.apache.hadoop.util.bloom.Key transform(final Range range) {
if (null == range.getStartKey() || null == range.getEndKey()) {
return null;
}
final byte[] startKeyFirstIdentifier = getVertexFromRangeKey(
range.getStartKey().getRowData().getBackingArray());
final byte[] endKeyFirstIdentifier = getVertexFromRangeKey(range.getEndKey().getRowData().getBackingArray());
if (Arrays.equals(startKeyFirstIdentifier, endKeyFirstIdentifier)) {
return new org.apache.hadoop.util.bloom.Key(startKeyFirstIdentifier);
}
return null;
}
示例5: doSeek
import org.apache.accumulo.core.data.Range; //导入方法依赖的package包/类
private void doSeek(Range range) throws IOException {
overallRange = new Range(range);
if (range.getEndKey() != null && range.getEndKey().getRow() != null) {
this.parentEndRow = range.getEndKey().getRow();
}
// seek each of the sources to the right column family within the row given by key
for (int i = 0; i < sourcesCount; i++) {
Key sourceKey;
Text dataLocation = (sources[i].dataLocation == null) ? nullText : sources[i].dataLocation;
if (range.getStartKey() != null) {
// Build a key with the DocID if one is given
if (range.getStartKey().getColumnFamily() != null) {
sourceKey = buildKey(getPartition(range.getStartKey()), dataLocation,
(sources[i].term == null) ? nullText : new Text(sources[i].term + "\0" + range.getStartKey().getColumnFamily()));
} // Build a key with just the term.
else {
sourceKey = buildKey(getPartition(range.getStartKey()), dataLocation,
(sources[i].term == null) ? nullText : sources[i].term);
}
if (!range.isStartKeyInclusive())
sourceKey = sourceKey.followingKey(PartialKey.ROW_COLFAM_COLQUAL);
sources[i].iter.seek(new Range(sourceKey, true, null, false), sources[i].seekColumnFamilies, SEEK_INCLUSIVE);
} else {
sources[i].iter.seek(range, sources[i].seekColumnFamilies, SEEK_INCLUSIVE);
}
}
advanceToIntersection();
if (hasTop()) {
if (overallRange != null && !overallRange.contains(topKey)) {
topKey = null;
if (log.isDebugEnabled()) {
log.debug("doSeek, topKey is outside of overall range: " + overallRange);
}
}
}
}
示例6: seek
import org.apache.accumulo.core.data.Range; //导入方法依赖的package包/类
public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive) throws IOException {
if (log.isDebugEnabled()) {
log.debug("seek, range:" + range);
}
// Test the range to see if it is event specific.
if (null != range.getEndKey() && range.getEndKey().getColumnFamily() != null && range.getEndKey().getColumnFamily().getLength() != 0) {
if (log.isDebugEnabled()) {
log.debug("Jumping straight to the event");
}
// Then this range is for a specific event. We don't need to use the index iterator to find it, we can just
// seek to it with the event iterator and evaluate it.
eventSpecificRange = true;
event.seek(range, columnFamilies, inclusive);
if (event.hasTop()) {
key = event.getTopKey();
value = event.getTopValue();
}
} else {
if (log.isDebugEnabled()) {
log.debug("Using BooleanLogicIteratorJexl");
}
// Seek the boolean logic iterator
index.seek(range, columnFamilies, inclusive);
// If the index has a match, then seek the event to the key
if (index.hasTop()) {
Key eventKey = index.getTopKey();
// Range eventRange = new Range(eventKey, eventKey);
Range eventRange = new Range(eventKey.getRow());
HashSet<ByteSequence> cf = new HashSet<ByteSequence>();
cf.add(eventKey.getColumnFamilyData());
event.seek(eventRange, cf, true);
if (event.hasTop()) {
key = event.getTopKey();
value = event.getTopValue();
} else {
next();
}
}
}
}