/** * Method deleteSinks deletes all sinks, whether or not they are configured for {@link cascading.tap.SinkMode#UPDATE}. * <p> * Use with caution. * * @throws IOException when * @see BaseFlow#deleteSinksIfNotUpdate() */ public void deleteSinks() throws IOException { for( Tap tap : sinks.values() ) deleteOrFail( tap ); }
public void deleteCheckpointsIfNotUpdate() throws IOException { for( Tap tap : checkpoints.values() ) { if( !tap.isUpdate() ) deleteOrFail( tap ); } }
public void deleteTrapsIfReplace() throws IOException { for( Tap tap : traps.values() ) { if( tap.isReplace() ) deleteOrFail( tap ); } }
public void deleteCheckpointsIfReplace() throws IOException { for( Tap tap : checkpoints.values() ) { if( tap.isReplace() ) deleteOrFail( tap ); } }
public void deleteTrapsIfNotUpdate() throws IOException { for( Tap tap : traps.values() ) { if( !tap.isUpdate() ) deleteOrFail( tap ); } }
/** * Method deleteSinksIfNotUpdate deletes all sinks if they are not configured with the {@link cascading.tap.SinkMode#UPDATE} flag. * <p> * Typically used by a {@link Cascade} before executing the flow if the sinks are stale. * <p> * Use with caution. * * @throws IOException when */ public void deleteSinksIfNotUpdate() throws IOException { for( Tap tap : sinks.values() ) { if( !tap.isUpdate() ) deleteOrFail( tap ); } }
/** * Method deleteSinksIfReplace deletes all sinks that are configured with the {@link cascading.tap.SinkMode#REPLACE} flag. * * @throws IOException */ public void deleteSinksIfReplace() throws IOException { // verify all sinks before incrementally deleting for a replace for( Tap tap : sinks.values() ) { if( tap.isKeep() && tap.resourceExists( getConfig() ) ) throw new FlowTapException( "resource exists and sink mode is KEEP, cannot overwrite: " + tap.getFullIdentifier( getFlowProcess() ) ); } for( Tap tap : sinks.values() ) { if( tap.isReplace() ) deleteOrFail( tap ); } }