protected TapWith<Properties, InputStream, OutputStream> create( Scheme<Properties, InputStream, OutputStream, ?, ?> scheme, Path path, SinkMode sinkMode ) { try { return Util.newInstance( getClass(), new Object[]{scheme, path, sinkMode} ); } catch( CascadingException exception ) { throw new TapException( "unable to create a new instance of: " + getClass().getName(), exception ); } }
public static <T> T newInstance( String className, Object... parameters ) { try { Class<T> type = (Class<T>) Util.class.getClassLoader().loadClass( className ); return newInstance( type, parameters ); } catch( ClassNotFoundException exception ) { throw new CascadingException( "unable to load class: " + className, exception ); } }
protected TapWith<Configuration, RecordReader, OutputCollector> create( Scheme<Configuration, RecordReader, OutputCollector, ?, ?> scheme, Path path, SinkMode sinkMode ) { try { return Util.newInstance( getClass(), new Object[]{scheme, path, sinkMode} ); } catch( CascadingException exception ) { throw new TapException( "unable to create a new instance of: " + getClass().getName(), exception ); } }
protected TapWith<Configuration, RecordReader, OutputCollector> create( Scheme<Configuration, RecordReader, OutputCollector, ?, ?> scheme, Path path, SinkMode sinkMode ) { try { return Util.newInstance( getClass(), new Object[]{scheme, path, sinkMode} ); } catch( CascadingException exception ) { throw new TapException( "unable to create a new instance of: " + getClass().getName(), exception ); } }
private Tap decorateTap( Pipe pipe, Tap tempTap, String decoratorClassProp, String defaultDecoratorClassName ) { String decoratorClassName = PropertyUtil.getProperty( defaultProperties, pipe, decoratorClassProp ); if( Util.isEmpty( decoratorClassName ) ) decoratorClassName = defaultDecoratorClassName; if( Util.isEmpty( decoratorClassName ) ) return tempTap; LOG.info( "found decorator property: {}, with value: {}, wrapping tap: {}", decoratorClassProp, decoratorClassName, tempTap ); tempTap = Util.newInstance( decoratorClassName, tempTap ); return tempTap; }