Examples of ChecksumException


Examples of org.apache.hadoop.fs.ChecksumException

         
          if (verifyChecksum) {
            checksum.reset();
            checksum.update(buf, 0, len);
            if (!checksum.compare(buf, len)) {
              throw new ChecksumException("Checksum failed at " + offset, len);
            }
          }
        } catch (IOException e) {
          LOG.warn(" Could not read or failed to veirfy checksum for data" +
                   " at offset " + offset + " for block " + block + " got : "
View Full Code Here

Examples of org.apache.hadoop.fs.ChecksumException

          (sum[1] << 16 & 0xff0000) |
          (sum[2] << 8 & 0xff00) |
          sum[3] & 0xff;
        if (calculated != stored) {
          long errPos = basePos + data.position() - startDataPos - n;
          throw new ChecksumException(
              "Checksum error: "+ fileName + " at "+ errPos +
              " exp: " + stored + " got: " + calculated, errPos);
        }
      }
    } finally {
View Full Code Here

Examples of org.apache.hadoop.fs.ChecksumException

        (checksums[checksumsOff + 2] << 8 & 0xff00) |
        checksums[checksumsOff + 3] & 0xff;
      checksumsOff += 4;
      if (calculated != stored) {
        long errPos = basePos + dataPos - n;
        throw new ChecksumException(
            "Checksum error: "+ fileName + " at "+ errPos +
            " exp: " + stored + " got: " + calculated, errPos);
      }
    }
  }
View Full Code Here

Examples of org.apache.hadoop.fs.ChecksumException

          return;
        LOG.info("PROCESSING EVENT: " + synchronizationPoint + " counter: " + simulatedFailure);
        simulatedFailure++;
        if(event == InjectionEvent.INGEST_READ_OP && ((simulatedFailure % 3) == 1)){
          LOG.info("Throwing checksum exception");  
          throw new ChecksumException("Testing checksum exception...", 0);
        }
       
        if(event == InjectionEvent.INGEST_READ_OP && ((simulatedFailure % 7) == 1)){
          LOG.info("Throwing IO exception");
          throw new IOException("Testing IO exception...");
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

  throws IOException {
    if (supportChecksum) {
      int expectedChecksum = rawStream.readInt()// read in checksum
      int calculatedChecksum = (int)checksum.getValue();
      if (expectedChecksum != calculatedChecksum) {
        throw new ChecksumException(
            "Transaction " + tid + " is corrupt.", tid);
      }
    }
  }
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

        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

      public Void answer(InvocationOnMock invocation) throws Throwable {
        if (true) {
          Thread.sleep(hedgedReadTimeoutMillis + sleepMs);
          if (DFSClientFaultInjector.exceptionNum.compareAndSet(0, 1)) {
            System.out.println("-------------- throw Checksum Exception");
            throw new ChecksumException("ChecksumException test", 100);
          }
        }
        return null;
      }
    }).when(injector).fetchFromDatanodeException();
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.