@Override public void setUp() throws Exception { super.setUp(); }
public static <C extends Collection<Tuple>> C asCollection( Flow flow, Tap tap, C collection ) throws IOException { return asCollection( flow, tap, Fields.ALL, collection ); }
public static void validateLength( TupleEntryIterator iterator, int numTuples, int tupleSize, Pattern regex ) { int count = 0; while( iterator.hasNext() ) { TupleEntry tupleEntry = iterator.next(); if( tupleSize != -1 ) assertEquals( "wrong number of elements", tupleSize, tupleEntry.size() ); if( regex != null ) assertTrue( "regex: " + regex + " does not match: " + tupleEntry.getTuple().toString(), regex.matcher( tupleEntry.getTuple().toString() ).matches() ); count++; } try { iterator.close(); } catch( IOException exception ) { throw new RuntimeException( exception ); } assertEquals( "wrong number of lines", numTuples, count ); }
protected String getOutputPath() { if( outputPath == null ) outputPath = Util.join( getOutputPathElements(), File.separator ); return outputPath; }
protected String getPlanPath() { if( planPath == null ) planPath = Util.join( getPlanPathElements(), File.separator ); return planPath; }
@Override @Before public void setUp() throws Exception { super.setUp(); if( Boolean.getBoolean( TEST_TRACEPLAN_ENABLED ) ) { System.setProperty( FlowPlanner.TRACE_PLAN_PATH, Util.join( "/", getPlanPath(), "planner" ) ); System.setProperty( FlowPlanner.TRACE_PLAN_TRANSFORM_PATH, Util.join( "/", getPlanPath(), "planner" ) ); System.setProperty( FlowPlanner.TRACE_STATS_PATH, Util.join( "/", getPlanPath(), "planner" ) ); System.setProperty( "platform." + StreamGraph.DOT_FILE_PATH, Util.join( "/", getPlanPath(), "stream" ) ); // pass down } }
@Override public void setUp() throws Exception { super.setUp(); operationCall = new ConcreteCall(); }
public static Set<Tuple> asSet( Flow flow, Tap tap ) throws IOException { return asCollection( flow, tap, Fields.ALL, new HashSet<Tuple>() ); }
@Override public void setUp() throws Exception { super.setUp(); operationCall = new ConcreteCall(); }
public static List<Tuple> asList( Flow flow, Tap tap ) throws IOException { return asCollection( flow, tap, Fields.ALL, new ArrayList<Tuple>() ); }
@Override public void setUp() throws Exception { Logging.setLogLevel( this.getClass(), "cascading.pattern", "debug" ); super.setUp(); }
public static List<Tuple> asList( Flow flow, Tap tap, Fields selector ) throws IOException { return asCollection( flow, tap, selector, new ArrayList<Tuple>() ); }
@Before public void setUp() throws Exception { super.setUp(); getPlatform().setUp(); }
public static Set<Tuple> asSet( Flow flow, Tap tap, Fields selector ) throws IOException { return asCollection( flow, tap, selector, new HashSet<Tuple>() ); }
@Before public void setUp() throws Exception { super.setUp(); getPlatform().setUp(); }
public static <C extends Collection<Tuple>> C asCollection( Flow flow, Tap tap, Fields selector, C collection ) throws IOException { try( TupleEntryIterator iterator = flow.openTapForRead( tap ) ) { return asCollection( iterator, selector, collection ); } }
@Override public void setUp() throws Exception { super.setUp(); tuple = new Tuple(); tuple.add( "a" ); tuple.add( "b" ); tuple.add( "c" ); tuple.add( "d" ); tuple.add( "d" ); }
public static List<Tuple> getSourceAsList( Flow flow ) throws IOException { return asCollection( flow, (Tap) flow.getSourcesCollection().iterator().next(), Fields.ALL, new ArrayList<Tuple>() ); }
@Override public void setUp() throws Exception { Logging.setLogLevel( this.getClass(), "cascading.pattern", "debug" ); super.setUp(); expectedFields = Fields.NONE .append( new Fields( "var0", double.class ) ) .append( new Fields( "var1", String.class ) ) .append( new Fields( "var2", double.class ) ); Tuple tuple = new Tuple( 0.d, "value", null ); tupleEntry = new TupleEntry( expectedFields, tuple ); }
public static List<Tuple> getSinkAsList( Flow flow ) throws IOException { return asCollection( flow, flow.getSink(), Fields.ALL, new ArrayList<Tuple>() ); }