org.apache.accumulo.core.data.Range.isStartKeyInclusive()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(10.4k)|赞(0)|评价(0)|浏览(137)

本文整理了Java中org.apache.accumulo.core.data.Range.isStartKeyInclusive方法的一些代码示例,展示了Range.isStartKeyInclusive的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Range.isStartKeyInclusive方法的具体详情如下:
包路径:org.apache.accumulo.core.data.Range
类名称:Range
方法名:isStartKeyInclusive

Range.isStartKeyInclusive介绍

[英]Gets whether the start key of this range is inclusive.
[中]获取此范围的开始键是否包含。

代码示例

代码示例来源:origin: apache/accumulo

partScan = entry.getKey();
partNextKey = lookupResult.unfinishedRanges.get(0).getStartKey();
partNextKeyInclusive = lookupResult.unfinishedRanges.get(0).isStartKeyInclusive();

代码示例来源:origin: apache/accumulo

public static Range minimizeEndKeyTimeStamp(Range range) {
 Range seekRange = range;
 if (range.getEndKey() != null) {
  Key seekKey = seekRange.getEndKey();
  if (range.getEndKey().getTimestamp() != Long.MIN_VALUE) {
   seekKey = new Key(seekRange.getEndKey());
   seekKey.setTimestamp(Long.MIN_VALUE);
   seekRange = new Range(range.getStartKey(), range.isStartKeyInclusive(), seekKey, true);
  } else if (!range.isEndKeyInclusive()) {
   seekRange = new Range(range.getStartKey(), range.isStartKeyInclusive(), seekKey, true);
  }
 }
 return seekRange;
}

代码示例来源:origin: apache/accumulo

/**
 * Converts the given {@code Range} into the correct {@code Range} for this TermSource (per this
 * expected table structure) and then seeks this TermSource's SKVI.
 */
public void seek(Range originalRange) throws IOException {
 // the infinite start key is equivalent to a null startKey on the Range.
 if (!originalRange.isInfiniteStartKey()) {
  Key originalStartKey = originalRange.getStartKey();
  // Pivot the provided range into the range for this term
  Key newKey = new Key(originalStartKey.getRow(), term, originalStartKey.getColumnQualifier(),
    originalStartKey.getTimestamp());
  // Construct the new range, preserving the other attributes on the provided range.
  currentRange = new Range(newKey, originalRange.isStartKeyInclusive(),
    originalRange.getEndKey(), originalRange.isEndKeyInclusive());
 } else {
  currentRange = originalRange;
 }
 LOG.trace("Seeking {} to {}", this, currentRange);
 iter.seek(currentRange, seekColfams, true);
}

代码示例来源:origin: apache/accumulo

