Package org.apache.hadoop.hdfs.server.datanode.BlockDataFile

Examples of org.apache.hadoop.hdfs.server.datanode.BlockDataFile.RandomAccessor.seek()


    try {
      // truncate blockFile
      ra.setLength(newlen);

      // read last chunk
      ra.seek(lastchunkoffset);
      ra.readFully(b, 0, lastchunksize);
    } finally {
      ra.close();
    }
View Full Code Here


            newBlockLen - lastchunksize, bytesPerChecksum, checksumSize);

        byte[] b = new byte[Math.max(lastchunksize, checksumSize)];

        // read last chunk
        ra.seek(lastchunkoffset);
        ra.readFully(b, 0, lastchunksize);

        // compute checksum
        dcs.update(b, 0, lastchunksize);
        dcs.writeValue(b, 0, false);
View Full Code Here

        // compute checksum
        dcs.update(b, 0, lastchunksize);
        dcs.writeValue(b, 0, false);

        ra.seek(newBlockFileSize - checksumSize);
        ra.write(b, 0, checksumSize);
      }
    } finally {
      ra.close();
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.