Java 类org.apache.hadoop.hbase.protobuf.generated.FSProtos 实例源码

项目:pbase    文件:FSUtils.java   
/**
 * Parse the content of the ${HBASE_ROOTDIR}/hbase.version file.
 * @param bytes The byte content of the hbase.version file.
 * @return The version found in the file as a String.
 * @throws DeserializationException
 */
static String parseVersionFrom(final byte [] bytes)
throws DeserializationException {
  ProtobufUtil.expectPBMagicPrefix(bytes);
  int pblen = ProtobufUtil.lengthOfPBMagic();
  FSProtos.HBaseVersionFileContent.Builder builder =
    FSProtos.HBaseVersionFileContent.newBuilder();
  FSProtos.HBaseVersionFileContent fileContent;
  try {
    fileContent = builder.mergeFrom(bytes, pblen, bytes.length - pblen).build();
    return fileContent.getVersion();
  } catch (InvalidProtocolBufferException e) {
    // Convert
    throw new DeserializationException(e);
  }
}
项目:HIndex    文件:FSUtils.java   
/**
 * Parse the content of the ${HBASE_ROOTDIR}/hbase.version file.
 * @param bytes The byte content of the hbase.version file.
 * @return The version found in the file as a String.
 * @throws DeserializationException
 */
static String parseVersionFrom(final byte [] bytes)
throws DeserializationException {
  ProtobufUtil.expectPBMagicPrefix(bytes);
  int pblen = ProtobufUtil.lengthOfPBMagic();
  FSProtos.HBaseVersionFileContent.Builder builder =
    FSProtos.HBaseVersionFileContent.newBuilder();
  FSProtos.HBaseVersionFileContent fileContent;
  try {
    fileContent = builder.mergeFrom(bytes, pblen, bytes.length - pblen).build();
    return fileContent.getVersion();
  } catch (InvalidProtocolBufferException e) {
    // Convert
    throw new DeserializationException(e);
  }
}
项目:PyroDB    文件:FSUtils.java   
/**
 * Parse the content of the ${HBASE_ROOTDIR}/hbase.version file.
 * @param bytes The byte content of the hbase.version file.
 * @return The version found in the file as a String.
 * @throws DeserializationException
 */
static String parseVersionFrom(final byte [] bytes)
throws DeserializationException {
  ProtobufUtil.expectPBMagicPrefix(bytes);
  int pblen = ProtobufUtil.lengthOfPBMagic();
  FSProtos.HBaseVersionFileContent.Builder builder =
    FSProtos.HBaseVersionFileContent.newBuilder();
  FSProtos.HBaseVersionFileContent fileContent;
  try {
    fileContent = builder.mergeFrom(bytes, pblen, bytes.length - pblen).build();
    return fileContent.getVersion();
  } catch (InvalidProtocolBufferException e) {
    // Convert
    throw new DeserializationException(e);
  }
}
项目:c5    文件:FSUtils.java   
/**
 * Parse the content of the ${HBASE_ROOTDIR}/hbase.version file.
 * @param bytes The byte content of the hbase.version file.
 * @return The version found in the file as a String.
 * @throws DeserializationException
 */
static String parseVersionFrom(final byte [] bytes)
throws DeserializationException {
  ProtobufUtil.expectPBMagicPrefix(bytes);
  int pblen = ProtobufUtil.lengthOfPBMagic();
  FSProtos.HBaseVersionFileContent.Builder builder =
    FSProtos.HBaseVersionFileContent.newBuilder();
  FSProtos.HBaseVersionFileContent fileContent;
  try {
    fileContent = builder.mergeFrom(bytes, pblen, bytes.length - pblen).build();
    return fileContent.getVersion();
  } catch (InvalidProtocolBufferException e) {
    // Convert
    throw new DeserializationException(e);
  }
}
项目:DominoHBase    文件:FSUtils.java   
/**
 * Parse the content of the ${HBASE_ROOTDIR}/hbase.version file.
 * @param bytes The byte content of the hbase.version file.
 * @return The version found in the file as a String.
 * @throws DeserializationException
 */