boolean ski = range.isStartKeyInclusive();
 if (getStartKey() != null) {
  sk = getStartKey();
  ski = isStartKeyInclusive();
    && !(range.isStartKeyInclusive() && isEndKeyInclusive()))) {
 if (returnNullIfDisjoint)
  return null;
} else if (beforeStartKey(range.getStartKey())) {
 sk = getStartKey();
 ski = isStartKeyInclusive();
    && !(range.isEndKeyInclusive() && isStartKeyInclusive()))) {
 if (returnNullIfDisjoint)
  return null;

代码示例来源:origin: apache/accumulo

@Override
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
  throws Exception {
 final String tableName = OptUtil.getTableOpt(cl, shellState);
 final ScanInterpreter interpeter = getInterpreter(cl, tableName, shellState);
 final Range range = getRange(cl, interpeter);
 final Authorizations auths = getAuths(cl, shellState);
 final Text startRow = range.getStartKey() == null ? null : range.getStartKey().getRow();
 final Text endRow = range.getEndKey() == null ? null : range.getEndKey().getRow();
 try {
  final Text max = shellState.getAccumuloClient().tableOperations().getMaxRow(tableName, auths,
    startRow, range.isStartKeyInclusive(), endRow, range.isEndKeyInclusive());
  if (max != null) {
   shellState.getReader().println(max.toString());
  }
 } catch (Exception e) {
  log.debug("Could not get shell state.", e);
 }
 return 0;
}

代码示例来源:origin: apache/accumulo

public static Range maximizeStartKeyTimeStamp(Range range) {
 Range seekRange = range;
 if (range.getStartKey() != null) {
  Key seekKey = range.getStartKey();
  if (range.getStartKey().getTimestamp() != Long.MAX_VALUE) {
   seekKey = new Key(seekRange.getStartKey());
   seekKey.setTimestamp(Long.MAX_VALUE);
   seekRange = new Range(seekKey, true, range.getEndKey(), range.isEndKeyInclusive());
  } else if (!range.isStartKeyInclusive()) {
   seekRange = new Range(seekKey, true, range.getEndKey(), range.isEndKeyInclusive());
  }
 }
 return seekRange;
}

代码示例来源:origin: apache/accumulo

/**
 * Possibly expand {@code range} to include everything for the key prefix we are working with.
 * That is, if our prefix is ROW_COLFAM, then we need to expand the range so we're sure to include
 * all entries having the same row and column family as the start/end of the range.
 *
 * @param range
 *          the range to expand
 * @return the modified range
 */
protected Range computeReseekRange(Range range) {
 Key startKey = range.getStartKey();
 boolean startKeyInclusive = range.isStartKeyInclusive();
 // If anything after the prefix is set, then clip the key so we include
 // everything for the prefix.
 if (isSetAfterPart(startKey, getKeyPrefix())) {
  startKey = copyPartialKey(startKey, getKeyPrefix());
  startKeyInclusive = true;
 }
 Key endKey = range.getEndKey();
 boolean endKeyInclusive = range.isEndKeyInclusive();
 if (isSetAfterPart(endKey, getKeyPrefix())) {
  endKey = endKey.followingKey(getKeyPrefix());
  endKeyInclusive = true;
 }
 return new Range(startKey, startKeyInclusive, endKey, endKeyInclusive);
}

代码示例来源:origin: apache/accumulo

@Override
public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive)
  throws IOException {
 topKey = null;
 topValue = null;
 Key sk = range.getStartKey();
 if (sk != null && sk.getColumnQualifierData().length() == 0
   && sk.getColumnVisibilityData().length() == 0 && sk.getTimestamp() == Long.MAX_VALUE
   && !range.isStartKeyInclusive()) {
  // assuming that we are seeking using a key previously returned by
  // this iterator
  // therefore go to the next row/cf
  Key followingRowKey = sk.followingKey(PartialKey.ROW_COLFAM);
  if (range.getEndKey() != null && followingRowKey.compareTo(range.getEndKey()) > 0)
   return;
  range = new Range(sk.followingKey(PartialKey.ROW_COLFAM), true, range.getEndKey(),
    range.isEndKeyInclusive());
 }
 sourceIter.seek(range, columnFamilies, inclusive);
 prepKeys();
}

代码示例来源:origin: apache/accumulo

@Override
public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive)
  throws IOException {
 topKey = null;
 topValue = null;
 Key sk = range.getStartKey();
 if (sk != null && sk.getColumnFamilyData().length() == 0
   && sk.getColumnQualifierData().length() == 0 && sk.getColumnVisibilityData().length() == 0
   && sk.getTimestamp() == Long.MAX_VALUE && !range.isStartKeyInclusive()) {
  // assuming that we are seeking using a key previously returned by this iterator
  // therefore go to the next row
  Key followingRowKey = sk.followingKey(PartialKey.ROW);
  if (range.getEndKey() != null && followingRowKey.compareTo(range.getEndKey()) > 0)
   return;
  range = new Range(sk.followingKey(PartialKey.ROW), true, range.getEndKey(),
    range.isEndKeyInclusive());
 }
 sourceIter.seek(range, columnFamilies, inclusive);
 prepKeys();
}

代码示例来源:origin: NationalSecurityAgency/datawave

@Override
public boolean isKeyInRange(Key currentKey, Range currentRange, String separator) {
  List<String> values = Arrays.asList(currentKey.getColumnQualifier().toString().split("\0")[0].split(separator));
  List<String> startValues = Arrays.asList(currentRange.getStartKey().getColumnQualifier().toString().split("\0")[0].split(separator));
  List<String> endValues = Arrays.asList(currentRange.getEndKey().getColumnQualifier().toString().split("\0")[0].split(separator));
  return isInRange(values, startValues, currentRange.isStartKeyInclusive(), endValues, currentRange.isEndKeyInclusive());
}

代码示例来源:origin: Accla/graphulo

