当前位置: 首页>>代码示例>>Java>>正文


Java SimpleMutableByteRange类代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.util.SimpleMutableByteRange的典型用法代码示例。如果您正苦于以下问题:Java SimpleMutableByteRange类的具体用法?Java SimpleMutableByteRange怎么用?Java SimpleMutableByteRange使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SimpleMutableByteRange类属于org.apache.hadoop.hbase.util包,在下文中一共展示了SimpleMutableByteRange类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: store

import org.apache.hadoop.hbase.util.SimpleMutableByteRange; //导入依赖的package包/类
protected int store(ByteRange bytes) {
  int indexOfNewElement = numUniqueRanges;
  if (uniqueRanges.size() <= numUniqueRanges) {
    uniqueRanges.add(new SimpleMutableByteRange());
  }
  ByteRange storedRange = uniqueRanges.get(numUniqueRanges);
  int neededBytes = numBytes + bytes.getLength();
  byteAppender = ArrayUtils.growIfNecessary(byteAppender, neededBytes, 2 * neededBytes);
  bytes.deepCopyTo(byteAppender, numBytes);
  storedRange.set(byteAppender, numBytes, bytes.getLength());// this isn't valid yet
  numBytes += bytes.getLength();
  uniqueIndexByUniqueRange.put(storedRange, indexOfNewElement);
  int newestUniqueIndex = numUniqueRanges;
  ++numUniqueRanges;
  return newestUniqueIndex;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:17,代码来源:ByteRangeSet.java

示例2: VisibilityLabelFilter

import org.apache.hadoop.hbase.util.SimpleMutableByteRange; //导入依赖的package包/类
public VisibilityLabelFilter(VisibilityExpEvaluator expEvaluator,
    Map<ByteRange, Integer> cfVsMaxVersions) {
  this.expEvaluator = expEvaluator;
  this.cfVsMaxVersions = cfVsMaxVersions;
  this.curFamily = new SimpleMutableByteRange();
  this.curQualifier = new SimpleMutableByteRange();
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:8,代码来源:VisibilityLabelFilter.java

示例3: createVisibilityLabelFilter

import org.apache.hadoop.hbase.util.SimpleMutableByteRange; //导入依赖的package包/类
public static Filter createVisibilityLabelFilter(Region region, Authorizations authorizations)
    throws IOException {
  Map<ByteRange, Integer> cfVsMaxVersions = new HashMap<ByteRange, Integer>();
  for (HColumnDescriptor hcd : region.getTableDesc().getFamilies()) {
    cfVsMaxVersions.put(new SimpleMutableByteRange(hcd.getName()), hcd.getMaxVersions());
  }
  VisibilityLabelService vls = VisibilityLabelServiceManager.getInstance()
      .getVisibilityLabelService();
  Filter visibilityLabelFilter = new VisibilityLabelFilter(
      vls.getVisibilityExpEvaluator(authorizations), cfVsMaxVersions);
  return visibilityLabelFilter;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:13,代码来源:VisibilityUtils.java

示例4: AccessControlFilter

import org.apache.hadoop.hbase.util.SimpleMutableByteRange; //导入依赖的package包/类
AccessControlFilter(TableAuthManager mgr, User ugi, TableName tableName,
    Strategy strategy, Map<ByteRange, Integer> cfVsMaxVersions) {
  authManager = mgr;
  table = tableName;
  user = ugi;
  isSystemTable = tableName.isSystemTable();
  this.strategy = strategy;
  this.cfVsMaxVersions = cfVsMaxVersions;
  this.prevFam = new SimpleMutableByteRange();
  this.prevQual = new SimpleMutableByteRange();
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:12,代码来源:AccessControlFilter.java

示例5: allocateBytes

import org.apache.hadoop.hbase.util.SimpleMutableByteRange; //导入依赖的package包/类
/**
 * Allocate a slice of the given length.
 *
 * If the size is larger than the maximum size specified for this
 * allocator, returns null.
 */
@Override
public ByteRange allocateBytes(int size) {
  Preconditions.checkArgument(size >= 0, "negative size");

  // Callers should satisfy large allocations directly from JVM since they
  // don't cause fragmentation as badly.
  if (size > maxAlloc) {
    return null;
  }

  while (true) {
    Chunk c = getOrMakeChunk();

    // Try to allocate from this chunk
    int allocOffset = c.alloc(size);
    if (allocOffset != -1) {
      // We succeeded - this is the common case - small alloc
      // from a big buffer
      return new SimpleMutableByteRange(c.data, allocOffset, size);
    }

    // not enough space!
    // try to retire this chunk
    tryRetireChunk(c);
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:33,代码来源:HeapMemStoreLAB.java

示例6: PrefixTreeEncoder

import org.apache.hadoop.hbase.util.SimpleMutableByteRange; //导入依赖的package包/类
/***************** construct ***********************/

  public PrefixTreeEncoder(OutputStream outputStream, boolean includeMvccVersion) {
    // used during cell accumulation
    this.blockMeta = new PrefixTreeBlockMeta();
    this.rowRange = new SimpleMutableByteRange();
    this.familyRange = new SimpleMutableByteRange();
    this.qualifierRange = new SimpleMutableByteRange();
    this.timestamps = new long[INITIAL_PER_CELL_ARRAY_SIZES];
    this.mvccVersions = new long[INITIAL_PER_CELL_ARRAY_SIZES];
    this.typeBytes = new byte[INITIAL_PER_CELL_ARRAY_SIZES];
    this.valueOffsets = new int[INITIAL_PER_CELL_ARRAY_SIZES];
    this.values = new byte[VALUE_BUFFER_INIT_SIZE];

    // used during compilation
    this.familyDeduplicator = USE_HASH_COLUMN_SORTER ? new ByteRangeHashSet()
        : new ByteRangeTreeSet();
    this.qualifierDeduplicator = USE_HASH_COLUMN_SORTER ? new ByteRangeHashSet()
        : new ByteRangeTreeSet();
    this.timestampEncoder = new LongEncoder();
    this.mvccVersionEncoder = new LongEncoder();
    this.cellTypeEncoder = new CellTypeEncoder();
    this.rowTokenizer = new Tokenizer();
    this.familyTokenizer = new Tokenizer();
    this.qualifierTokenizer = new Tokenizer();
    this.rowWriter = new RowSectionWriter();
    this.familyWriter = new ColumnSectionWriter();
    this.qualifierWriter = new ColumnSectionWriter();
    initializeTagHelpers();

    reset(outputStream, includeMvccVersion);
  }
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:33,代码来源:PrefixTreeEncoder.java

示例7: initializeTagHelpers

import org.apache.hadoop.hbase.util.SimpleMutableByteRange; //导入依赖的package包/类
protected void initializeTagHelpers() {
  this.tagsRange = new SimpleMutableByteRange();
  this.tagsDeduplicator = USE_HASH_COLUMN_SORTER ? new ByteRangeHashSet()
  : new ByteRangeTreeSet();
  this.tagsTokenizer = new Tokenizer();
  this.tagsWriter = new ColumnSectionWriter();
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:8,代码来源:PrefixTreeEncoder.java

示例8: TokenizerNode

import org.apache.hadoop.hbase.util.SimpleMutableByteRange; //导入依赖的package包/类
/*********************** construct *****************************/

  public TokenizerNode(Tokenizer builder, TokenizerNode parent, int nodeDepth,
      int tokenStartOffset, int tokenOffset, int tokenLength) {
    this.token = new SimpleMutableByteRange();
    reconstruct(builder, parent, nodeDepth, tokenStartOffset, tokenOffset, tokenLength);
    this.children = Lists.newArrayList();
  }
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:9,代码来源:TokenizerNode.java

示例9: testInternal

import org.apache.hadoop.hbase.util.SimpleMutableByteRange; //导入依赖的package包/类
protected void testInternal(List<String> inputs, int expectedTreeDepth) {
  Tokenizer builder = new Tokenizer();
  for (String s : inputs) {
    SimpleMutableByteRange b = new SimpleMutableByteRange(Bytes.toBytes(s));
    builder.addSorted(b);
  }
  Assert.assertEquals(1, builder.getRoot().getNodeDepth());
  Assert.assertEquals(expectedTreeDepth, builder.getTreeDepth());
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:10,代码来源:TestTreeDepth.java

示例10: TestTokenizer

import org.apache.hadoop.hbase.util.SimpleMutableByteRange; //导入依赖的package包/类
public TestTokenizer(TestTokenizerData sortedByteArrays) {
  this.inputs = sortedByteArrays.getInputs();
  this.builder = new Tokenizer();
  for (byte[] array : inputs) {
    builder.addSorted(new SimpleMutableByteRange(array));
  }
  this.roundTripped = builder.getArrays();
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:9,代码来源:TestTokenizer.java

示例11: createFirstKeyInIncrementedRow

import org.apache.hadoop.hbase.util.SimpleMutableByteRange; //导入依赖的package包/类
/**
 * Increment the row bytes and clear the other fields
 */
public static KeyValue createFirstKeyInIncrementedRow(final Cell in){
  byte[] thisRow = new SimpleMutableByteRange(in.getRowArray(), in.getRowOffset(),
      in.getRowLength()).deepCopyToNewArray();
  byte[] nextRow = Bytes.unsignedCopyAndIncrement(thisRow);
  return createFirstOnRow(nextRow);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:10,代码来源:KeyValueUtil.java

示例12: createVisibilityLabelFilter

import org.apache.hadoop.hbase.util.SimpleMutableByteRange; //导入依赖的package包/类
public static Filter createVisibilityLabelFilter(HRegion region, Authorizations authorizations)
    throws IOException {
  Map<ByteRange, Integer> cfVsMaxVersions = new HashMap<ByteRange, Integer>();
  for (HColumnDescriptor hcd : region.getTableDesc().getFamilies()) {
    cfVsMaxVersions.put(new SimpleMutableByteRange(hcd.getName()), hcd.getMaxVersions());
  }
  VisibilityLabelService vls = VisibilityLabelServiceManager.getInstance()
      .getVisibilityLabelService();
  Filter visibilityLabelFilter = new VisibilityLabelFilter(
      vls.getVisibilityExpEvaluator(authorizations), cfVsMaxVersions);
  return visibilityLabelFilter;
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:13,代码来源:VisibilityUtils.java

示例13: createVisibilityLabelFilter

import org.apache.hadoop.hbase.util.SimpleMutableByteRange; //导入依赖的package包/类
public static Filter createVisibilityLabelFilter(Region region, Authorizations authorizations)
    throws IOException {
  Map<ByteRange, Integer> cfVsMaxVersions = new HashMap<>();
  for (ColumnFamilyDescriptor hcd : region.getTableDescriptor().getColumnFamilies()) {
    cfVsMaxVersions.put(new SimpleMutableByteRange(hcd.getName()), hcd.getMaxVersions());
  }
  VisibilityLabelService vls = VisibilityLabelServiceManager.getInstance()
      .getVisibilityLabelService();
  Filter visibilityLabelFilter = new VisibilityLabelFilter(
      vls.getVisibilityExpEvaluator(authorizations), cfVsMaxVersions);
  return visibilityLabelFilter;
}
 
开发者ID:apache,项目名称:hbase,代码行数:13,代码来源:VisibilityUtils.java

示例14: getToken

import org.apache.hadoop.hbase.util.SimpleMutableByteRange; //导入依赖的package包/类
public byte[] getToken() {
  // TODO pass in reusable ByteRange
  return new SimpleMutableByteRange(block, tokenOffset, tokenLength).deepCopyToNewArray();
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:5,代码来源:RowNodeReader.java

示例15: getValueByteRange

import org.apache.hadoop.hbase.util.SimpleMutableByteRange; //导入依赖的package包/类
public ByteRange getValueByteRange() {
  return new SimpleMutableByteRange(values, 0, totalValueBytes);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:4,代码来源:PrefixTreeEncoder.java


注:本文中的org.apache.hadoop.hbase.util.SimpleMutableByteRange类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。