protected void initialize() throws IOException { tap.sinkConfInit( flowProcess, conf ); OutputFormat outputFormat = asJobConfInstance( conf ).getOutputFormat(); // todo: use OutputCommitter class isFileOutputFormat = outputFormat instanceof FileOutputFormat; if( isFileOutputFormat ) { Hadoop18TapUtil.setupJob( conf ); Hadoop18TapUtil.setupTask( conf ); int partition = conf.getInt( "mapred.task.partition", conf.getInt( "mapreduce.task.partition", 0 ) ); long localSequence = sequence == -1 ? 0 : sequence; if( prefix != null ) filename = String.format( filenamePattern, prefix, "/", partition, localSequence ); else filename = String.format( filenamePattern, "", "", partition, localSequence ); } LOG.info( "creating path: {}", filename ); writer = outputFormat.getRecordWriter( null, asJobConfInstance( conf ), filename, getReporter() ); }
protected void initialize() throws IOException { tap.sinkConfInit( flowProcess, conf ); OutputFormat outputFormat = asJobConfInstance( conf ).getOutputFormat(); // todo: use OutputCommitter class isFileOutputFormat = outputFormat instanceof FileOutputFormat; if( isFileOutputFormat ) { Hadoop18TapUtil.setupJob( conf ); Hadoop18TapUtil.setupTask( conf ); int partition = conf.getInt( "mapred.task.partition", conf.getInt( "mapreduce.task.partition", 0 ) ); long localSequence = sequence == -1 ? 0 : sequence; if( prefix != null ) filename = String.format( filenamePattern, prefix, "/", partition, localSequence ); else filename = String.format( filenamePattern, "", "", partition, localSequence ); } LOG.info( "creating path: {}", filename ); writer = outputFormat.getRecordWriter( null, asJobConfInstance( conf ), filename, getReporter() ); }
writer.close( getReporter() );
writer.close( getReporter() );