1
0

Close FSDataInputStream for meta file open in HoodiePartitionMetadata

This commit is contained in:
Bhavani Sudha Saktheeswaran
2019-02-13 12:54:01 -08:00
committed by vinoth chandar
parent 8dddecf00f
commit 639c287cab
2 changed files with 9 additions and 3 deletions

View File

@@ -120,14 +120,19 @@ public class HoodiePartitionMetadata {
/**
* Read out the metadata for this partition
*/
public void readFromFS() {
public void readFromFS() throws IOException {
FSDataInputStream is = null;
try {
Path metaFile = new Path(partitionPath, HOODIE_PARTITION_METAFILE);
FSDataInputStream is = fs.open(metaFile);
is = fs.open(metaFile);
props.load(is);
} catch (IOException ioe) {
throw new HoodieException("Error reading Hoodie partition metadata for " + partitionPath,
ioe);
} finally {
if (is != null) {
is.close();
}
}
}