/** * Constructor DirTap creates a new DirTap instance using the given {@link cascading.scheme.Scheme} and file {@code directory}. * * @param scheme of type Scheme * @param directory of type String */ public DirTap( Scheme<Properties, InputStream, OutputStream, ?, ?> scheme, String directory ) { super( scheme, directory ); verify(); }
/** * Only used with {@link #openForWrite(FlowProcess, OutputStream)} calls. * * @param flowProcess */ protected String getOutputIdentifier( FlowProcess<? extends Properties> flowProcess ) { return getIdentifier(); }
@Override public TapWith<Properties, InputStream, OutputStream> withScheme( Scheme<Properties, InputStream, OutputStream, ?, ?> scheme ) { return create( scheme, getPath(), getSinkMode() ); }
@Override protected Tap newTap( Scheme scheme, String identifier, SinkMode mode ) { return new FileTap( scheme, identifier, mode ); }
@Override public boolean deleteResource( Properties conf ) throws IOException { String[] childIdentifiers = ( (FileTap) parent ).getChildIdentifiers( conf, Integer.MAX_VALUE, false ); if( childIdentifiers.length == 0 ) return deleteParent( conf ); DirTap.deleteChildren( Paths.get( parent.getIdentifier() ), childIdentifiers ); return deleteParent( conf ); }
protected void verify() { super.verify(); if( maxDepth < 0 ) throw new IllegalArgumentException( "maxDepth must be greater than 0, given: " + maxDepth ); try { getPathMatcher(); } catch( RuntimeException exception ) { throw new IllegalArgumentException( "could not parse pattern: " + getPattern(), exception ); } }
@Override public boolean deleteResource( Properties conf ) throws IOException { return deleteDirTap( this, conf ); }
@Override public String[] getChildIdentifiers( Properties conf ) throws IOException { return getChildIdentifiers( conf, 1, false ); }
/** * Constructor FileTap creates a new FileTap instance using the given {@link cascading.scheme.Scheme}, * file {@code path}, and {@code SinkMode}. * * @param scheme of type Scheme * @param path of type String * @param sinkMode of type SinkMode */ public FileTap( Scheme<Properties, InputStream, OutputStream, ?, ?> scheme, Path path, SinkMode sinkMode ) { super( scheme, sinkMode ); this.path = path; verify(); }
@Override public Tap getPartitionTap( Tap sink, Partition partition, int openThreshold ) { return new PartitionTap( (FileTap) sink, partition, openThreshold ); }
@Override public Tap getTap( Scheme scheme, String filename, SinkMode mode ) { return new FileTap( scheme, filename, mode ); }
/** * Constructor DirTap creates a new DirTap instance using the given {@link cascading.scheme.Scheme} and file {@code directory}. * * @param scheme of type Scheme * @param directory of type Path */ public DirTap( Scheme<Properties, InputStream, OutputStream, ?, ?> scheme, Path directory ) { super( scheme, directory ); verify(); }
/** * Constructor DirTap creates a new DirTap instance using the given {@link cascading.scheme.Scheme} and file {@code directory}. * * @param scheme of type Scheme * @param directory of type String * @param sinkMode of type SinkMode */ public DirTap( Scheme<Properties, InputStream, OutputStream, ?, ?> scheme, String directory, SinkMode sinkMode ) { super( scheme, directory, sinkMode ); verify(); }
/** * Constructor DirTap creates a new DirTap instance using the given {@link cascading.scheme.Scheme} and file {@code directory}. * * @param scheme of type Scheme * @param directory of type Path * @param sinkMode of type SinkMode */ public DirTap( Scheme<Properties, InputStream, OutputStream, ?, ?> scheme, Path directory, SinkMode sinkMode ) { super( scheme, directory, sinkMode ); verify(); }
/** * Constructor DirTap creates a new DirTap instance using the given {@link cascading.scheme.Scheme}, file {@code directory}, * and {@code pattern}. * * @param scheme of type Scheme * @param directory of type String * @param pattern of type String */ public DirTap( Scheme<Properties, InputStream, OutputStream, ?, ?> scheme, String directory, String pattern ) { super( scheme, directory ); this.pattern = pattern; verify(); }
/** * Constructor DirTap creates a new DirTap instance using the given {@link cascading.scheme.Scheme}, file {@code directory}, * and {@code pattern}. * * @param scheme of type Scheme * @param directory of type Path * @param pattern of type String */ public DirTap( Scheme<Properties, InputStream, OutputStream, ?, ?> scheme, Path directory, String pattern ) { super( scheme, directory ); this.pattern = pattern; verify(); }
/** * Constructor DirTap creates a new DirTap instance using the given {@link cascading.scheme.Scheme}, file {@code directory}, * {@code pattern}, and {@code maxDepth} * * @param scheme of type Scheme * @param directory of type String * @param pattern of type String * @param maxDepth of type int */ public DirTap( Scheme<Properties, InputStream, OutputStream, ?, ?> scheme, String directory, String pattern, int maxDepth ) { super( scheme, directory ); this.maxDepth = maxDepth; this.pattern = pattern; verify(); }
/** * Constructor DirTap creates a new DirTap instance using the given {@link cascading.scheme.Scheme}, file {@code directory}, * and {@code pattern}. * * @param scheme of type Scheme * @param directory of type Path * @param pattern of type String * @param sinkMode of type SinkMode */ public DirTap( Scheme<Properties, InputStream, OutputStream, ?, ?> scheme, Path directory, String pattern, SinkMode sinkMode ) { super( scheme, directory, sinkMode ); this.pattern = pattern; verify(); }
/** * Constructor DirTap creates a new DirTap instance using the given {@link cascading.scheme.Scheme}, file {@code directory}, * and {@code pattern}. * * @param scheme of type Scheme * @param directory of type String * @param pattern of type String * @param sinkMode of type SinkMode */ public DirTap( Scheme<Properties, InputStream, OutputStream, ?, ?> scheme, String directory, String pattern, SinkMode sinkMode ) { super( scheme, directory, sinkMode ); this.pattern = pattern; verify(); }