A little background:
My program was used to support normal File System, reading Excel file (and do some action with the data) with ExcelDataContext. It was fine for all the action.
Now:
My program has to be modify to support and work together with Hadoop Oozie. Using Metamodel-hadoop 4.3.5 version, I manage to read the excel file from hadoop using HdfsResource. ExcelDataContext able to support Resource and it is fine to do the same job as before.
The Problem:
However, my oozie job workflow was not able to end/complate even after my program has finish running. After a few hours of debugging, I found out it was the issue of using HdfsResource to init ExcelDataContext.
Here is how I define HdfsResource.
...
Resource hdfsResource = new HdfsResource(hdfsExcelFilePath);
ExcelDataContext dc = new ExcelDataContext(hdfsResource, excelConfiguration);
....
If I comment out the hdfsResource line and use local file system, the program is able to complete / end the process without problem.
I suspect the resource was not close / end properly, but I was not able to close / end it even if I set it to NULL. Is there anyway to solve this? There are no close function.
hdfsResource = null;