• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java BytesBytesPair类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: parseFrom

import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BytesBytesPair; //导入依赖的package包/类
/**
 * @param pbBytes A pb serialized {@link FuzzyRowFilter} instance
 * @return An instance of {@link FuzzyRowFilter} made from <code>bytes</code>
 * @throws DeserializationException
 * @see #toByteArray
 */
public static FuzzyRowFilter parseFrom(final byte[] pbBytes) throws DeserializationException {
  FilterProtos.FuzzyRowFilter proto;
  try {
    proto = FilterProtos.FuzzyRowFilter.parseFrom(pbBytes);
  } catch (InvalidProtocolBufferException e) {
    throw new DeserializationException(e);
  }
  int count = proto.getFuzzyKeysDataCount();
  ArrayList<Pair<byte[], byte[]>> fuzzyKeysData = new ArrayList<Pair<byte[], byte[]>>(count);
  for (int i = 0; i < count; ++i) {
    BytesBytesPair current = proto.getFuzzyKeysData(i);
    byte[] keyBytes = current.getFirst().toByteArray();
    byte[] keyMeta = current.getSecond().toByteArray();
    fuzzyKeysData.add(new Pair<byte[], byte[]>(keyBytes, keyMeta));
  }
  return new FuzzyRowFilter(fuzzyKeysData);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:24,代码来源:FuzzyRowFilter.java


示例2: parseFrom

import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BytesBytesPair; //导入依赖的package包/类
/**
 * @param pbBytes A pb serialized {@link FuzzyRowFilter} instance
 * @return An instance of {@link FuzzyRowFilter} made from <code>bytes</code>
 * @throws DeserializationException
 * @see #toByteArray
 */
public static FuzzyRowFilter parseFrom(final byte [] pbBytes)
throws DeserializationException {
  FilterProtos.FuzzyRowFilter proto;
  try {
    proto = FilterProtos.FuzzyRowFilter.parseFrom(pbBytes);
  } catch (InvalidProtocolBufferException e) {
    throw new DeserializationException(e);
  }
  int count = proto.getFuzzyKeysDataCount();
  ArrayList<Pair<byte[], byte[]>> fuzzyKeysData= new ArrayList<Pair<byte[], byte[]>>(count);
  for (int i = 0; i < count; ++i) {
    BytesBytesPair current = proto.getFuzzyKeysData(i);
    byte[] keyBytes = current.getFirst().toByteArray();
    byte[] keyMeta = current.getSecond().toByteArray();
    fuzzyKeysData.add(new Pair<byte[], byte[]>(keyBytes, keyMeta));
  }
  return new FuzzyRowFilter(fuzzyKeysData);
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:25,代码来源:FuzzyRowFilter.java


示例3: write

import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BytesBytesPair; //导入依赖的package包/类
/**
 * Write out this instance on the passed in <code>out</code> stream.
 * We write it as a protobuf.
 * @param out
 * @throws IOException
 * @see #read(DataInputStream)
 */
void write(final DataOutputStream out) throws IOException {
  HFileProtos.FileInfoProto.Builder builder = HFileProtos.FileInfoProto.newBuilder();
  for (Map.Entry<byte[], byte[]> e : this.map.entrySet()) {
    HBaseProtos.BytesBytesPair.Builder bbpBuilder = HBaseProtos.BytesBytesPair.newBuilder();
    bbpBuilder.setFirst(ByteStringer.wrap(e.getKey()));
    bbpBuilder.setSecond(ByteStringer.wrap(e.getValue()));
    builder.addMapEntry(bbpBuilder.build());
  }
  out.write(ProtobufUtil.PB_MAGIC);
  builder.build().writeDelimitedTo(out);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:19,代码来源:HFile.java


示例4: parsePB

import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BytesBytesPair; //导入依赖的package包/类
/**
 * Fill our map with content of the pb we read off disk
 * @param fip protobuf message to read
 */
void parsePB(final HFileProtos.FileInfoProto fip) {
  this.map.clear();
  for (BytesBytesPair pair : fip.getMapEntryList()) {
    this.map.put(pair.getFirst().toByteArray(), pair.getSecond().toByteArray());
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:11,代码来源:HFile.java


示例5: toByteArray

import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BytesBytesPair; //导入依赖的package包/类
/**
 * @return The filter serialized using pb
 */
public byte[] toByteArray() {
  FilterProtos.FuzzyRowFilter.Builder builder = FilterProtos.FuzzyRowFilter.newBuilder();
  for (Pair<byte[], byte[]> fuzzyData : fuzzyKeysData) {
    BytesBytesPair.Builder bbpBuilder = BytesBytesPair.newBuilder();
    bbpBuilder.setFirst(ByteStringer.wrap(fuzzyData.getFirst()));
    bbpBuilder.setSecond(ByteStringer.wrap(fuzzyData.getSecond()));
    builder.addFuzzyKeysData(bbpBuilder);
  }
  return builder.build().toByteArray();
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:14,代码来源:FuzzyRowFilter.java


示例6: extractFuzzyRowFilterPairs

import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BytesBytesPair; //导入依赖的package包/类
private static List<Pair<byte[], byte[]>> extractFuzzyRowFilterPairs(FuzzyRowFilter filter)
    throws IOException {
  // TODO: Change FuzzyRowFilter to expose fuzzyKeysData.
  FilterProtos.FuzzyRowFilter filterProto =
      FilterProtos.FuzzyRowFilter.parseFrom(filter.toByteArray());
  List<Pair<byte[], byte[]>> result =
      new ArrayList<>(filterProto.getFuzzyKeysDataCount());
  for (BytesBytesPair protoPair : filterProto.getFuzzyKeysDataList()) {
    result.add(
        new Pair<>(
            protoPair.getFirst().toByteArray(),
            protoPair.getSecond().toByteArray()));
  }
  return result;
}
 
开发者ID:dmmcerlean,项目名称:cloud-bigtable-client,代码行数:16,代码来源:FuzzyRowFilterAdapter.java


示例7: write

import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BytesBytesPair; //导入依赖的package包/类
/**
 * Write out this instance on the passed in <code>out</code> stream.
 * We write it as a protobuf.
 * @param out
 * @throws IOException
 * @see #read(DataInputStream)
 */
void write(final DataOutputStream out) throws IOException {
  HFileProtos.FileInfoProto.Builder builder = HFileProtos.FileInfoProto.newBuilder();
  for (Map.Entry<byte [], byte[]> e: this.map.entrySet()) {
    HBaseProtos.BytesBytesPair.Builder bbpBuilder = HBaseProtos.BytesBytesPair.newBuilder();
    bbpBuilder.setFirst(ByteStringer.wrap(e.getKey()));
    bbpBuilder.setSecond(ByteStringer.wrap(e.getValue()));
    builder.addMapEntry(bbpBuilder.build());
  }
  out.write(ProtobufUtil.PB_MAGIC);
  builder.build().writeDelimitedTo(out);
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:19,代码来源:HFile.java


示例8: parsePB

import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BytesBytesPair; //导入依赖的package包/类
/**
 * Fill our map with content of the pb we read off disk
 * @param fip protobuf message to read
 */
void parsePB(final HFileProtos.FileInfoProto fip) {
  this.map.clear();
  for (BytesBytesPair pair: fip.getMapEntryList()) {
    this.map.put(pair.getFirst().toByteArray(), pair.getSecond().toByteArray());
  }
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:11,代码来源:HFile.java


示例9: toByteArray

import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BytesBytesPair; //导入依赖的package包/类
/**
 * @return The filter serialized using pb
 */
public byte [] toByteArray() {
  FilterProtos.FuzzyRowFilter.Builder builder =
    FilterProtos.FuzzyRowFilter.newBuilder();
  for (Pair<byte[], byte[]> fuzzyData : fuzzyKeysData) {
    BytesBytesPair.Builder bbpBuilder = BytesBytesPair.newBuilder();
    bbpBuilder.setFirst(ByteStringer.wrap(fuzzyData.getFirst()));
    bbpBuilder.setSecond(ByteStringer.wrap(fuzzyData.getSecond()));
    builder.addFuzzyKeysData(bbpBuilder);
  }
  return builder.build().toByteArray();
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:15,代码来源:FuzzyRowFilter.java


示例10: write

import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BytesBytesPair; //导入依赖的package包/类
/**
 * Write out this instance on the passed in <code>out</code> stream.
 * We write it as a protobuf.
 * @param out
 * @throws IOException
 * @see #read(DataInputStream)
 */
void write(final DataOutputStream out) throws IOException {
  HFileProtos.FileInfoProto.Builder builder = HFileProtos.FileInfoProto.newBuilder();
  for (Map.Entry<byte [], byte[]> e: this.map.entrySet()) {
    HBaseProtos.BytesBytesPair.Builder bbpBuilder = HBaseProtos.BytesBytesPair.newBuilder();
    bbpBuilder.setFirst(HBaseZeroCopyByteString.wrap(e.getKey()));
    bbpBuilder.setSecond(HBaseZeroCopyByteString.wrap(e.getValue()));
    builder.addMapEntry(bbpBuilder.build());
  }
  out.write(ProtobufUtil.PB_MAGIC);
  builder.build().writeDelimitedTo(out);
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:19,代码来源:HFile.java


示例11: toByteArray

import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BytesBytesPair; //导入依赖的package包/类
/**
 * @return The filter serialized using pb
 */
public byte [] toByteArray() {
  FilterProtos.FuzzyRowFilter.Builder builder =
    FilterProtos.FuzzyRowFilter.newBuilder();
  for (Pair<byte[], byte[]> fuzzyData : fuzzyKeysData) {
    BytesBytesPair.Builder bbpBuilder = BytesBytesPair.newBuilder();
    bbpBuilder.setFirst(HBaseZeroCopyByteString.wrap(fuzzyData.getFirst()));
    bbpBuilder.setSecond(HBaseZeroCopyByteString.wrap(fuzzyData.getSecond()));
    builder.addFuzzyKeysData(bbpBuilder);
  }
  return builder.build().toByteArray();
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:15,代码来源:FuzzyRowFilter.java


示例12: write

import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BytesBytesPair; //导入依赖的package包/类
/**
 * Write out this instance on the passed in <code>out</code> stream.
 * We write it as a protobuf.
 * @param out
 * @throws IOException
 * @see #read(DataInputStream)
 */
void write(final DataOutputStream out) throws IOException {
  HFileProtos.FileInfoProto.Builder builder = HFileProtos.FileInfoProto.newBuilder();
  for (Map.Entry<byte [], byte[]> e: this.map.entrySet()) {
    HBaseProtos.BytesBytesPair.Builder bbpBuilder = HBaseProtos.BytesBytesPair.newBuilder();
    bbpBuilder.setFirst(ZeroCopyLiteralByteString.wrap(e.getKey()));
    bbpBuilder.setSecond(ZeroCopyLiteralByteString.wrap(e.getValue()));
    builder.addMapEntry(bbpBuilder.build());
  }
  out.write(ProtobufUtil.PB_MAGIC);
  builder.build().writeDelimitedTo(out);
}
 
开发者ID:cloud-software-foundation,项目名称:c5,代码行数:19,代码来源:HFile.java


示例13: toByteArray

import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BytesBytesPair; //导入依赖的package包/类
/**
 * @return The filter serialized using pb
 */
public byte [] toByteArray() {
  FilterProtos.FuzzyRowFilter.Builder builder =
    FilterProtos.FuzzyRowFilter.newBuilder();
  for (Pair<byte[], byte[]> fuzzyData : fuzzyKeysData) {
    BytesBytesPair.Builder bbpBuilder = BytesBytesPair.newBuilder();
    bbpBuilder.setFirst(ZeroCopyLiteralByteString.wrap(fuzzyData.getFirst()));
    bbpBuilder.setSecond(ZeroCopyLiteralByteString.wrap(fuzzyData.getSecond()));
    builder.addFuzzyKeysData(bbpBuilder);
  }
  return builder.build().toByteArray();
}
 
开发者ID:cloud-software-foundation,项目名称:c5,代码行数:15,代码来源:FuzzyRowFilter.java


示例14: convert

import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BytesBytesPair; //导入依赖的package包/类
/**
 * @return Convert the current {@link HTableDescriptor} into a pb TableSchema instance.
 */
public TableSchema convert() {
  TableSchema.Builder builder = TableSchema.newBuilder();
  builder.setName(ByteString.copyFrom(getName()));
  for (Map.Entry<ImmutableBytesWritable, ImmutableBytesWritable> e: this.values.entrySet()) {
    BytesBytesPair.Builder aBuilder = BytesBytesPair.newBuilder();
    aBuilder.setFirst(ByteString.copyFrom(e.getKey().get()));
    aBuilder.setSecond(ByteString.copyFrom(e.getValue().get()));
    builder.addAttributes(aBuilder.build());
  }
  for (HColumnDescriptor hcd: getColumnFamilies()) {
    builder.addColumnFamilies(hcd.convert());
  }
  return builder.build();
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:18,代码来源:HTableDescriptor.java


示例15: convert

import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BytesBytesPair; //导入依赖的package包/类
/**
 * @param cfs
 * @return An {@link HColumnDescriptor} made from the passed in <code>cfs</code>
 */
public static HColumnDescriptor convert(final ColumnFamilySchema cfs) {
  // Use the empty constructor so we preserve the initial values set on construction for things
  // like maxVersion.  Otherwise, we pick up wrong values on deserialization which makes for
  // unrelated-looking test failures that are hard to trace back to here.
  HColumnDescriptor hcd = new HColumnDescriptor();
  hcd.name = cfs.getName().toByteArray();
  for (BytesBytesPair a: cfs.getAttributesList()) {
    hcd.setValue(a.getFirst().toByteArray(), a.getSecond().toByteArray());
  }
  return hcd;
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:16,代码来源:HColumnDescriptor.java


示例16: toByteArray

import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BytesBytesPair; //导入依赖的package包/类
/**
 * @return The filter serialized using pb
 */
public byte [] toByteArray() {
  FilterProtos.FuzzyRowFilter.Builder builder =
    FilterProtos.FuzzyRowFilter.newBuilder();
  for (Pair<byte[], byte[]> fuzzyData : fuzzyKeysData) {
    BytesBytesPair.Builder bbpBuilder = BytesBytesPair.newBuilder();
    bbpBuilder.setFirst(ByteString.copyFrom(fuzzyData.getFirst()));
    bbpBuilder.setSecond(ByteString.copyFrom(fuzzyData.getSecond()));
    builder.addFuzzyKeysData(bbpBuilder);
  }
  return builder.build().toByteArray();
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:15,代码来源:FuzzyRowFilter.java


示例17: write

import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BytesBytesPair; //导入依赖的package包/类
/**
 * Write out this instance on the passed in <code>out</code> stream.
 * We write it as a protobuf.
 * @param out
 * @throws IOException
 * @see {@link #read(DataInputStream)}
 */
void write(final DataOutputStream out) throws IOException {
  HFileProtos.FileInfoProto.Builder builder = HFileProtos.FileInfoProto.newBuilder();
  for (Map.Entry<byte [], byte[]> e: this.map.entrySet()) {
    HBaseProtos.BytesBytesPair.Builder bbpBuilder = HBaseProtos.BytesBytesPair.newBuilder();
    bbpBuilder.setFirst(ByteString.copyFrom(e.getKey()));
    bbpBuilder.setSecond(ByteString.copyFrom(e.getValue()));
    builder.addMapEntry(bbpBuilder.build());
  }
  out.write(ProtobufUtil.PB_MAGIC);
  builder.build().writeDelimitedTo(out);
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:19,代码来源:HFile.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BaseListLoader类代码示例发布时间:2022-05-22
下一篇:
Java NewShmInfo类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap