@Override public boolean commitResource( Config conf ) throws IOException { return parent.commitResource( conf ); }
@Override public boolean commitResource( Config conf ) throws IOException { return original.commitResource( conf ); }
@Override public boolean commitResource( TConfig conf ) throws IOException { return original.commitResource( configProvider.apply( conf ) ); }
@Override public boolean commitResource( Config conf ) throws IOException { for( Tap tap : getTaps() ) { if( !tap.commitResource( conf ) ) return false; } return true; }
private void commitTraps() { // commit all the traps, don't fail on an error for( Tap tap : traps.values() ) { try { if( !tap.commitResource( getConfig() ) ) logError( "unable to commit trap: " + tap.getFullIdentifier( getConfig() ) ); } catch( IOException exception ) { logError( "unable to commit trap: " + tap.getFullIdentifier( getConfig() ), exception ); } } }
private void writeToLocalTap(Tap<?, ?, ?> tap) throws IOException { @SuppressWarnings("unchecked") Tap<Properties, ?, ?> localTap = (Tap<Properties, ?, ?>) tap; Properties conf = new Properties(); LocalFlowProcess flowProcess = new LocalFlowProcess(conf); flowProcess.setStepStats(new LocalStepStats(new NullFlowStep(), NullClientState.INSTANCE)); localTap.sinkConfInit(flowProcess, conf); TupleEntryCollector collector = localTap.openForWrite(flowProcess); for (TupleEntry tuple : data.asTupleEntryList()) { collector.add(tuple); } collector.close(); localTap.commitResource(conf); }
private Throwable commitResource( Tap tap ) { Throwable throwable = null; try { if( !tap.commitResource( getConfig() ) ) { String message = "unable to commit sink: " + tap.getFullIdentifier( getConfig() ); logError( message ); throwable = new FlowException( message ); } } catch( Throwable exception ) { String message = "unable to commit sink: " + tap.getFullIdentifier( getConfig() ); logError( message, exception ); throwable = new FlowException( message, exception ); } return throwable; }