Package uk.org.ogsadai.tuple

Examples of uk.org.ogsadai.tuple.SimpleTuple


        columns.add(new SimpleColumnMetadata("B", TupleTypes._INT, 0, 0, 0));
        TupleMetadata metadata = new SimpleTupleMetadata(columns);
        MockInputPipe dataInput = new MockInputPipe(new Object[] {
                ControlBlock.LIST_BEGIN,
                new MetadataWrapper(metadata),
                new SimpleTuple(Arrays.asList(0, 1)),
                new SimpleTuple(Arrays.asList(2, 3)),
                new SimpleTuple(Arrays.asList(4, 5)),
                ControlBlock.LIST_END
        });
        String script =
                "include_class Java::uk.org.ogsadai.generic.TupleHelper;\n" +
                "include_class Java::uk.org.ogsadai.tuple.TupleTypes;\n" +
View Full Code Here


        columns.add(new SimpleColumnMetadata("B", TupleTypes._INT, 0, 0, 0));
        TupleMetadata metadata = new SimpleTupleMetadata(columns);
        MockInputPipe dataInput = new MockInputPipe(new Object[] {
                ControlBlock.LIST_BEGIN,
                new MetadataWrapper(metadata),
                new SimpleTuple(Arrays.asList(Null.VALUE, "a")),
                new SimpleTuple(Arrays.asList(0, "b")),
                new SimpleTuple(Arrays.asList(Null.VALUE, "c")),
                new SimpleTuple(Arrays.asList(1, "d")),
                new SimpleTuple(Arrays.asList(2, "e")),
                ControlBlock.LIST_END
        });
        MockInputPipe scriptInput = new MockInputPipe(GenericTupleJoinActivityTest.readFile("src/ogsadai/test/uk/org/ogsadai/generic/ReplaceNull.rb"));
        MockInputPipe languageInput = new MockInputPipe("jruby");
        MockOutputPipe output = new MockOutputPipe(new Object[]{});
View Full Code Here

               
                Object result = classify(classifiers, tuple);
               
                LOG.debug("Classified " + tuple + " : " + result);
                List<?> elements = Collections.singletonList(result);
                Tuple out = new SimpleTuple(elements);
                mOutput.write(out);
            }
            mOutput.write(ControlBlock.LIST_END);
           
           
View Full Code Here

        columns.add(new SimpleColumnMetadata("A", TupleTypes._STRING, 0, 0, 0));
        TupleMetadata metadata = new SimpleTupleMetadata(columns);
        MockInputPipe data1Input = new MockInputPipe(new Object[] {
                ControlBlock.LIST_BEGIN,
                new MetadataWrapper(metadata),
                new SimpleTuple(Arrays.asList("Rupert")),
                new SimpleTuple(Arrays.asList("Ally")),
                new SimpleTuple(Arrays.asList("Amy")),
                ControlBlock.LIST_END
        });
        MockInputPipe data2Input = new MockInputPipe(new Object[] {
                ControlBlock.LIST_BEGIN,
                new MetadataWrapper(metadata),
                new SimpleTuple(Arrays.asList("Robert")),
                new SimpleTuple(Arrays.asList("Ali")),
                new SimpleTuple(Arrays.asList("Annie")),
                ControlBlock.LIST_END
        });
        String script = readFile("src/ogsadai/test/uk/org/ogsadai/generic/SoundexJoin.rb");
        MockInputPipe scriptInput = new MockInputPipe(script);
        MockInputPipe languageInput = new MockInputPipe("jruby");
