Beispiel #1
0
 @Override
 public void readFields(DataInput input) throws IOException {
   byte[] tableNameBytes = Bytes.readByteArray(input);
   PName tableName = new PNameImpl(tableNameBytes);
   PTableType tableType = PTableType.values()[WritableUtils.readVInt(input)];
   long sequenceNumber = WritableUtils.readVLong(input);
   long timeStamp = input.readLong();
   byte[] pkNameBytes = Bytes.readByteArray(input);
   String pkName = pkNameBytes.length == 0 ? null : Bytes.toString(pkNameBytes);
   int nColumns = WritableUtils.readVInt(input);
   List<PColumn> columns = Lists.newArrayListWithExpectedSize(nColumns);
   for (int i = 0; i < nColumns; i++) {
     PColumn column = new PColumnImpl();
     column.readFields(input);
     columns.add(column);
   }
   Map<String, byte[][]> guidePosts = new HashMap<String, byte[][]>();
   int size = WritableUtils.readVInt(input);
   for (int i = 0; i < size; i++) {
     String key = WritableUtils.readString(input);
     int valueSize = WritableUtils.readVInt(input);
     byte[][] value = new byte[valueSize][];
     for (int j = 0; j < valueSize; j++) {
       value[j] = Bytes.readByteArray(input);
     }
     guidePosts.put(key, value);
   }
   PTableStats stats = new PTableStatsImpl(guidePosts);
   init(tableName, tableType, timeStamp, sequenceNumber, pkName, columns, stats);
 }
 protected final void afterDecodingKeyValue(
     DataInputStream source, ByteBuffer dest, HFileBlockDefaultDecodingContext decodingCtx)
     throws IOException {
   if (decodingCtx.getHFileContext().isIncludesTags()) {
     int tagsLength = ByteBufferUtils.readCompressedInt(source);
     // Put as unsigned short
     dest.put((byte) ((tagsLength >> 8) & 0xff));
     dest.put((byte) (tagsLength & 0xff));
     if (tagsLength > 0) {
       TagCompressionContext tagCompressionContext = decodingCtx.getTagCompressionContext();
       // When tag compression is been used in this file, tagCompressionContext will have a not
       // null value passed.
       if (tagCompressionContext != null) {
         tagCompressionContext.uncompressTags(source, dest, tagsLength);
       } else {
         ByteBufferUtils.copyFromStreamToBuffer(dest, source, tagsLength);
       }
     }
   }
   if (decodingCtx.getHFileContext().isIncludesMvcc()) {
     long memstoreTS = -1;
     try {
       // Copy memstore timestamp from the data input stream to the byte
       // buffer.
       memstoreTS = WritableUtils.readVLong(source);
       ByteBufferUtils.writeVLong(dest, memstoreTS);
     } catch (IOException ex) {
       throw new RuntimeException(
           "Unable to copy memstore timestamp " + memstoreTS + " after decoding a key/value");
     }
   }
 }
Beispiel #3
0
 @Override
 public void readFields(DataInput in) throws IOException {
   super.readFields(in);
   // new format writes system time with the mutation
   if (getSerializedFormat() == SERIALIZED_FORMAT.VERSION2)
     systemTime = WritableUtils.readVLong(in);
 }
  public void loadCfs(Path cfStatsPath) throws IOException {
    if (cfs != null) return;
    FSDataInputStream cfStatsInput = fileSys.open(cfStatsPath);

    int l = cfStatsInput.readInt();
    if (l != prefixSet.size()) {
      throw new RuntimeException("cf length mismatch: " + l + "\t" + prefixSet.size());
    }
    cfs = new long[l];
    for (int i = 0; i < l; i++) cfs[i] = WritableUtils.readVLong(cfStatsInput);
    cfStatsInput.close();
  }
 @Override
 public void readFields(DataInput in) throws IOException {
   id = WritableUtils.readVInt(in);
   expirationDate = WritableUtils.readVLong(in);
   int keyLength = WritableUtils.readVInt(in);
   if (keyLength < 0) {
     secret = null;
   } else {
     byte[] keyBytes = new byte[keyLength];
     in.readFully(keyBytes);
     secret = AuthenticationTokenSecretManager.createSecretKey(keyBytes);
   }
 }
Beispiel #6
0
 @Override
 public void readFields(DataInput in) throws IOException {
   firstRow = WritableUtils.readVLong(in);
   rowCount = WritableUtils.readVLong(in);
 }
 @Override
 public void readFields(DataInput in) throws IOException {
   key = WritableUtils.readVLong(in);
   keyValue = WritableUtils.readString(in);
 }
 @Override
 public void readFields(DataInput in) throws IOException {
   split = WritableUtils.readVInt(in);
   sequence = WritableUtils.readVLong(in);
 }
 public void readFields(DataInput in) throws IOException {
   file = new Path(WritableUtils.readString(in));
   len = WritableUtils.readVLong(in);
 }
Beispiel #10
0
 public void readFields(DataInput in) throws IOException {
   value = WritableUtils.readVLong(in);
 }
Beispiel #11
0
 public static final MR_long read(DataInput in) throws IOException {
   return new MR_long(WritableUtils.readVLong(in));
 }
Beispiel #12
0
 public void readFields(DataInput in) throws IOException {
   bytes = WritableUtils.readVLong(in);
   records = WritableUtils.readVLong(in);
   checksum = WritableUtils.readVInt(in);
 }