Package org.apache.hadoop.util

Examples of org.apache.hadoop.util.PureJavaCrc32


    return value;
  }

  private DFSOutputStream(DFSClient dfsClient, String src, long blockSize, Progressable progress,
      int bytesPerChecksum, short replication) throws IOException {
    super(new PureJavaCrc32(), bytesPerChecksum, 4);
    this.dfsClient = dfsClient;
    this.src = src;
    this.blockSize = blockSize;
    this.blockReplication = replication;
    this.progress = progress;
View Full Code Here


    this(indexFileName, job, null);
  }

  public SpillRecord(Path indexFileName, JobConf job, String expectedIndexOwner)
    throws IOException {
    this(indexFileName, job, new PureJavaCrc32(), expectedIndexOwner);
  }
View Full Code Here

  /**
   * Write this spill record to the location provided.
   */
  public void writeToFile(Path loc, JobConf job)
      throws IOException {
    writeToFile(loc, job, new PureJavaCrc32());
  }
View Full Code Here

    @SuppressWarnings("deprecation")
    public Reader(DataInputStream in, StreamLimiter limiter,
        int logVersion) {
      this.logVersion = logVersion;
      if (LayoutVersion.supports(Feature.EDITS_CHESKUM, logVersion)) {
        this.checksum = new PureJavaCrc32();
      } else {
        this.checksum = null;
      }

      if (this.checksum != null) {
View Full Code Here

    private final DataOutputBuffer buf;
    private final Checksum checksum;

    public Writer(DataOutputBuffer out) {
      this.buf = out;
      this.checksum = new PureJavaCrc32();
    }
View Full Code Here

            getFSImage().dirIterator(FSImage.NameNodeDirType.IMAGE);
    List<Long> checksums = new ArrayList<Long>();
    while (iter.hasNext()) {
      StorageDirectory sd = iter.next();
      File fsImage = FSImage.getImageFile(sd, FSImage.NameNodeFile.IMAGE);
      PureJavaCrc32 crc = new PureJavaCrc32();
      FileInputStream in = new FileInputStream(fsImage);
      byte[] buff = new byte[4096];
      int read = 0;
      while ((read = in.read(buff)) != -1) {
       crc.update(buff, 0, read);
      }
      long val = crc.getValue();
      checksums.add(val);
    }
    assertTrue("Not enough fsimage copies in MiniDFSCluster " +
               "to test parallel write", checksums.size() > 1);
    for (int i = 1; i < checksums.size(); i++) {
View Full Code Here

    private final DataOutputBuffer buf;
    private final Checksum checksum;

    public Writer(DataOutputBuffer out) {
      this.buf = out;
      this.checksum = new PureJavaCrc32();
    }
View Full Code Here

     */
    @SuppressWarnings("deprecation")
    public Reader(DataInputStream in, int logVersion) {
      this.logVersion = logVersion;
      if (LayoutVersion.supports(Feature.EDITS_CHESKUM, logVersion)) {
        this.checksum = new PureJavaCrc32();
      } else {
        this.checksum = null;
      }

      if (this.checksum != null) {
View Full Code Here

    } finally {
      IOUtils.closeStream(instr);
    }

    // compute crc of partial chunk from data read in the block file.
    partialCrc = new PureJavaCrc32();
    partialCrc.update(buf, 0, sizePartialChunk);
    LOG.info("Read in partial CRC chunk from disk for block " + block);

    // paranoia! verify that the pre-computed crc matches what we
    // recalculated just now
View Full Code Here

    return value;
  }

  private DFSOutputStream(DFSClient dfsClient, String src, long blockSize, Progressable progress,
      int bytesPerChecksum, short replication) throws IOException {
    super(new PureJavaCrc32(), bytesPerChecksum, 4);
    this.dfsClient = dfsClient;
    this.conf = dfsClient.conf;
    this.src = src;
    this.blockSize = blockSize;
    this.blockReplication = replication;
View Full Code Here

TOP

Related Classes of org.apache.hadoop.util.PureJavaCrc32

Copyright © 2018 www.massapicom. 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.