Esempio n. 1
0
 private int writeBlock(FSDataOutputStream os, HFileContext fileContext, int size)
     throws IOException {
   HFileBlock.Writer hbw = new HFileBlock.Writer(null, fileContext);
   DataOutputStream dos = hbw.startWriting(BlockType.DATA);
   for (int j = 0; j < size; j++) {
     dos.writeInt(j);
   }
   hbw.writeHeaderAndData(os);
   LOG.info(
       "Wrote a block at "
           + os.getPos()
           + " with"
           + " onDiskSizeWithHeader="
           + hbw.getOnDiskSizeWithHeader()
           + " uncompressedSizeWithoutHeader="
           + hbw.getOnDiskSizeWithoutHeader()
           + " uncompressedSizeWithoutHeader="
           + hbw.getUncompressedSizeWithoutHeader());
   return hbw.getOnDiskSizeWithHeader();
 }