Package com.asakusafw.compiler.flow.testing.model

Examples of com.asakusafw.compiler.flow.testing.model.Ex1


            assertThat(ex1.getValueOption(), is(new IntOption(value)));
        }
    }

    private void writeTestData(ModelOutput<Ex1> source) throws IOException {
        Ex1 value = new Ex1();
        source.write(value);
        value.setSid(1);
        source.write(value);
        value.setSid(2);
        source.write(value);
        value.setSid(3);
        source.write(value);
        value.setSid(4);
        source.write(value);
        value.setSid(5);
        source.write(value);
        value.setSid(6);
        source.write(value);
        value.setSid(7);
        source.write(value);
        value.setSid(8);
        source.write(value);
        value.setSid(9);
        source.write(value);
    }
View Full Code Here


    @Test
    public void mapOnly() throws Exception {
        TestInput<Ex1> in = tester.input(Ex1.class, "ex1");
        TestOutput<Ex1> out = tester.output(Ex1.class, "ex1");

        Ex1 ex1 = new Ex1();
        ex1.setSid(1);
        ex1.setValue(10);
        in.add(ex1);

        FlowDescription flow = new NoShuffleStage(in.flow(), out.flow());
        assertThat(tester.runFlow(flow), is(true));
View Full Code Here

    @Test
    public void withReduce() throws Exception {
        TestInput<Ex1> in = tester.input(Ex1.class, "ex1");
        TestOutput<ExSummarized> out = tester.output(ExSummarized.class, "exs");

        Ex1 ex1 = new Ex1();
        ex1.setStringAsString("group-1");
        ex1.setValue(10);
        in.add(ex1);
        ex1.setValue(20);
        in.add(ex1);
        ex1.setValue(30);
        in.add(ex1);
        ex1.setStringAsString("group-2");
        ex1.setValue(40);
        in.add(ex1);
        ex1.setValue(50);
        in.add(ex1);

        FlowDescription flow = new SimpleShuffleStage(in.flow(), out.flow());
        assertThat(tester.runFlow(flow), is(true));
View Full Code Here

        TestInput<Ex1> mst = tester.input(Ex1.class, "mst", DataSize.TINY);
        TestInput<Ex1> in1 = tester.input(Ex1.class, "in1");
        TestInput<Ex1> in2 = tester.input(Ex1.class, "in2");
        TestOutput<ExJoined> out = tester.output(ExJoined.class, "out");

        Ex1 dMst = new Ex1();
        dMst.setSid(1);
        dMst.setValue(10);
        mst.add(dMst);

        Ex1 dIn1 = new Ex1();
        dIn1.setSid(2);
        dIn1.setValue(10);
        in1.add(dIn1);

        Ex1 dIn2 = new Ex1();
        dIn2.setSid(3);
        dIn2.setValue(10);
        in2.add(dIn2);

        final In<Ex1> pMst = mst.flow();
        final In<Ex1> pIn1 = in1.flow();
        final In<Ex1> pIn2 = in2.flow();
View Full Code Here

                DirectFlowCompiler.toLibraryPath(Ex1.class),
        });
        TestInput<Ex1> in = tester.input(Ex1.class, "ex1");
        TestOutput<Ex1> out = tester.output(Ex1.class, "ex1");

        Ex1 ex1 = new Ex1();
        ex1.setSid(0);
        ex1.setValue(100);
        in.add(ex1);

        JobflowInfo info = DirectFlowCompiler.compile(
                tester.analyzeFlow(new UpdateFlowSimple(in.flow(), out.flow())),
                "simple",
View Full Code Here

                DirectFlowCompiler.toLibraryPath(Ex1.class),
        });
        TestInput<Ex1> in = tester.input(Ex1.class, "ex1");
        TestOutput<Ex1> out = tester.output(Ex1.class, "ex1");

        Ex1 ex1 = new Ex1();
        ex1.setSid(0);
        ex1.setValue(0);
        in.add(ex1);
        ex1.setSid(1);
        ex1.setValue(100);
        in.add(ex1);

        JobflowInfo info = DirectFlowCompiler.compile(
                tester.analyzeFlow(new StraightFragments(in.flow(), out.flow())),
                "simple",
View Full Code Here

                DirectFlowCompiler.toLibraryPath(Ex1.class),
        });
        TestInput<Ex1> in = tester.input(Ex1.class, "ex1");
        TestOutput<Ex1> out = tester.output(Ex1.class, "ex1");

        Ex1 ex1 = new Ex1();
        ex1.setStringAsString("Hello");
        ex1.setSid(0);
        ex1.setValue(100);
        in.add(ex1);

        JobflowInfo info = DirectFlowCompiler.compile(
                tester.analyzeFlow(new DuplicateFragments(in.flow(), out.flow())),
                "simple",
View Full Code Here

     * @param result result
     */
    @CoGroup
    public void cogroupAdd(@Key(group = "STRING", order = "SID") List<Ex1> list, Result<Ex1> result) {
        Iterator<Ex1> iter = list.iterator();
        Ex1 first = iter.next();
        while (iter.hasNext()) {
            Ex1 next = iter.next();
            first.getValueOption().add(next.getValueOption());
        }
        result.add(first);
    }
View Full Code Here

        JobflowInfo info = DirectFlowCompiler.toInfo(model, jar, jar);

        ModelOutput<Ex1> output = tester.openOutput(
                Ex1.class,
                Location.fromPath("target/testing/SimpleJobFlow/importer/out", '/'));
        Ex1 ex1 = new Ex1();
        ex1.setSid(100);
        ex1.setValue(100);
        output.write(ex1);
        ex1.setSid(300);
        ex1.setValue(300);
        output.write(ex1);
        ex1.setSid(200);
        ex1.setValue(200);
        output.write(ex1);
        output.close();

        tester.run(info);
View Full Code Here

        environment.getOptions().setEnableCombiner(combine);

        TestInput<Ex1> in = tester.input(Ex1.class, "Ex1");
        TestOutput<ExSummarized2> summarized = tester.output(ExSummarized2.class, "summarized");

        Ex1 ex1 = new Ex1();

        ex1.setStringAsString("a");
        ex1.setSid(1);
        ex1.setValue(10);
        in.add(ex1);

        ex1.setSid(2);
        ex1.setValue(20);
        in.add(ex1);

        ex1.setStringAsString("b");
        ex1.setSid(3);
        ex1.setValue(30);
        in.add(ex1);

        ex1.setSid(4);
        ex1.setValue(40);
        in.add(ex1);

        ex1.setSid(5);
        ex1.setValue(50);
        in.add(ex1);

        assertThat(tester.runFlow(new SummarizeFlowRenameKey(
                in.flow(), summarized.flow())), is(true));
View Full Code Here

TOP

Related Classes of com.asakusafw.compiler.flow.testing.model.Ex1

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.