static String parseVersionFrom(final byte [] bytes)
throws DeserializationException {
  ProtobufUtil.expectPBMagicPrefix(bytes);
  int pblen = ProtobufUtil.lengthOfPBMagic();
  FSProtos.HBaseVersionFileContent.Builder builder =
    FSProtos.HBaseVersionFileContent.newBuilder();
  FSProtos.HBaseVersionFileContent fileContent;
  try {
    fileContent = builder.mergeFrom(bytes, pblen, bytes.length - pblen).build();
    return fileContent.getVersion();
  } catch (InvalidProtocolBufferException e) {
    // Convert
    throw new DeserializationException(e);
  }
}
项目:ditb    文件:FSUtils.java   
/**
 * Parse the content of the ${HBASE_ROOTDIR}/hbase.version file.
 * @param bytes The byte content of the hbase.version file.
 * @return The version found in the file as a String.
 * @throws DeserializationException
 */
static String parseVersionFrom(final byte [] bytes)
throws DeserializationException {
  ProtobufUtil.expectPBMagicPrefix(bytes);
  int pblen = ProtobufUtil.lengthOfPBMagic();
  FSProtos.HBaseVersionFileContent.Builder builder =
    FSProtos.HBaseVersionFileContent.newBuilder();
  try {
    ProtobufUtil.mergeFrom(builder, bytes, pblen, bytes.length - pblen);
    return builder.getVersion();
  } catch (IOException e) {
    // Convert
    throw new DeserializationException(e);
  }
}
项目:ditb    文件:Reference.java   
public FSProtos.Reference convert() {
  FSProtos.Reference.Builder builder = FSProtos.Reference.newBuilder();
  builder.setRange(isTopFileRegion(getFileRegion())?
    FSProtos.Reference.Range.TOP: FSProtos.Reference.Range.BOTTOM);
  builder.setSplitkey(ByteStringer.wrap(getSplitKey()));
  return builder.build();
}
项目:pbase    文件:Reference.java   
public FSProtos.Reference convert() {
  FSProtos.Reference.Builder builder = FSProtos.Reference.newBuilder();
  builder.setRange(isTopFileRegion(getFileRegion())?
    FSProtos.Reference.Range.TOP: FSProtos.Reference.Range.BOTTOM);
  builder.setSplitkey(ByteStringer.wrap(getSplitKey()));
  return builder.build();
}
项目:HIndex    文件:Reference.java   
FSProtos.Reference convert() {
  FSProtos.Reference.Builder builder = FSProtos.Reference.newBuilder();
  builder.setRange(isTopFileRegion(getFileRegion())?
    FSProtos.Reference.Range.TOP: FSProtos.Reference.Range.BOTTOM);
  builder.setSplitkey(HBaseZeroCopyByteString.wrap(getSplitKey()));
  return builder.build();
}
项目:PyroDB    文件:Reference.java   
public FSProtos.Reference convert() {
  FSProtos.Reference.Builder builder = FSProtos.Reference.newBuilder();
  builder.setRange(isTopFileRegion(getFileRegion())?
    FSProtos.Reference.Range.TOP: FSProtos.Reference.Range.BOTTOM);
  builder.setSplitkey(HBaseZeroCopyByteString.wrap(getSplitKey()));
  return builder.build();
}
项目:c5    文件:Reference.java   
FSProtos.Reference convert() {
  FSProtos.Reference.Builder builder = FSProtos.Reference.newBuilder();
  builder.setRange(isTopFileRegion(getFileRegion())?
    FSProtos.Reference.Range.TOP: FSProtos.Reference.Range.BOTTOM);
  builder.setSplitkey(ZeroCopyLiteralByteString.wrap(getSplitKey()));
  return builder.build();
}
项目:DominoHBase    文件:Reference.java   
FSProtos.Reference convert() {
  FSProtos.Reference.Builder builder = FSProtos.Reference.newBuilder();
  builder.setRange(isTopFileRegion(getFileRegion())?
    FSProtos.Reference.Range.TOP: FSProtos.Reference.Range.BOTTOM);
  builder.setSplitkey(ByteString.copyFrom(getSplitKey()));
  return builder.build();
}
项目:ditb    文件:FSUtils.java   
/**
 * Create the content to write into the ${HBASE_ROOTDIR}/hbase.version file.
 * @param version Version to persist
 * @return Serialized protobuf with <code>version</code> content and a bit of pb magic for a prefix.
 */
static byte [] toVersionByteArray(final String version) {
  FSProtos.HBaseVersionFileContent.Builder builder =
    FSProtos.HBaseVersionFileContent.newBuilder();
  return ProtobufUtil.prependPBMagic(builder.setVersion(version).build().toByteArray());
}
项目:ditb    文件:Reference.java   
public static Reference convert(final FSProtos.Reference r) {
  Reference result = new Reference();
  result.splitkey = r.getSplitkey().toByteArray();
  result.region = r.getRange() == FSProtos.Reference.Range.TOP? Range.top: Range.bottom;
  return result;
}
项目:pbase    文件:FSUtils.java   
/**
 * Create the content to write into the ${HBASE_ROOTDIR}/hbase.version file.
 * @param version Version to persist
 * @return Serialized protobuf with <code>version</code> content and a bit of pb magic for a prefix.
 */
