@Test public void testPipeConfigDef() throws IOException { getPlatform().copyFromLocal( inputFileNums20 ); Tap source = getPlatform().getTextFile( new Fields( "line" ), inputFileNums20 ); Pipe pipe = new Pipe( "test" ); pipe = new Each( pipe, new IterateInsert( new Fields( "value" ), getPlatform().isDAG() ), Fields.ALL ); pipe.getConfigDef().setProperty( Mode.DEFAULT, "default", "pipe-default" ); // steps on above value pipe.getStepConfigDef().setProperty( Mode.DEFAULT, "default", "process-default" ); pipe.getConfigDef().setProperty( Mode.DEFAULT, "replace", "pipe-default" ); pipe.getConfigDef().setProperty( Mode.REPLACE, "replace", "pipe-replace" ); pipe.getNodeConfigDef().setProperty( Mode.REPLACE, "default-node", "node-replace" ); pipe.getStepConfigDef().setProperty( Mode.DEFAULT, "replace", "process-default" ); pipe.getStepConfigDef().setProperty( Mode.REPLACE, "replace", "process-replace" ); pipe.getStepConfigDef().setProperty( Mode.DEFAULT, "default-node", "process-default" ); Tap sink = getPlatform().getTextFile( getOutputPath( "configdef" ), SinkMode.REPLACE ); Flow flow = getPlatform().getFlowConnector().connect( source, sink, pipe ); flow.complete(); assertTrue( flow.resourceExists( sink ) ); }
@Test public void testPipeConfigDef() throws IOException { getPlatform().copyFromLocal( inputFileNums20 ); Tap source = getPlatform().getTextFile( new Fields( "line" ), inputFileNums20 ); Pipe pipe = new Pipe( "test" ); pipe = new Each( pipe, new IterateInsert( new Fields( "value" ), getPlatform().isDAG() ), Fields.ALL ); pipe.getConfigDef().setProperty( Mode.DEFAULT, "default", "pipe-default" ); // steps on above value pipe.getStepConfigDef().setProperty( Mode.DEFAULT, "default", "process-default" ); pipe.getConfigDef().setProperty( Mode.DEFAULT, "replace", "pipe-default" ); pipe.getConfigDef().setProperty( Mode.REPLACE, "replace", "pipe-replace" ); pipe.getNodeConfigDef().setProperty( Mode.REPLACE, "default-node", "node-replace" ); pipe.getStepConfigDef().setProperty( Mode.DEFAULT, "replace", "process-default" ); pipe.getStepConfigDef().setProperty( Mode.REPLACE, "replace", "process-replace" ); pipe.getStepConfigDef().setProperty( Mode.DEFAULT, "default-node", "process-default" ); Tap sink = getPlatform().getTextFile( getOutputPath( "configdef" ), SinkMode.REPLACE ); Flow flow = getPlatform().getFlowConnector().connect( source, sink, pipe ); flow.complete(); assertTrue( flow.resourceExists( sink ) ); }
public ConfigSubAssembly( Pipe pipe, boolean supportsNodeConfig ) { super( pipe ); pipe = new Each( pipe, new IterateInsert( new Fields( "value" ), supportsNodeConfig ), Fields.ALL ); setTails( pipe ); } }
public ConfigSubAssembly( Pipe pipe, boolean supportsNodeConfig ) { super( pipe ); pipe = new Each( pipe, new IterateInsert( new Fields( "value" ), supportsNodeConfig ), Fields.ALL ); setTails( pipe ); } }