How to Use third party API in hadoop to read files from hdfs if those API uses only local file system path?
===

I have large mbox files and I am using third party API like mstor to parse messages from mbox file using hadoop. I have uploaded those files in hdfs. But the problem is that this API uses only local file system path , similar to shown below

    MessageStoreApi store = new MessageStoreApi(“file location in locl file system”);

I could not find a constructor in this API that would initialize from stream . So I cannot read hdfs stream and initialize it.

Now my question is, should I copy my files from hdfs to  local file system and initialize it from local temporary folder? As thats what I have been doing for now:

Currently My Map function receives path of the mbox files.

    Map(key=path_of_mbox_file in_hdfs, value=null){
    
    String local_temp_file = CopyToLocalFile(path in hdfs);
    MessageStoreApi store = new MessageStoreApi(“local_temp_file”);
    //process file
    
    }

Or Is there some other solution? I am expecting some solution like what If I increase the block-size so that single file fits in one block and somehow if I can get the location of those blocks in my map function, as mostly map functions will execute on the same node where those blocks are stored then I may not have to always download to local file system? But I am not sure if that will always work :)

Suggestions , comments are welcome!  