Package org.apache.hadoop.raid.Decoder

Examples of org.apache.hadoop.raid.Decoder.DecoderInputStream


         
          try {
            int idx = nextLocation++;
            Codec codec = Codec.getCodecs().get(idx);
           
            DecoderInputStream recoveryStream =
                RaidNode.unRaidCorruptInputStream(innerConf, path,
                codec, parityFilePairs.get(idx), blockSize, offset, limit);
           
            if (null != recoveryStream) {
              return recoveryStream;
View Full Code Here


            if (!parityFilePairs.containsKey(codec.id)) {
              parityFilePairs.put(codec.id, ParityFilePair.getParityFile(codec,
                  srcStat, this.innerConf));
            }
           
            DecoderInputStream recoveryStream =
                RaidNode.unRaidCorruptInputStream(innerConf, path,
                codec, parityFilePairs.get(codec.id), lostBlock.getBlock(),
                blockSize, offset, limit, false);
           
            if (null != recoveryStream) {
              return recoveryStream;
            }
           
          } catch (Exception e) {
            LOG.info("Ignoring error in using alternate path " + path, e);
          }
        }
        // Second look up in the stripe store for dir-raid
        nextLocation = oldNextLocation;
        while (nextLocation < Codec.getCodecs().size()) {
          try {
            int idx = nextLocation++;
            Codec codec = Codec.getCodecs().get(idx);
            if (!codec.isDirRaid)
              continue;
            DecoderInputStream recoveryStream =
                RaidNode.unRaidCorruptInputStream(innerConf, path,
                codec, parityFilePairs.get(idx), lostBlock.getBlock(),
                blockSize, offset, limit, true);
           
            if (null != recoveryStream) {
View Full Code Here

        // calculate the oldCRC.
        CRC32 oldCrc = new CRC32();
        oldCrc.update(buffer);
       
        CRC32 newCrc = new CRC32();
        DecoderInputStream stream = decoder.new DecoderInputStream(
            RaidUtils.NULL_PROGRESSABLE, limit, stat.getBlockSize(), errorOffset,
            srcFs, srcPath, parityFs, parityPath, null, null, false);
        try {
          stream.read(buffer);
          newCrc.update(buffer);
          if (oldCrc.getValue() != newCrc.getValue()) {
            LogUtils.logFileCheckMetrics(LOGRESULTS.FAILURE, codec, srcPath,
                srcFs, errorOffset, limit, null, reporter);
            LOG.error("mismatch crc, old " + oldCrc.getValue() +
                ", new " + newCrc.getValue() + ", for file: " + srcPath
                + " at offset " + errorOffset + ", read limit " + limit);
            return false;
          }
        } finally {
          reporter.progress();
          if (stream != null) {
            stream.close();
          }
        }
      }
      return true;
    } finally {
View Full Code Here

TOP

Related Classes of org.apache.hadoop.raid.Decoder.DecoderInputStream

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.