Browse Source

[Fix-#3713][common]Fix that catfile method Stream not closed

pull/3/MERGE
lgcareer 4 years ago
parent
commit
268d09de1a
  1. 6
      dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HadoopUtils.java

6
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HadoopUtils.java

@ -226,10 +226,10 @@ public class HadoopUtils implements Closeable {
return new byte[0]; return new byte[0];
} }
FSDataInputStream fsDataInputStream = fs.open(new Path(hdfsFilePath)); try (FSDataInputStream fsDataInputStream = fs.open(new Path(hdfsFilePath))) {
return IOUtils.toByteArray(fsDataInputStream); return IOUtils.toByteArray(fsDataInputStream);
} }
}
/** /**
* cat file on hdfs * cat file on hdfs
@ -493,7 +493,6 @@ public class HadoopUtils implements Closeable {
return String.format("%s/udfs", getHdfsTenantDir(tenantCode)); return String.format("%s/udfs", getHdfsTenantDir(tenantCode));
} }
/** /**
* get hdfs file name * get hdfs file name
* *
@ -545,7 +544,6 @@ public class HadoopUtils implements Closeable {
return String.format("%s/%s", getHdfsDataBasePath(), tenantCode); return String.format("%s/%s", getHdfsDataBasePath(), tenantCode);
} }
/** /**
* getAppAddress * getAppAddress
* *

Loading…
Cancel
Save