public void sinkCleanup(FlowProcess<JobConf> flowProcess, SinkCall<Object[], OutputCollector> sinkCall) throws IOException { super.sinkCleanup(flowProcess, sinkCall); sinkCall.setContext(null); }
@Override public void sinkPrepare(FlowProcess<JobConf> flowProcess, SinkCall<Object[], OutputCollector> sinkCall) throws IOException { super.sinkPrepare(flowProcess, sinkCall); Object[] context = new Object[SINK_CTX_SIZE]; // the tuple is fixed, so we can just use a collection/index Settings settings = loadSettings(flowProcess.getConfigCopy(), false); context[SINK_CTX_ALIASES] = CascadingUtils.fieldToAlias(settings, getSinkFields()); sinkCall.setContext(context); }
@Override public void sinkPrepare(FlowProcess<Properties> flowProcess, SinkCall<Object[], Object> sinkCall) throws IOException { super.sinkPrepare(flowProcess, sinkCall); Object[] context = new Object[SINK_CTX_SIZE]; Settings settings = HadoopSettingsManager.loadFrom(flowProcess.getConfigCopy()).merge(props); context[SINK_CTX_ALIASES] = CascadingUtils.fieldToAlias(settings, getSinkFields()); sinkCall.setContext(context); }
@Override public void sinkCleanup( FlowProcess<? extends Properties> flowProcess, SinkCall<PrintWriter, OutputStream> sinkCall ) { sinkCall.getContext().flush(); sinkCall.setContext( null ); }
@Override public void sinkCleanup( FlowProcess<? extends Properties> flowProcess, SinkCall<PrintWriter, OutputStream> sinkCall ) throws IOException { sinkCall.getContext().flush(); sinkCall.setContext( null ); }
@Override public void sinkPrepare( FlowProcess<? extends Configuration> fp, SinkCall<T, OutputCollector> sinkCall ) { sinkCall.setContext(prepareBinaryWritable()); }
public void sinkCleanup(FlowProcess<JobConf> flowProcess, SinkCall<Object[], OutputCollector> sinkCall) throws IOException { super.sinkCleanup(flowProcess, sinkCall); sinkCall.setContext(null); }
@Override public void sinkPrepare( FlowProcess<JobConf> fp, SinkCall<T, OutputCollector> sinkCall ) { sinkCall.setContext(prepareBinaryWritable()); }
@Override public void sinkPrepare( FlowProcess<? extends Configuration> flowProcess, SinkCall<Object[], OutputCollector> sinkCall ) throws IOException { sinkCall.setContext( new Object[ 2 ] ); sinkCall.getContext()[ 0 ] = new Text(); sinkCall.getContext()[ 1 ] = Charset.forName( charsetName ); }
@Override public void sinkPrepare( FlowProcess<? extends Configuration> flowProcess, SinkCall<Object[], OutputCollector> sinkCall ) throws IOException { sinkCall.setContext( new Object[ 2 ] ); sinkCall.getContext()[ 0 ] = new Text(); sinkCall.getContext()[ 1 ] = Charset.forName( charsetName ); }
@Override public void sinkPrepare( FlowProcess<? extends Properties> flowProcess, SinkCall<PrintWriter, OutputStream> sinkCall ) throws IOException { sinkCall.setContext( createOutput( sinkCall.getOutput() ) ); }
@Override public void sinkPrepare( FlowProcess<? extends Configuration> flowProcess, SinkCall<Object[], OutputCollector> sinkCall ) throws IOException { sinkCall.setContext( new Object[ 3 ] ); sinkCall.getContext()[ 0 ] = new Text(); sinkCall.getContext()[ 1 ] = new StringBuilder( 4 * 1024 ); sinkCall.getContext()[ 2 ] = Charset.forName( charsetName ); if( writeHeader ) writeHeader( sinkCall ); }
@Override public void sinkPrepare( FlowProcess<? extends Configuration> flowProcess, SinkCall<Object[], OutputCollector> sinkCall ) throws IOException { sinkCall.setContext( new Object[ 3 ] ); sinkCall.getContext()[ 0 ] = new Text(); sinkCall.getContext()[ 1 ] = new StringBuilder( 4 * 1024 ); sinkCall.getContext()[ 2 ] = Charset.forName( charsetName ); if( writeHeader ) writeHeader( sinkCall ); }
@Override public void sinkPrepare(FlowProcess<JobConf> flowProcess, SinkCall<Object[], OutputCollector> sinkCall) throws IOException { super.sinkPrepare(flowProcess, sinkCall); Object[] context = new Object[SINK_CTX_SIZE]; // the tuple is fixed, so we can just use a collection/index Settings settings = loadSettings(flowProcess.getConfigCopy(), false); context[SINK_CTX_ALIASES] = CascadingUtils.fieldToAlias(settings, getSinkFields()); sinkCall.setContext(context); }
@Override public void sinkPrepare( FlowProcess<? extends Properties> flowProcess, SinkCall<PrintWriter, OutputStream> sinkCall ) { OutputStream originalOutput = sinkCall.getOutput(); sinkCall.setContext( createOutput( originalOutput ) ); if( writeHeader && !isAppendingFile( sinkCall, originalOutput ) ) { Fields fields = sinkCall.getOutgoingEntry().getFields(); delimitedParser.joinFirstLine( fields, sinkCall.getContext() ); sinkCall.getContext().println(); } }
@Override public void sinkPrepare(FlowProcess<Properties> flowProcess, SinkCall<Object[], Object> sinkCall) throws IOException { super.sinkPrepare(flowProcess, sinkCall); Object[] context = new Object[SINK_CTX_SIZE]; Settings settings = HadoopSettingsManager.loadFrom(flowProcess.getConfigCopy()).merge(props); context[SINK_CTX_ALIASES] = CascadingUtils.fieldToAlias(settings, getSinkFields()); sinkCall.setContext(context); }
@Override public void sinkPrepare(FlowProcess<Properties> flowProcess, SinkCall<SolrCollector, OutputStream> sinkCall) throws IOException { if (!(sinkCall.getOutput() instanceof DirectoryFileOutputStream)) { throw new TapException("SolrScheme can only be used with a DirectoryTap in local mode"); } DirectoryFileOutputStream os = (DirectoryFileOutputStream)sinkCall.getOutput(); String path = os.asDirectory(); // Set context to be the embedded solr server (or rather a wrapper for it, that handles caching) // TODO this call gets made BEFORE sinkConfInit, so I don't have the _dataDir set up at this point, which seems wrong. SolrCollector collector = new SolrCollector(flowProcess, getSinkFields(), _solrCoreDir, _maxSegments, _dataDirPropertyName, path); sinkCall.setContext(collector); }