/** * @return the FileInputStream for the meta data of the given block. * @throws FileNotFoundException * if the file not found. * @throws ClassCastException * if the underlying input stream is not a FileInputStream. */ public static FileInputStream getMetaDataInputStream( ExtendedBlock b, FsDatasetSpi<?> data) throws IOException { final LengthInputStream lin = data.getMetaDataInputStream(b); if (lin == null) { throw new FileNotFoundException("Meta file for " + b + " not found."); } return (FileInputStream)lin.getWrappedStream(); } }
BlockChecksumComputer(DataNode datanode, ExtendedBlock block, BlockChecksumOptions blockChecksumOptions) throws IOException { super(datanode, blockChecksumOptions); this.block = block; this.requestLength = block.getNumBytes(); Preconditions.checkArgument(requestLength >= 0); this.metadataIn = datanode.data.getMetaDataInputStream(block); this.visibleLength = datanode.data.getReplicaVisibleLength(block); this.partialBlk = requestLength < visibleLength; int ioFileBufferSize = DFSUtilClient.getIoFileBufferSize(datanode.getConf()); this.checksumIn = new DataInputStream( new BufferedInputStream(metadataIn, ioFileBufferSize)); }
try { DataNodeFaultInjector.get().throwTooManyOpenFiles(); metaIn = datanode.data.getMetaDataInputStream(block); if (!corruptChecksumOk || metaIn != null) { if (metaIn == null) {
/** * @return the FileInputStream for the meta data of the given block. * @throws FileNotFoundException * if the file not found. * @throws ClassCastException * if the underlying input stream is not a FileInputStream. */ public static FileInputStream getMetaDataInputStream( ExtendedBlock b, FsDatasetSpi<?> data) throws IOException { final LengthInputStream lin = data.getMetaDataInputStream(b); if (lin == null) { throw new FileNotFoundException("Meta file for " + b + " not found."); } return (FileInputStream)lin.getWrappedStream(); } }
/** * @return the FileInputStream for the meta data of the given block. * @throws FileNotFoundException * if the file not found. * @throws ClassCastException * if the underlying input stream is not a FileInputStream. */ public static FileInputStream getMetaDataInputStream( ExtendedBlock b, FsDatasetSpi<?> data) throws IOException { final LengthInputStream lin = data.getMetaDataInputStream(b); if (lin == null) { throw new FileNotFoundException("Meta file for " + b + " not found."); } return (FileInputStream)lin.getWrappedStream(); } }
boolean keepMetaInOpen = false; try { metaIn = datanode.data.getMetaDataInputStream(block); if (!corruptChecksumOk || metaIn != null) { if (metaIn == null) {
boolean keepMetaInOpen = false; try { metaIn = datanode.data.getMetaDataInputStream(block); if (!corruptChecksumOk || metaIn != null) { if (metaIn == null) {