@SuppressWarnings("unchecked") @Override public void populateDAG(DAG dag, Configuration conf) { KeyGen keyGen = dag.addOperator("KeyGenerator", new KeyGen()); UniqueValueCount<Integer> valCount = dag.addOperator("ValueCounter", new UniqueValueCount<Integer>()); IntegerUniqueValueCountAppender uniqueUnifier = dag.addOperator("Unique", new IntegerUniqueValueCountAppender()); VerifyTable verifyTable = dag.addOperator("VerifyTable", new VerifyTable()); @SuppressWarnings("rawtypes") DefaultOutputPort valOut = valCount.output; @SuppressWarnings("rawtypes") DefaultOutputPort uniqueOut = uniqueUnifier.output; dag.addStream("DataIn", keyGen.output, valCount.input); dag.addStream("UnifyWindows", valOut, uniqueUnifier.input); dag.addStream("ResultsOut", uniqueOut, verifyTable.input); }
@Override @SuppressWarnings("unchecked") public void populateDAG(DAG dag, Configuration conf) { RandomWordGenerator randomWordGenerator = new RandomWordGenerator(); randomWordGenerator.setTuplesPerWindow(2); dag.addOperator("random", randomWordGenerator); if (maxLength != null) { fsWriter.setMaxLength(maxLength); } fsWriter.setFilePath(testDir.getPath()); dag.addOperator("fswriter", fsWriter); dag.addStream("fswriterstream", randomWordGenerator.output, fsWriter.input); }