本文整理了Java中cascading.flow.Flow.getProperty()
方法的一些代码示例,展示了Flow.getProperty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Flow.getProperty()
方法的具体详情如下:
包路径:cascading.flow.Flow
类名称:Flow
方法名:getProperty
[英]Returns the String property associated with the given key from the current Configuration instance.
[中]从当前配置实例返回与给定键关联的字符串属性。
代码示例来源:origin: cwensel/cascading
@Test
public void testCascadeID() throws IOException
{
String path = "idtest";
Flow first = firstFlow( path + "/first", false );
Flow second = secondFlow( first.getSink(), path + "/second" );
Flow third = thirdFlow( second.getSink(), path + "/third" );
Flow fourth = fourthFlow( third.getSink(), path + "/fourth" );
Cascade cascade = new CascadeConnector( getProperties() ).connect( first, second, third, fourth );
String id = cascade.getID();
assertNotNull( "id is null", id );
assertEquals( first.getProperty( "cascading.cascade.id" ), id );
assertEquals( second.getProperty( "cascading.cascade.id" ), id );
assertEquals( third.getProperty( "cascading.cascade.id" ), id );
assertEquals( fourth.getProperty( "cascading.cascade.id" ), id );
}
代码示例来源:origin: cascading/cascading-platform
@Test
public void testCascadeID() throws IOException
{
String path = "idtest";
Flow first = firstFlow( path + "/first", false );
Flow second = secondFlow( first.getSink(), path + "/second" );
Flow third = thirdFlow( second.getSink(), path + "/third" );
Flow fourth = fourthFlow( third.getSink(), path + "/fourth" );
Cascade cascade = new CascadeConnector( getProperties() ).connect( first, second, third, fourth );
String id = cascade.getID();
assertNotNull( "id is null", id );
assertEquals( first.getProperty( "cascading.cascade.id" ), id );
assertEquals( second.getProperty( "cascading.cascade.id" ), id );
assertEquals( third.getProperty( "cascading.cascade.id" ), id );
assertEquals( fourth.getProperty( "cascading.cascade.id" ), id );
}
代码示例来源:origin: cwensel/cascading
@Test
public void testCopyConfig() throws Exception
{
Tap source = new Lfs( new TextLine(), "input/path" );
Tap sink = new Hfs( new TextLine(), "output/path", SinkMode.REPLACE );
Pipe pipe = new Pipe( "test" );
Configuration conf = ( (BaseHadoopPlatform) getPlatform() ).getConfiguration();
conf.set( AppProps.APP_NAME, "testname" );
AppProps props = AppProps.appProps().setVersion( "1.2.3" );
Properties properties = props.buildProperties( conf ); // convert job conf to properties instance
Flow flow = getPlatform().getFlowConnector( properties ).connect( source, sink, pipe );
assertEquals( "testname", flow.getProperty( AppProps.APP_NAME ) );
assertEquals( "1.2.3", flow.getProperty( AppProps.APP_VERSION ) );
}
代码示例来源:origin: cascading/cascading-hadoop2-common
@Test
public void testCopyConfig() throws Exception
{
Tap source = new Lfs( new TextLine(), "input/path" );
Tap sink = new Hfs( new TextLine(), "output/path", SinkMode.REPLACE );
Pipe pipe = new Pipe( "test" );
Configuration conf = ( (BaseHadoopPlatform) getPlatform() ).getConfiguration();
conf.set( AppProps.APP_NAME, "testname" );
AppProps props = AppProps.appProps().setVersion( "1.2.3" );
Properties properties = props.buildProperties( conf ); // convert job conf to properties instance
Flow flow = getPlatform().getFlowConnector( properties ).connect( source, sink, pipe );
assertEquals( "testname", flow.getProperty( AppProps.APP_NAME ) );
assertEquals( "1.2.3", flow.getProperty( AppProps.APP_VERSION ) );
}
代码示例来源:origin: cwensel/cascading
@Test
public void testFlowID() throws Exception
{
Tap source = new Lfs( new TextLine(), "input/path" );
Tap sink = new Hfs( new TextLine(), "output/path", SinkMode.REPLACE );
Pipe pipe = new Pipe( "test" );
Map<Object, Object> props = getProperties();
Flow flow1 = getPlatform().getFlowConnector( props ).connect( source, sink, pipe );
// System.out.println( "flow.getID() = " + flow1.getID() );
assertNotNull( "missing id", flow1.getID() );
assertNotNull( "missing id in conf", flow1.getProperty( "cascading.flow.id" ) );
Flow flow2 = getPlatform().getFlowConnector( props ).connect( source, sink, pipe );
assertTrue( "same id", !flow1.getID().equalsIgnoreCase( flow2.getID() ) );
}
代码示例来源:origin: cascading/cascading-hadoop2-common
@Test
public void testFlowID() throws Exception
{
Tap source = new Lfs( new TextLine(), "input/path" );
Tap sink = new Hfs( new TextLine(), "output/path", SinkMode.REPLACE );
Pipe pipe = new Pipe( "test" );
Map<Object, Object> props = getProperties();
Flow flow1 = getPlatform().getFlowConnector( props ).connect( source, sink, pipe );
// System.out.println( "flow.getID() = " + flow1.getID() );
assertNotNull( "missing id", flow1.getID() );
assertNotNull( "missing id in conf", flow1.getProperty( "cascading.flow.id" ) );
Flow flow2 = getPlatform().getFlowConnector( props ).connect( source, sink, pipe );
assertTrue( "same id", !flow1.getID().equalsIgnoreCase( flow2.getID() ) );
}
内容来源于网络,如有侵权,请联系作者删除!