Examples of ChecksumException


Examples of org.apache.hadoop.fs.ChecksumException

    while ((read = inputStream.read(buf)) > -1) {
      LOG.info(String.format("read %d bytes", read));

      if (!validateSequentialBytes(buf, (int) (startPos + numRead), read)) {
        LOG.error(String.format("invalid bytes: [%s]\n", Arrays.toString(buf)));
        throw new ChecksumException(
          String.format("unable to validate bytes"),
          startPos
        );
      }
View Full Code Here

Examples of org.apache.hadoop.fs.ChecksumException

        for (int i=0; i<numChunks; i++) {
          checksum.reset();
          int dLen = Math.min(dLeft, bytesPerChecksum);
          checksum.update(buf, dOff, dLen);
          if (!checksum.compare(buf, cOff)) {
            throw new ChecksumException("Checksum failed at " +
                                        (offset + len - dLeft), len);
          }
          dLeft -= dLen;
          dOff += dLen;
          cOff += checksumSize;
View Full Code Here

Examples of org.apache.hadoop.fs.ChecksumException

          checksum.reset();
          int dLen = Math.min(dLeft, bytesPerChecksum);
          checksum.update(buf, dOff, dLen);
          if (!checksum.compare(buf, cOff)) {
            long failedPos = offset + len -dLeft;
            throw new ChecksumException("Checksum failed at " +
                                        failedPos, failedPos);
          }
          dLeft -= dLen;
          dOff += dLen;
          cOff += checksumSize;
View Full Code Here

Examples of org.apache.hadoop.fs.ChecksumException

    while ((read = inputStream.read(buf)) > -1) {
      LOG.info(String.format("read %d bytes", read));

      if (!validateSequentialBytes(buf, (int) (startPos + numRead), read)) {
        LOG.error(String.format("invalid bytes: [%s]\n", Arrays.toString(buf)));
        throw new ChecksumException(
          String.format("unable to validate bytes"),
          startPos
        );
      }
View Full Code Here

Examples of org.apache.hadoop.fs.ChecksumException

      if (crc != null) {
        crc.reset();
        CheckedInputStream chk = new CheckedInputStream(in, crc);
        IOUtils.readFully(chk, buf.array(), 0, size);
        if (chk.getChecksum().getValue() != in.readLong()) {
          throw new ChecksumException("Checksum error reading spill index: " +
                                indexFileName, -1);
        }
      } else {
        IOUtils.readFully(in, buf.array(), 0, size);
      }
View Full Code Here

Examples of org.apache.hadoop.fs.ChecksumException

        throws IOException {
      if (checksum != null) {
        int calculatedChecksum = (int)checksum.getValue();
        int readChecksum = in.readInt(); // read in checksum
        if (readChecksum != calculatedChecksum) {
          throw new ChecksumException(
              "Transaction is corrupt. Calculated checksum is " +
              calculatedChecksum + " but read checksum " + readChecksum, txid);
        }
      }
    }
View Full Code Here

Examples of org.apache.hadoop.fs.ChecksumException

      checksum.reset();
      int dLen = Math.min(dLeft, chunkSize);
      checksum.update(buf, dOff, dLen);
      if (!checksum.compare(buf, cOff)) {
        long failedPos = offset + datalen - dLeft;
        throw new ChecksumException("Checksum failed at " + failedPos,
            failedPos);
      }
      dLeft -= dLen;
      dOff += dLen;
      cOff += checksumSize;
View Full Code Here

Examples of org.apache.hadoop.fs.ChecksumException

      checksum.reset();
      int dLen = Math.min(dLeft, chunkSize);
      checksum.update(buf, dOff, dLen);
      if (!checksum.compare(buf, cOff)) {
        long failedPos = offset + datalen - dLeft;
        throw new ChecksumException("Checksum failed at " + failedPos,
            failedPos);
      }
      dLeft -= dLen;
      dOff += dLen;
      cOff += checksumSize;
View Full Code Here

Examples of se.despotify.client.protocol.command.ChecksumException

    }
    /* Create and return playlist. */
    Playlist.fromXMLElement(playlistElement, store, playlist);

    if (playlist.getTracks() != null && playlist.getChecksum() != playlist.calculateChecksum()) {
      throw new ChecksumException(playlist.getChecksum(), playlist.calculateChecksum());
    }

    return true;


View Full Code Here

Examples of se.despotify.client.protocol.command.ChecksumException

    if (playlists.getItems().size() != Long.parseLong(versionTagValues[1])) {
      throw new RuntimeException("Size missmatch");
    }

    if (playlists.calculateChecksum() != playlists.getChecksum()) {
      throw new ChecksumException(playlists.calculateChecksum(), playlists.getChecksum());
    }
    if (playlist.isCollaborative() != (Integer.parseInt(versionTagValues[3]) == 1)) {
      throw new RuntimeException("Collaborative flag missmatch");
    }
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.