本文整理了Java中cascading.util.Util.newInstance()
方法的一些代码示例,展示了Util.newInstance()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.newInstance()
方法的具体详情如下:
包路径:cascading.util.Util
类名称:Util
方法名:newInstance
暂无
代码示例来源:origin: cwensel/cascading
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 );
}
}
代码示例来源:origin: cwensel/cascading
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 );
}
}
代码示例来源:origin: cwensel/cascading
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 );
}
}
代码示例来源:origin: cascading/cascading-hadoop2-io
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 );
}
}
代码示例来源:origin: cwensel/cascading
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;
}
内容来源于网络,如有侵权,请联系作者删除!