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

项目:ditb    文件:TableSnapshotInputFormatImpl.java   
@Override
public void write(DataOutput out) throws IOException {
  TableSnapshotRegionSplit.Builder builder = TableSnapshotRegionSplit.newBuilder()
      .setTable(htd.convert())
      .setRegion(HRegionInfo.convert(regionInfo));

  for (String location : locations) {
    builder.addLocations(location);
  }

  TableSnapshotRegionSplit split = builder.build();

  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  split.writeTo(baos);
  baos.close();
  byte[] buf = baos.toByteArray();
  out.writeInt(buf.length);
  out.write(buf);

  Bytes.writeByteArray(out, Bytes.toBytes(scan));
  Bytes.writeByteArray(out, Bytes.toBytes(restoreDir));

}
项目:pbase    文件:TableSnapshotInputFormatImpl.java   
@Override
public void write(DataOutput out) throws IOException {
  TableSnapshotRegionSplit.Builder builder = TableSnapshotRegionSplit.newBuilder()
      .setTable(htd.convert())
      .setRegion(HRegionInfo.convert(regionInfo));

  for (String location : locations) {
    builder.addLocations(location);
  }

  TableSnapshotRegionSplit split = builder.build();

  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  split.writeTo(baos);
  baos.close();
  byte[] buf = baos.toByteArray();
  out.writeInt(buf.length);
  out.write(buf);
}
项目:PyroDB    文件:TableSnapshotInputFormatImpl.java   
@Override
public void write(DataOutput out) throws IOException {
  TableSnapshotRegionSplit.Builder builder = TableSnapshotRegionSplit.newBuilder()
      .setTable(htd.convert())
      .setRegion(HRegionInfo.convert(regionInfo));

  for (String location : locations) {
    builder.addLocations(location);
  }

  TableSnapshotRegionSplit split = builder.build();

  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  split.writeTo(baos);
  baos.close();
  byte[] buf = baos.toByteArray();
  out.writeInt(buf.length);
  out.write(buf);
}
项目:ditb    文件:TableSnapshotInputFormatImpl.java   
@Override
public void readFields(DataInput in) throws IOException {
  int len = in.readInt();
  byte[] buf = new byte[len];
  in.readFully(buf);
  TableSnapshotRegionSplit split = TableSnapshotRegionSplit.PARSER.parseFrom(buf);
  this.htd = HTableDescriptor.convert(split.getTable());
  this.regionInfo = HRegionInfo.convert(split.getRegion());
  List<String> locationsList = split.getLocationsList();
  this.locations = locationsList.toArray(new String[locationsList.size()]);

  this.scan = Bytes.toString(Bytes.readByteArray(in));
  this.restoreDir = Bytes.toString(Bytes.readByteArray(in));
}
项目:pbase    文件:TableSnapshotInputFormatImpl.java   
@Override
public void readFields(DataInput in) throws IOException {
  int len = in.readInt();
  byte[] buf = new byte[len];
  in.readFully(buf);
  TableSnapshotRegionSplit split = TableSnapshotRegionSplit.PARSER.parseFrom(buf);
  this.htd = HTableDescriptor.convert(split.getTable());
  this.regionInfo = HRegionInfo.convert(split.getRegion());
  List<String> locationsList = split.getLocationsList();
  this.locations = locationsList.toArray(new String[locationsList.size()]);
}
项目:PyroDB    文件:TableSnapshotInputFormatImpl.java   
@Override
public void readFields(DataInput in) throws IOException {
  int len = in.readInt();
  byte[] buf = new byte[len];
  in.readFully(buf);
  TableSnapshotRegionSplit split = TableSnapshotRegionSplit.PARSER.parseFrom(buf);
  this.htd = HTableDescriptor.convert(split.getTable());
  this.regionInfo = HRegionInfo.convert(split.getRegion());
  List<String> locationsList = split.getLocationsList();
  this.locations = locationsList.toArray(new String[locationsList.size()]);
}