Examples of DecoderInputStream


Examples of org.adbcj.support.DecoderInputStream

  }

  @Override
  protected Object decode(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer) throws Exception {
     InputStream in = new ChannelBufferInputStream(buffer);
     DecoderInputStream dis = new DecoderInputStream(in);
     try {
       return decoder.decode(dis, false);
     } finally {
       dis.close();
     }
  }
View Full Code Here

Examples of org.adbcj.support.DecoderInputStream

    }
    return out;
  }

  public static DecoderInputStream stream(String data) {
    return new DecoderInputStream(new ByteArrayInputStream(decodeHex(data)));
  }
View Full Code Here

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

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

            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

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

        // 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
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.