org.apache.hadoop.hbase.Cell.getMvccVersion()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(143)

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

Cell.getMvccVersion介绍

暂无

代码示例

代码示例来源:origin: harbby/presto-connectors

/**
 * Returns a hash code that is always the same for two Cells having a matching equals(..) result.
 */
public static int hashCode(Cell cell){
 if (cell == null) {// return 0 for empty Cell
  return 0;
 }
 int hash = calculateHashForKeyValue(cell);
 hash = 31 * hash + (int)cell.getMvccVersion();
 return hash;
}

代码示例来源:origin: harbby/presto-connectors

/**
 * Compare cells.
 * TODO: Replace with dynamic rather than static comparator so can change comparator
 * implementation.
 * @param a
 * @param b
 * @param ignoreSequenceid True if we are to compare the key portion only and ignore
 * the sequenceid. Set to false to compare key and consider sequenceid.
 * @return 0 if equal, -1 if a < b, and +1 if a > b.
 */
public static int compare(final Cell a, final Cell b, boolean ignoreSequenceid) {
 // row
 int c = compareRows(a, b);
 if (c != 0) return c;
 c = compareWithoutRow(a, b);
 if(c != 0) return c;
 if (!ignoreSequenceid) {
  // Negate following comparisons so later edits show up first
  // mvccVersion: later sorts first
  return Longs.compare(b.getMvccVersion(), a.getMvccVersion());
 } else {
  return c;
 }
}

代码示例来源:origin: com.yahoo.omid/hbase-common

if (cell.getMvccVersion() > storedCell.getMvccVersion()) { // Swap values
  Optional<Cell> previousValue = cellToShadowCellMap.remove(storedCell);
  Preconditions.checkNotNull(previousValue, "Should contain an Optional<Cell> value");

代码示例来源:origin: org.apache.omid/hbase-common

if (cell.getMvccVersion() > storedCell.getMvccVersion()) { // Swap values
  Optional<Cell> previousValue = cellToShadowCellMap.remove(storedCell);
  Preconditions.checkNotNull(previousValue, "Should contain an Optional<Cell> value");

代码示例来源:origin: harbby/presto-connectors

/**************** copy key only *********************/
public static KeyValue copyToNewKeyValue(final Cell cell) {
 byte[] bytes = copyToNewByteArray(cell);
 KeyValue kvCell = new KeyValue(bytes, 0, bytes.length);
 kvCell.setSequenceId(cell.getMvccVersion());
 return kvCell;
}

代码示例来源:origin: harbby/presto-connectors

@Override
public void write(Cell cell) throws IOException {
 checkFlushed();
 // Row
 write(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength());
 // Column family
 write(cell.getFamilyArray(), cell.getFamilyOffset(), cell.getFamilyLength());
 // Qualifier
 write(cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength());
 // Version
 this.out.write(Bytes.toBytes(cell.getTimestamp()));
 // Type
 this.out.write(cell.getTypeByte());
 // Value
 write(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength());
 // MvccVersion
 this.out.write(Bytes.toBytes(cell.getMvccVersion()));
}

代码示例来源:origin: harbby/presto-connectors

mvccVersions[totalCells] = cell.getMvccVersion();
 mvccVersionEncoder.add(cell.getMvccVersion());
 totalUnencodedBytes += WritableUtils.getVIntSize(cell.getMvccVersion());
}else{

代码示例来源:origin: com.aliyun.hbase/alihbase-prefix-tree

mvccVersions[totalCells] = cell.getMvccVersion();
 mvccVersionEncoder.add(cell.getMvccVersion());
 totalUnencodedBytes += WritableUtils.getVIntSize(cell.getMvccVersion());
}else{

代码示例来源:origin: harbby/presto-connectors

@Override
public void write(Cell cell) throws IOException {
 checkFlushed();
 // Row
 write(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength());
 // Column family
 write(cell.getFamilyArray(), cell.getFamilyOffset(), cell.getFamilyLength());
 // Qualifier
 write(cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength());
 // Version
 this.out.write(Bytes.toBytes(cell.getTimestamp()));
 // Type
 this.out.write(cell.getTypeByte());
 // Value
 write(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength());
 // Tags
 write(cell.getTagsArray(), cell.getTagsOffset(), cell.getTagsLength());
 // MvccVersion
 this.out.write(Bytes.toBytes(cell.getMvccVersion()));
}

代码示例来源:origin: harbby/presto-connectors

protected boolean skipKVsNewerThanReadpoint() throws IOException {
 // We want to ignore all key-values that are newer than our current
 // readPoint
 Cell startKV = cur;
 while(enforceMVCC
   && cur != null
   && (cur.getMvccVersion() > readPt)) {
  hfs.next();
  setCurrentCell(hfs.getKeyValue());
  if (this.stopSkippingKVsIfNextRow
    && getComparator().compareRows(cur.getRowArray(), cur.getRowOffset(),
      cur.getRowLength(), startKV.getRowArray(), startKV.getRowOffset(),
      startKV.getRowLength()) > 0) {
   return false;
  }
 }
 if (cur == null) {
  close();
  return false;
 }
 return true;
}

代码示例来源:origin: harbby/presto-connectors

long mvccVersion = cell.getMvccVersion();
if (CellUtil.isDelete(cell)) {
 if (keepDeletedCells == KeepDeletedCells.FALSE

相关文章