HBASE-22476 FSDataInputStream is not closed. (#263)
HBASE-22476 HBase-backup module's class "org.apache.hadoop.hbase.backup.impl.BackupManifest" FSDataInputStream is not close. Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
parent
1be93fcaec
commit
2823090ce4
|
@ -434,10 +434,13 @@ public class BackupManifest {
|
|||
for (FileStatus subFile : subFiles) {
|
||||
if (subFile.getPath().getName().equals(MANIFEST_FILE_NAME)) {
|
||||
// load and set manifest field from file content
|
||||
FSDataInputStream in = fs.open(subFile.getPath());
|
||||
long len = subFile.getLen();
|
||||
byte[] pbBytes = new byte[(int) len];
|
||||
in.readFully(pbBytes);
|
||||
try (FSDataInputStream in = fs.open(subFile.getPath())) {
|
||||
in.readFully(pbBytes);
|
||||
} catch (IOException e) {
|
||||
throw new BackupException(e.getMessage());
|
||||
}
|
||||
BackupProtos.BackupImage proto = null;
|
||||
try {
|
||||
proto = BackupProtos.BackupImage.parseFrom(pbBytes);
|
||||
|
|
Loading…
Reference in New Issue