|
@@ -160,9 +160,12 @@ public class NativeAzureFileSystem extends FileSystem {
|
|
|
|
|
|
// open redo file
|
|
|
Path f = redoFile;
|
|
|
- FSDataInputStream input = fs.open(f);
|
|
|
- byte[] bytes = new byte[MAX_RENAME_PENDING_FILE_SIZE];
|
|
|
- int l = input.read(bytes);
|
|
|
+ int l;
|
|
|
+ byte[] bytes;
|
|
|
+ try (FSDataInputStream input = fs.open(f)) {
|
|
|
+ bytes = new byte[MAX_RENAME_PENDING_FILE_SIZE];
|
|
|
+ l = input.read(bytes);
|
|
|
+ }
|
|
|
if (l <= 0) {
|
|
|
// Jira HADOOP-12678 -Handle empty rename pending metadata file during
|
|
|
// atomic rename in redo path. If during renamepending file is created
|