[ 
https://issues.apache.org/jira/browse/FLINK-2394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14640007#comment-14640007
 ] 

Stefano Bortoli commented on FLINK-2394:
----------------------------------------

I see. I was in fact a little disappointed with mongo-hadoop for having a 
method getOutputCommitter() which was not standard in the OutputFormat. 
However, my first implementation was using the mapred Hadoop, so no big 
surprises.

I would say that a good idea could be to simply have either 2 
HadoopOutputFormatBase classes (1 per version of Hadoop), or handle the hadoop 
version to get the OutputCommitter accordingly.

Meanwhile, I have implemented my own MongoHadoopOutputFormat extending the 
HadoopOutputFormat and overriding the open and close methods replacing the 
FileOutputCommitter with the MongoOutputCommiter. 

> HadoopOutFormat OutputCommitter is default to FileOutputCommiter
> ----------------------------------------------------------------
>
>                 Key: FLINK-2394
>                 URL: https://issues.apache.org/jira/browse/FLINK-2394
>             Project: Flink
>          Issue Type: Bug
>          Components: Hadoop Compatibility
>    Affects Versions: 0.9.0
>            Reporter: Stefano Bortoli
>
> MongoOutputFormat does not write back in collection because the 
> HadoopOutputFormat wrapper does not allow to set the MongoOutputCommiter and 
> is set as default to FileOutputCommitter. Therefore, on close and 
> globalFinalize execution the commit does not happen and mongo collection 
> stays untouched. 
> A simple solution would be to:
> 1 - create a constructor of HadoopOutputFormatBase and HadoopOutputFormat 
> that gets the OutputCommitter as a parameter
> 2 - change the outputCommitter field of HadoopOutputFormatBase to be a 
> generic OutputCommitter
> 3 - remove the default assignment in the open() and finalizeGlobal to the 
> outputCommitter to FileOutputCommitter(), or keep it as a default in case of 
> no specific assignment.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to