View Full Code Here

        MockInputPipe inputSize = new MockInputPipe(2);
       
        ColumnMetadata colA = new SimpleColumnMetadata("A", TupleTypes._STRING, 0, 0, 0);
        ColumnMetadata colB = new SimpleColumnMetadata("B", TupleTypes._DOUBLE, 0, 0, 0);
        TupleMetadata metadata = new SimpleTupleMetadata(Arrays.asList(colA, colB));
        Tuple tuple1 = new SimpleTuple(Arrays.<Object>asList("Amy", 0));
        Tuple tuple2 = new SimpleTuple(Arrays.<Object>asList("Ally", 1.0));
        Tuple tuple3 = new SimpleTuple(Arrays.<Object>asList("Radek", 2.0));
        Tuple tuple4 = new SimpleTuple(Arrays.<Object>asList("Adrian", 3.0));
        Tuple tuple5 = new SimpleTuple(Arrays.<Object>asList("Rob", 4.0));
        MockInputPipe inputData = new MockInputPipe(new Object[] {
                ControlBlock.LIST_BEGIN,
                new MetadataWrapper(metadata),
                tuple1, tuple2, tuple3, tuple4, tuple5,
                ControlBlock.LIST_END
View Full Code Here

        MockInputPipe inputTemplate = new MockInputPipe("Hello $REPLACE(A)$, hello $REPLACE(B)$!");
       
        ColumnMetadata colA = new SimpleColumnMetadata("A", TupleTypes._STRING, 0, 0, 0);
        ColumnMetadata colB = new SimpleColumnMetadata("B", TupleTypes._DOUBLE, 0, 0, 0);
        TupleMetadata metadata = new SimpleTupleMetadata(Arrays.asList(colA, colB));
        Tuple tuple1 = new SimpleTuple(Arrays.<Object>asList("Amy", 0));
        Tuple tuple2 = new SimpleTuple(Arrays.<Object>asList("Ally", 1.0));
        Tuple tuple3 = new SimpleTuple(Arrays.<Object>asList("Radek", 2.0));
        MockInputPipe inputData = new MockInputPipe(new Object[] {
                ControlBlock.LIST_BEGIN,
                new MetadataWrapper(metadata),
                tuple1, tuple2, tuple3,
                ControlBlock.LIST_END
View Full Code Here

       
        MockInputPipe inputTemplate = new MockInputPipe("Hello $REPLACE(A)$, hello $REPLACE(B)$!");
       
        ColumnMetadata colA = new SimpleColumnMetadata("A", TupleTypes._STRING, 0, 0, 0);
        TupleMetadata metadata = new SimpleTupleMetadata(Arrays.asList(colA));
        Tuple tuple1 = new SimpleTuple(Arrays.<Object>asList("Amy", 0));
        Tuple tuple2 = new SimpleTuple(Arrays.<Object>asList("Ally", 1.0));
        Tuple tuple3 = new SimpleTuple(Arrays.<Object>asList("Radek", 2.0));
        MockInputPipe inputData = new MockInputPipe(new Object[] {
                ControlBlock.LIST_BEGIN,
                new MetadataWrapper(metadata),
                tuple1, tuple2, tuple3,
                ControlBlock.LIST_END
View Full Code Here

        List<Object> elements = new ArrayList<Object>();
        for (int i=0; i<mModifiers.length; i++)
        {
            elements.add(mModifiers[i].getValue(tuple));
        }
        Tuple result = new SimpleTuple(elements);
        return result;
    }
View Full Code Here

        List elements = new ArrayList();
        for (int i = 0; i < calc.length; i++)
        {
            elements.add(calc[i].getMean());
        }
        Tuple tuple = new SimpleTuple(elements);
        return tuple;
    }
View Full Code Here

        SerialiserActivity serialiser = new SerialiserActivity();
        Object[] data =
        {
            "A test string",
            "Some other test string",
            new SimpleTuple(Arrays.asList(1, 2, 3, 4, 5))
        };
        MockInputPipe input = new MockInputPipe(data);
        serialiser.addInput(SerialiserActivity.INPUT_DATA, input);
        MockOutputPipe output = new MockOutputPipe(new Object[] {});
        serialiser.addOutput(SerialiserActivity.OUTPUT_RESULT, output);
View Full Code Here

TOP

Related Classes of uk.org.ogsadai.tuple.SimpleTuple

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.