/** * Method getProperty returns the value associated with the given key from the underlying properties system. * * @param key of type String * @return String */ public String getProperty( String key ) { return getConfig().get( key ); }
/** * Method getProperty returns the value associated with the given key from the underlying properties system. * * @param key of type String * @return String */ public String getProperty( String key ) { return getConfig().get( key ); }
@Override public Map<Object, Object> getConfigAsProperties() { return HadoopUtil.createProperties( getConfig() ); }
@Override public JobConf getConfigCopy() { return HadoopUtil.copyJobConf( getConfig() ); }
@Override public Map<Object, Object> getConfigAsProperties() { return HadoopUtil.createProperties( getConfig() ); }
@Override public boolean stepsAreLocal() { return HadoopUtil.isLocal( getConfig() ); }
@Override public JobConf getConfigCopy() { return HadoopUtil.copyJobConf( getConfig() ); }
@Override public boolean stepsAreLocal() { return HadoopUtil.isLocal( getConfig() ); }
@Override public FlowProcess<JobConf> getFlowProcess() { return new HadoopFlowProcess( getFlowSession(), getConfig() ); }
@Override public FlowProcess<JobConf> getFlowProcess() { return new HadoopFlowProcess( getFlowSession(), getConfig() ); }
protected int getMaxNumParallelSteps() { return stepsAreLocal() ? 1 : getMaxConcurrentSteps( getConfig() ); }
protected int getMaxNumParallelSteps() { return stepsAreLocal() ? 1 : getMaxConcurrentSteps( getConfig() ); }
@Test public void testNestedProperties() throws IOException { Tap source = new Hfs( new TextLine( new Fields( "line" ) ), "/input" ); Pipe pipe = new Pipe( "test" ); pipe = new Each( pipe, new RegexSplitter( new Fields( "first", "second", "third" ), "\\s" ), Fields.ALL ); Tap sink = new Hfs( new TextLine(), "output", SinkMode.REPLACE ); Properties defaultProperties = new Properties(); defaultProperties.setProperty( "test.key", "test.value" ); HadoopFlow flow = (HadoopFlow) getPlatform().getFlowConnector( new Properties( defaultProperties ) ).connect( source, sink, pipe ); assertEquals( "test flow", "test.value", flow.getProperty( "test.key" ) ); assertEquals( "test step", "test.value", ( (HadoopFlowStep) flow.getFlowSteps().get( 0 ) ).createInitializedConfig( flow.getFlowProcess(), flow.getConfig() ).get( "test.key" ) ); }
@Test public void testNestedProperties() throws IOException { Tap source = new Hfs( new TextLine( new Fields( "line" ) ), "/input" ); Pipe pipe = new Pipe( "test" ); pipe = new Each( pipe, new RegexSplitter( new Fields( "first", "second", "third" ), "\\s" ), Fields.ALL ); Tap sink = new Hfs( new TextLine(), "output", SinkMode.REPLACE ); Properties defaultProperties = new Properties(); defaultProperties.setProperty( "test.key", "test.value" ); HadoopFlow flow = (HadoopFlow) getPlatform().getFlowConnector( new Properties( defaultProperties ) ).connect( source, sink, pipe ); assertEquals( "test flow", "test.value", flow.getProperty( "test.key" ) ); assertEquals( "test step", "test.value", ( (HadoopFlowStep) flow.getFlowSteps().get( 0 ) ).createInitializedConfig( flow.getFlowProcess(), flow.getConfig() ).get( "test.key" ) ); }