protected void sleepForPollingInterval() { Util.safeSleep( pollingInterval ); }
Util.safeSleep( 500 ); timeout++;
Util.safeSleep( 10 );
flow.start(); Util.safeSleep( 5000 );
@Test public void testFlowLazy() throws IOException { getPlatform().copyFromLocal( inputFileApache ); String outputPath1 = getOutputPath( "flowTest1" ); String outputPath2 = getOutputPath( "flowTest2" ); String outputPath3 = getOutputPath( "flowTest3" ); remove( outputPath1, true ); remove( outputPath2, true ); remove( outputPath3, true ); JobConf defaultConf = (JobConf) ( (BaseHadoopPlatform) getPlatform() ).getConfiguration(); JobConf conf1 = createJob( defaultConf, "mr1", InputData.inputFileApache, outputPath1 ); JobConf conf2 = createJob( defaultConf, "mr2", outputPath1, outputPath2 ); JobConf conf3 = createJob( defaultConf, "mr3", outputPath2, outputPath3 ); validateLength( new Hfs( new TextLine(), InputData.inputFileApache ).openForRead( new HadoopFlowProcess( defaultConf ) ), 10 ); MultiMapReduceFlow flow = new MultiMapReduceFlow( "mrflow", conf1 ); flow.start(); Util.safeSleep( 3000 ); flow.attachFlowStep( conf2 ); Util.safeSleep( 3000 ); flow.attachFlowStep( conf3 ); flow.complete(); validateLength( new Hfs( new TextLine(), outputPath1 ).openForRead( new HadoopFlowProcess( defaultConf ) ), 10 ); Collection<Tap> sinks = flow.getSinks().values(); assertEquals( 1, sinks.size() ); String identifier = sinks.iterator().next().getIdentifier(); assertEquals( "flowTest3", identifier.substring( identifier.lastIndexOf( '/' ) + 1 ) ); }
flow.start(); Util.safeSleep( 5000 );
@Test public void testFlowLazy() throws IOException { getPlatform().copyFromLocal( inputFileApache ); String outputPath1 = getOutputPath( "flowTest1" ); String outputPath2 = getOutputPath( "flowTest2" ); String outputPath3 = getOutputPath( "flowTest3" ); remove( outputPath1, true ); remove( outputPath2, true ); remove( outputPath3, true ); JobConf defaultConf = (JobConf) ( (BaseHadoopPlatform) getPlatform() ).getConfiguration(); JobConf conf1 = createJob( defaultConf, "mr1", InputData.inputFileApache, outputPath1 ); JobConf conf2 = createJob( defaultConf, "mr2", outputPath1, outputPath2 ); JobConf conf3 = createJob( defaultConf, "mr3", outputPath2, outputPath3 ); validateLength( new Hfs( new TextLine(), InputData.inputFileApache ).openForRead( new HadoopFlowProcess( defaultConf ) ), 10 ); MultiMapReduceFlow flow = new MultiMapReduceFlow( "mrflow", conf1 ); flow.start(); Util.safeSleep( 3000 ); flow.attachFlowStep( conf2 ); Util.safeSleep( 3000 ); flow.attachFlowStep( conf3 ); flow.complete(); validateLength( new Hfs( new TextLine(), outputPath1 ).openForRead( new HadoopFlowProcess( defaultConf ) ), 10 ); Collection<Tap> sinks = flow.getSinks().values(); assertEquals( 1, sinks.size() ); String identifier = sinks.iterator().next().getIdentifier(); assertEquals( "flowTest3", identifier.substring( identifier.lastIndexOf( '/' ) + 1 ) ); }
Util.safeSleep( 1000 ); // be safe, delay execution
Util.safeSleep( 1000 ); // be safe, delay execution