@Override
public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive) throws IOException {
 seekRng = range;
 // seek to first entry inside range
 if (range.isInfiniteStartKey())
  inner = new PeekingIterator1<>(allEntriesToInject.entrySet().iterator());
 else if (range.isStartKeyInclusive())
  inner = new PeekingIterator1<>(allEntriesToInject.tailMap(range.getStartKey()).entrySet().iterator());
 else
  inner = new PeekingIterator1<>(allEntriesToInject.tailMap(range.getStartKey().followingKey(PartialKey.ROW_COLFAM_COLQUAL_COLVIS_TIME)).entrySet().iterator());
}

代码示例来源:origin: Accla/graphulo

@Override
public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive) throws IOException {
 // seek to first entry inside range
 if (range.isInfiniteStartKey())
  inner = new PeekingIterator1<>(allEntriesToInject.entrySet().iterator());
 else if (range.isStartKeyInclusive())
  inner = new PeekingIterator1<>(allEntriesToInject.tailMap(range.getStartKey()).entrySet().iterator());
 else
  inner = new PeekingIterator1<>(allEntriesToInject.tailMap(range.getStartKey().followingKey(PartialKey.ROW_COLFAM_COLQUAL_COLVIS_TIME)).entrySet().iterator());
}

代码示例来源:origin: Accla/graphulo

private static String normalizeStartRow(Range range) {
 Key startKey = range.getStartKey();
 if (startKey == null)
  return null;
 String startRow = new String(startKey.getRowData().toArray(), StandardCharsets.UTF_8);
 if (!range.isStartKeyInclusive())
  return startRow+'\0';
 else
  return startRow;
}

代码示例来源:origin: NationalSecurityAgency/datawave

/**
 * Permute a "Document" Range to the equivalent "Field Index" Range for a Field:Term
 * 
 * @param r
 * @return
 */
protected Range buildIndexRange(Range r) {
  Key startKey = permuteRangeKey(r.getStartKey(), r.isStartKeyInclusive());
  Key endKey = permuteRangeKey(r.getEndKey(), r.isEndKeyInclusive());
  
  return new Range(startKey, r.isStartKeyInclusive(), endKey, r.isEndKeyInclusive());
}

代码示例来源:origin: apache/accumulo

boolean ski = isStartKeyInclusive();

代码示例来源:origin: Accla/graphulo

@Override
public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive) throws IOException {
 source.seek(range, columnFamilies, inclusive);
 lastKey = range.isInfiniteStartKey() ? EMPTY_KEY : range.getStartKey();
 afterLastKey = !range.isInfiniteStartKey() && !range.isStartKeyInclusive();
 tri = 0;
 findTop();
}

代码示例来源:origin: io.fluo/fluo-core

/**
 * Converts an Accumulo Range to a Fluo Span
 * 
 * @param range Range
 * @return Span
 */
public static Span toSpan(Range range) {
 return new Span(toRowColumn(range.getStartKey()), range.isStartKeyInclusive(),
   toRowColumn(range.getEndKey()), range.isEndKeyInclusive());
}

代码示例来源:origin: org.apache.fluo/fluo-core

/**
 * Converts an Accumulo Range to a Fluo Span
 * 
 * @param range Range
 * @return Span
 */
public static Span toSpan(Range range) {
 return new Span(toRowColumn(range.getStartKey()), range.isStartKeyInclusive(),
   toRowColumn(range.getEndKey()), range.isEndKeyInclusive());
}

代码示例来源:origin: apache/fluo

/**
 * Converts an Accumulo Range to a Fluo Span
 * 
 * @param range Range
 * @return Span
 */
public static Span toSpan(Range range) {
 return new Span(toRowColumn(range.getStartKey()), range.isStartKeyInclusive(),
   toRowColumn(range.getEndKey()), range.isEndKeyInclusive());
}

代码示例来源:origin: edu.jhuapl.accumulo/proxy-instance

public static org.apache.accumulo.proxy.thrift.Range toThrift(Range range) {
 if (range == null) {
  return null;
 }
 org.apache.accumulo.proxy.thrift.Range trange = new org.apache.accumulo.proxy.thrift.Range();
 trange.setStart(toThrift(range.getStartKey()));
 trange.setStop(toThrift(range.getEndKey()));
 trange.setStartInclusive(range.isStartKeyInclusive());
 trange.setStopInclusive(range.isEndKeyInclusive());
 return trange;
}

相关文章