public void loadLastPartialChunkChecksum() throws IOException { byte[] lastChecksum = getVolume().loadLastPartialChunkChecksum( getBlockFile(), getMetaFile()); setLastPartialChunkChecksum(lastChecksum); } }
/** * gets the last chunk checksum and the length of the block corresponding * to that checksum. * Note, need to be called with the FsDataset lock acquired. May improve to * lock only the FsVolume in the future. * @throws IOException */ public ChunkChecksum getLastChecksumAndDataLen() throws IOException { ChunkChecksum chunkChecksum = null; try { byte[] lastChecksum = getVolume().loadLastPartialChunkChecksum( getBlockFile(), getMetaFile()); if (lastChecksum != null) { chunkChecksum = new ChunkChecksum(getVisibleLength(), lastChecksum); } } catch (FileNotFoundException e) { // meta file is lost. Try to continue anyway. DataNode.LOG.warn("meta file " + getMetaFile() + " is missing!"); } catch (IOException ioe) { DataNode.LOG.warn("Unable to read checksum from meta file " + getMetaFile(), ioe); } return chunkChecksum; } }
/** * gets the last chunk checksum and the length of the block corresponding * to that checksum. * Note, need to be called with the FsDataset lock acquired. May improve to * lock only the FsVolume in the future. * @throws IOException */ public ChunkChecksum getLastChecksumAndDataLen() throws IOException { ChunkChecksum chunkChecksum = null; try { byte[] lastChecksum = getVolume().loadLastPartialChunkChecksum( getBlockFile(), getMetaFile()); if (lastChecksum != null) { chunkChecksum = new ChunkChecksum(getVisibleLength(), lastChecksum); } } catch (FileNotFoundException e) { // meta file is lost. Try to continue anyway. DataNode.LOG.warn("meta file " + getMetaFile() + " is missing!"); } catch (IOException ioe) { DataNode.LOG.warn("Unable to read checksum from meta file " + getMetaFile(), ioe); } return chunkChecksum; } }