Package org.apache.hadoop.util

Examples of org.apache.hadoop.util.PureJavaCrc32


                              "self=" + sock.getLocalSocketAddress() +
                              ", remote=" + sock.getRemoteSocketAddress() +
                              " for file " + file +
                              " for block " + blockId);
      }
      DataChecksum checksum = DataChecksum.newDataChecksum( in , new PureJavaCrc32());
      //Warning when we get CHECKSUM_NULL?

      // Read the first chunk offset.
      long firstChunkOffset = in.readLong();
View Full Code Here


                              "multiple of io.bytes.per.checksum");

      }
      checksum = DataChecksum.newDataChecksum(DataChecksum.CHECKSUM_CRC32,
                                              bytesPerChecksum,
                                              new PureJavaCrc32());
    }
View Full Code Here

    this.verifyChecksum = verifyChecksum;
    this.metrics = metrics;

     // create a checksum checker
     if (this.verifyChecksum) {
       this.checker = new PureJavaCrc32();
     }
  }
View Full Code Here

        numPartitions * MapTask.MAP_OUTPUT_INDEX_RECORD_LENGTH);
    entries = buf.asLongBuffer();
  }

  public SpillRecord(Path indexFileName, JobConf job) throws IOException {
    this(indexFileName, job, new PureJavaCrc32());
  }
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

      assertEquals(len1, raf.length());
    } else {
      int bytesPerChecksum = conf.getInt("io.bytes.per.checksum", 512);
      int checksumSize = DataChecksum.newDataChecksum(DataChecksum.CHECKSUM_CRC32,
          bytesPerChecksum,
          new PureJavaCrc32()).getChecksumSize();
      assertEquals(raf.length(), BlockInlineChecksumReader.getFileLengthFromBlockSize(
          len1, bytesPerChecksum, checksumSize));
    }
    raf.setLength(0);
    raf.close();
View Full Code Here

        byte[] version = new byte[CHECKSUM_VERSION.length];
        sums.readFully(version);
        if (!Arrays.equals(version, CHECKSUM_VERSION))
          throw new IOException("Not a checksum file: "+sumFile);
        this.bytesPerSum = sums.readInt();
        set(fs.verifyChecksum, new PureJavaCrc32(), bytesPerSum, 4);
      } catch (FileNotFoundException e) {         // quietly ignore
        set(fs.verifyChecksum, null, 1, 0);
      } catch (IOException e) {                   // loudly ignore
        LOG.warn("Problem opening checksum file: "+ file +
                 ".  Ignoring exception: " +
View Full Code Here

                          short replication,
                          long blockSize,
                          int bytesPerChecksum,
                          Progressable progress)
      throws IOException {
      super(new PureJavaCrc32(), bytesPerChecksum, 4, null);
      this.datas = fs.getRawFileSystem().create(file, overwrite, bufferSize,
                                         replication, blockSize, progress);
      int sumBufferSize = fs.getSumBufferSize(bytesPerChecksum, bufferSize);
      this.sums = fs.getRawFileSystem().create(fs.getChecksumFile(file), true,
                                               sumBufferSize, replication,
View Full Code Here

   * @param len The length of the input stream including checksum bytes.
   */
  public IFileInputStream(InputStream in, long len) {
    this.in = in;
    sum = DataChecksum.newDataChecksum(DataChecksum.CHECKSUM_CRC32,
        Integer.MAX_VALUE, new PureJavaCrc32());
    checksumSize = sum.getChecksumSize();
    length = len;
    dataLength = length - checksumSize;
  }
View Full Code Here

   * @param out
   */
  public IFileOutputStream(OutputStream out) {
    super(out);
    sum = DataChecksum.newDataChecksum(DataChecksum.CHECKSUM_CRC32,
        Integer.MAX_VALUE, new PureJavaCrc32());
    barray = new byte[sum.getChecksumSize()];
  }
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.