static byte [] toVersionByteArray(final String version) {
  FSProtos.HBaseVersionFileContent.Builder builder =
    FSProtos.HBaseVersionFileContent.newBuilder();
  return ProtobufUtil.prependPBMagic(builder.setVersion(version).build().toByteArray());
}
项目:pbase    文件:Reference.java   
public static Reference convert(final FSProtos.Reference r) {
  Reference result = new Reference();
  result.splitkey = r.getSplitkey().toByteArray();
  result.region = r.getRange() == FSProtos.Reference.Range.TOP? Range.top: Range.bottom;
  return result;
}
项目:HIndex    文件:FSUtils.java   
/**
 * Create the content to write into the ${HBASE_ROOTDIR}/hbase.version file.
 * @param version Version to persist
 * @return Serialized protobuf with <code>version</code> content and a bit of pb magic for a prefix.
 */
static byte [] toVersionByteArray(final String version) {
  FSProtos.HBaseVersionFileContent.Builder builder =
    FSProtos.HBaseVersionFileContent.newBuilder();
  return ProtobufUtil.prependPBMagic(builder.setVersion(version).build().toByteArray());
}
项目:HIndex    文件:Reference.java   
static Reference convert(final FSProtos.Reference r) {
  Reference result = new Reference();
  result.splitkey = r.getSplitkey().toByteArray();
  result.region = r.getRange() == FSProtos.Reference.Range.TOP? Range.top: Range.bottom;
  return result;
}
项目:PyroDB    文件:FSUtils.java   
/**
 * Create the content to write into the ${HBASE_ROOTDIR}/hbase.version file.
 * @param version Version to persist
 * @return Serialized protobuf with <code>version</code> content and a bit of pb magic for a prefix.
 */
static byte [] toVersionByteArray(final String version) {
  FSProtos.HBaseVersionFileContent.Builder builder =
    FSProtos.HBaseVersionFileContent.newBuilder();
  return ProtobufUtil.prependPBMagic(builder.setVersion(version).build().toByteArray());
}
项目:PyroDB    文件:Reference.java   
public static Reference convert(final FSProtos.Reference r) {
  Reference result = new Reference();
  result.splitkey = r.getSplitkey().toByteArray();
  result.region = r.getRange() == FSProtos.Reference.Range.TOP? Range.top: Range.bottom;
  return result;
}
项目:c5    文件:FSUtils.java   
/**
 * Create the content to write into the ${HBASE_ROOTDIR}/hbase.version file.
 * @param version Version to persist
 * @return Serialized protobuf with <code>version</code> content and a bit of pb magic for a prefix.
 */
static byte [] toVersionByteArray(final String version) {
  FSProtos.HBaseVersionFileContent.Builder builder =
    FSProtos.HBaseVersionFileContent.newBuilder();
  return ProtobufUtil.prependPBMagic(builder.setVersion(version).build().toByteArray());
}
项目:c5    文件:Reference.java   
static Reference convert(final FSProtos.Reference r) {
  Reference result = new Reference();
  result.splitkey = r.getSplitkey().toByteArray();
  result.region = r.getRange() == FSProtos.Reference.Range.TOP? Range.top: Range.bottom;
  return result;
}
项目:DominoHBase    文件:FSUtils.java   
/**
 * Create the content to write into the ${HBASE_ROOTDIR}/hbase.version file.
 * @param version Version to persist
 * @return Serialized protobuf with <code>version</code> content and a bit of pb magic for a prefix.
 */
static byte [] toVersionByteArray(final String version) {
  FSProtos.HBaseVersionFileContent.Builder builder =
    FSProtos.HBaseVersionFileContent.newBuilder();
  return ProtobufUtil.prependPBMagic(builder.setVersion(version).build().toByteArray());
}
项目:DominoHBase    文件:Reference.java   
static Reference convert(final FSProtos.Reference r) {
  Reference result = new Reference();
  result.splitkey = r.getSplitkey().toByteArray();
  result.region = r.getRange() == FSProtos.Reference.Range.TOP? Range.top: Range.bottom;
  return result;
}