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


Java HBaseProtos.UUID属性代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.UUID属性的典型用法代码示例。如果您正苦于以下问题:Java HBaseProtos.UUID属性的具体用法?Java HBaseProtos.UUID怎么用?Java HBaseProtos.UUID使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.hadoop.hbase.protobuf.generated.HBaseProtos的用法示例。


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

示例1: readFieldsFromPb

public void readFieldsFromPb(
    WALKey walKey, WALCellCodec.ByteStringUncompressor uncompressor) throws IOException {
  if (this.compressionContext != null) {
    this.encodedRegionName = uncompressor.uncompress(
        walKey.getEncodedRegionName(), compressionContext.regionDict);
    byte[] tablenameBytes = uncompressor.uncompress(
        walKey.getTableName(), compressionContext.tableDict);
    this.tablename = TableName.valueOf(tablenameBytes);
  } else {
    this.encodedRegionName = walKey.getEncodedRegionName().toByteArray();
    this.tablename = TableName.valueOf(walKey.getTableName().toByteArray());
  }
  clusterIds.clear();
  if (walKey.hasClusterId()) {
    //When we are reading the older log (0.95.1 release)
    //This is definitely the originating cluster
    clusterIds.add(new UUID(walKey.getClusterId().getMostSigBits(), walKey.getClusterId()
        .getLeastSigBits()));
  }
  for (HBaseProtos.UUID clusterId : walKey.getClusterIdsList()) {
    clusterIds.add(new UUID(clusterId.getMostSigBits(), clusterId.getLeastSigBits()));
  }
  if (walKey.hasNonceGroup()) {
    this.nonceGroup = walKey.getNonceGroup();
  }
  if (walKey.hasNonce()) {
    this.nonce = walKey.getNonce();
  }
  this.scopes = null;
  if (walKey.getScopesCount() > 0) {
    this.scopes = new TreeMap<byte[], Integer>(Bytes.BYTES_COMPARATOR);
    for (FamilyScope scope : walKey.getScopesList()) {
      byte[] family = (compressionContext == null) ? scope.getFamily().toByteArray() :
        uncompressor.uncompress(scope.getFamily(), compressionContext.familyDict);
      this.scopes.put(family, scope.getScopeType().getNumber());
    }
  }
  this.logSeqNum = walKey.getLogSequenceNumber();
  this.writeTime = walKey.getWriteTime();
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:40,代码来源:HLogKey.java

示例2: toUUID

private java.util.UUID toUUID(final HBaseProtos.UUID uuid) {
  return new java.util.UUID(uuid.getMostSigBits(), uuid.getLeastSigBits());
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:3,代码来源:ReplicationSink.java

示例3: readFieldsFromPb

public void readFieldsFromPb(org.apache.hadoop.hbase.protobuf.generated.WALProtos.WALKey walKey,
                             WALCellCodec.ByteStringUncompressor uncompressor)
    throws IOException {
  if (this.compressionContext != null) {
    this.encodedRegionName = uncompressor.uncompress(
        walKey.getEncodedRegionName(), compressionContext.regionDict);
    byte[] tablenameBytes = uncompressor.uncompress(
        walKey.getTableName(), compressionContext.tableDict);
    this.tablename = TableName.valueOf(tablenameBytes);
  } else {
    this.encodedRegionName = walKey.getEncodedRegionName().toByteArray();
    this.tablename = TableName.valueOf(walKey.getTableName().toByteArray());
  }
  clusterIds.clear();
  if (walKey.hasClusterId()) {
    //When we are reading the older log (0.95.1 release)
    //This is definitely the originating cluster
    clusterIds.add(new UUID(walKey.getClusterId().getMostSigBits(), walKey.getClusterId()
        .getLeastSigBits()));
  }
  for (HBaseProtos.UUID clusterId : walKey.getClusterIdsList()) {
    clusterIds.add(new UUID(clusterId.getMostSigBits(), clusterId.getLeastSigBits()));
  }
  if (walKey.hasNonceGroup()) {
    this.nonceGroup = walKey.getNonceGroup();
  }
  if (walKey.hasNonce()) {
    this.nonce = walKey.getNonce();
  }
  this.scopes = null;
  if (walKey.getScopesCount() > 0) {
    this.scopes = new TreeMap<byte[], Integer>(Bytes.BYTES_COMPARATOR);
    for (FamilyScope scope : walKey.getScopesList()) {
      byte[] family = (compressionContext == null) ? scope.getFamily().toByteArray() :
        uncompressor.uncompress(scope.getFamily(), compressionContext.familyDict);
      this.scopes.put(family, scope.getScopeType().getNumber());
    }
  }
  this.logSeqNum = walKey.getLogSequenceNumber();
  this.writeTime = walKey.getWriteTime();
  if(walKey.hasOrigSequenceNumber()) {
    this.origLogSeqNum = walKey.getOrigSequenceNumber();
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:44,代码来源:WALKey.java

示例4: readFieldsFromPb

public void readFieldsFromPb(
    org.apache.hadoop.hbase.protobuf.generated.WALProtos.WALKey walKey, WALCellCodec.ByteStringUncompressor uncompressor) throws IOException {
  if (this.compressionContext != null) {
    this.encodedRegionName = uncompressor.uncompress(
        walKey.getEncodedRegionName(), compressionContext.regionDict);
    byte[] tablenameBytes = uncompressor.uncompress(
        walKey.getTableName(), compressionContext.tableDict);
    this.tablename = TableName.valueOf(tablenameBytes);
  } else {
    this.encodedRegionName = walKey.getEncodedRegionName().toByteArray();
    this.tablename = TableName.valueOf(walKey.getTableName().toByteArray());
  }
  clusterIds.clear();
  if (walKey.hasClusterId()) {
    //When we are reading the older log (0.95.1 release)
    //This is definitely the originating cluster
    clusterIds.add(new UUID(walKey.getClusterId().getMostSigBits(), walKey.getClusterId()
        .getLeastSigBits()));
  }
  for (HBaseProtos.UUID clusterId : walKey.getClusterIdsList()) {
    clusterIds.add(new UUID(clusterId.getMostSigBits(), clusterId.getLeastSigBits()));
  }
  if (walKey.hasNonceGroup()) {
    this.nonceGroup = walKey.getNonceGroup();
  }
  if (walKey.hasNonce()) {
    this.nonce = walKey.getNonce();
  }
  this.scopes = null;
  if (walKey.getScopesCount() > 0) {
    this.scopes = new TreeMap<byte[], Integer>(Bytes.BYTES_COMPARATOR);
    for (FamilyScope scope : walKey.getScopesList()) {
      byte[] family = (compressionContext == null) ? scope.getFamily().toByteArray() :
        uncompressor.uncompress(scope.getFamily(), compressionContext.familyDict);
      this.scopes.put(family, scope.getScopeType().getNumber());
    }
  }
  this.logSeqNum = walKey.getLogSequenceNumber();
  this.writeTime = walKey.getWriteTime();
  if(walKey.hasOrigSequenceNumber()) {
    this.origLogSeqNum = walKey.getOrigSequenceNumber();
  }
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:43,代码来源:WALKey.java


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