File tree Expand file tree Collapse file tree
tez-dag/src/main/java/org/apache/tez/dag/app Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020
2121
2222
23+ import java .io .BufferedInputStream ;
2324import java .io .File ;
2425import java .io .FileInputStream ;
2526import java .io .FileNotFoundException ;
@@ -608,17 +609,14 @@ public synchronized void serviceInit(final Configuration conf) throws Exception
608609
609610 if (!versionMismatch ) {
610611 if (isSession ) {
611- FileInputStream sessionResourcesStream = null ;
612- try {
613- sessionResourcesStream = new FileInputStream (
614- new File ( workingDirectory , TezConstants .TEZ_AM_LOCAL_RESOURCES_PB_FILE_NAME ));
612+ try ( BufferedInputStream sessionResourcesStream =
613+ new BufferedInputStream (
614+ new FileInputStream (new File ( workingDirectory ,
615+ TezConstants .TEZ_AM_LOCAL_RESOURCES_PB_FILE_NAME )))) {
615616 PlanLocalResourcesProto amLocalResourceProto = PlanLocalResourcesProto
616617 .parseDelimitedFrom (sessionResourcesStream );
617- amResources .putAll (DagTypeConverters .convertFromPlanLocalResources (amLocalResourceProto ));
618- } finally {
619- if (sessionResourcesStream != null ) {
620- sessionResourcesStream .close ();
621- }
618+ amResources .putAll (DagTypeConverters
619+ .convertFromPlanLocalResources (amLocalResourceProto ));
622620 }
623621 }
624622 }
You can’t perform that action at this time.
0 commit comments