|
@@ -2366,11 +2366,7 @@ public class DFSClient implements FSConstants, java.io.Closeable {
|
|
}
|
|
}
|
|
|
|
|
|
synchronized (dataQueue) {
|
|
synchronized (dataQueue) {
|
|
- try {
|
|
|
|
- blockStream.close();
|
|
|
|
- blockReplyStream.close();
|
|
|
|
- } catch (IOException e) {
|
|
|
|
- }
|
|
|
|
|
|
+ IOUtils.cleanup(LOG, blockStream, blockReplyStream);
|
|
nodes = null;
|
|
nodes = null;
|
|
response = null;
|
|
response = null;
|
|
blockStream = null;
|
|
blockStream = null;
|
|
@@ -2513,11 +2509,7 @@ public class DFSClient implements FSConstants, java.io.Closeable {
|
|
}
|
|
}
|
|
|
|
|
|
if (blockStream != null) {
|
|
if (blockStream != null) {
|
|
- try {
|
|
|
|
- blockStream.close();
|
|
|
|
- blockReplyStream.close();
|
|
|
|
- } catch (IOException e) {
|
|
|
|
- }
|
|
|
|
|
|
+ IOUtils.cleanup(LOG, blockStream, blockReplyStream);
|
|
}
|
|
}
|
|
blockStream = null;
|
|
blockStream = null;
|
|
blockReplyStream = null;
|
|
blockReplyStream = null;
|
|
@@ -3248,8 +3240,7 @@ public class DFSClient implements FSConstants, java.io.Closeable {
|
|
synchronized (dataQueue) {
|
|
synchronized (dataQueue) {
|
|
if (blockStream != null) {
|
|
if (blockStream != null) {
|
|
blockStream.writeInt(0); // indicate end-of-block to datanode
|
|
blockStream.writeInt(0); // indicate end-of-block to datanode
|
|
- blockStream.close();
|
|
|
|
- blockReplyStream.close();
|
|
|
|
|
|
+ IOUtils.cleanup(LOG, blockStream, blockReplyStream);
|
|
}
|
|
}
|
|
if (s != null) {
|
|
if (s != null) {
|
|
s.close();
|
|
s.close();
|