Examples of ProcessingElementNode


Examples of eu.admire.dispel.graph.ProcessingElementNode

            TupleDType sourceTuple,
            TupleDType targetTuple)
        throws TypeIncompatibleException
    {
        // convert using arithmetic project
        ProcessingElementNode project =
            new ProcessingElementNode(TUPLE_CONVERT);
       
        // create the descriptor
        // TODO add stypes and dtypes
        List<ProcessingElementInputDescriptor> inputs = new ArrayList<ProcessingElementInputDescriptor>(4);
        ProcessingElementInputDescriptor desc = new ProcessingElementInputDescriptor("data");
        inputs.add(desc);
        desc = new ProcessingElementInputDescriptor("columnNames");
        inputs.add(desc);
        desc = new ProcessingElementInputDescriptor("resultColumnNames");
        inputs.add(desc);
        desc = new ProcessingElementInputDescriptor("expressions");
        inputs.add(desc);
        List<ProcessingElementOutputDescriptor> outputs =
            Arrays.asList(new ProcessingElementOutputDescriptor("result"));
        ProcessingElementDescriptor descriptor =
            new SimpleProcessingElementDescriptor(inputs, outputs, null);
        project.setDescriptor(descriptor);

        // columns that are mapped
        LiteralValuesNode columnNames = new LiteralValuesNode();
        // projection expressions
        LiteralValuesNode expressions = new LiteralValuesNode();
        expressions.add(ListMarker.BEGIN);
        columnNames.add(ListMarker.BEGIN);
        for (Entry<String, DType> element : sourceTuple.getElements().entrySet())
        {
            DType targetType = targetTuple.getElements().get(element.getKey());
            if (TypeUtilities.isEqual(element.getValue(), targetType))
            {
                // no conversion required
                continue;
            }
            else
            {
                // look up the projection expression
                String proj = mConverter.getProjection(element.getValue(), targetType);
                if (proj == null)
                {
                    throw new TypeIncompatibleException(
                            "No arithmetic project expression found for DType conversion from "
                            + element.getValue() + " to " + targetType);
                }
                // replace ? with the tuple column name
                String expression = proj.replaceAll("\\?", element.getKey());
                // map the column using the expression
                columnNames.add(element.getKey());
                expressions.add(expression);
            }
        }
        expressions.add(ListMarker.END);
        columnNames.add(ListMarker.END);
        project.connectInput("expressions", 0, expressions.getOutput());
        project.connectInput("columnNames", 0, columnNames.getOutput());
        composite.add(expressions);
        composite.add(columnNames);
        composite.add(project);
        return project;
    }
View Full Code Here

Examples of eu.admire.dispel.graph.ProcessingElementNode

                    + " to " + targetInput.getDType());
        }
        List<RequestNode> composite = new ArrayList<RequestNode>();
           
        // convert using arithmetic project
        ProcessingElementNode project =
            new ProcessingElementNode(TUPLE_ARITHMETIC_PROJECT);
        composite.add(project);
        LiteralValuesNode expressions = new LiteralValuesNode();
        composite.add(expressions);
        LiteralValuesNode resultNames = new LiteralValuesNode();
        composite.add(resultNames);
        String proj = mConverter.getProjection(
                sourceOutput.getDType(),
                targetInput.getDType());
        if (proj == null)
        {
            throw new TypeIncompatibleException(
                    "No arithmetic project expression found for DType conversion from "
                    + sourceOutput.getDType() + " to " + targetInput.getDType());
        }
        // replace ? with the name of the tuple column to form the
        // arithmetic project expression
        String expression = proj.replaceAll("\\?", sourceOutput.getName());
        expressions.add(ListMarker.BEGIN);
        expressions.add(expression);
        expressions.add(ListMarker.END);
        resultNames.add(ListMarker.BEGIN);
        resultNames.add(sourceOutput.getName());
        resultNames.add(ListMarker.END);
        project.connectInput("expressions", 0, expressions.getOutput());
        project.connectInput("resultColumnNames", 0, resultNames.getOutput());
        CompositeProcessingElement wrapper =
            new CompositeProcessingElement(
                    null,
                    composite);
        wrapper.setInput("input", 0, project.getInput("data", 0));
        wrapper.setOutput("output", 0, project.getOutput("result", 0));
        return wrapper;
    }
View Full Code Here

Examples of eu.admire.dispel.graph.ProcessingElementNode

        super(name);
    }
   
    public void testTwoConnectedProcessingElements()
    {
        ProcessingElementNode a = new ProcessingElementNode("eu.admire.A");
        ProcessingElementNode b = new ProcessingElementNode("eu.admire.B");
        a.connectOutput("out", 0, b.getInput("in", 0));
        Graph graph = new Graph();
        graph.add(a);
        graph.add(b);
//        System.out.println(GraphConverter.convertToDISPEL(graph));
    }
View Full Code Here

Examples of eu.admire.dispel.graph.ProcessingElementNode

            if (!(requestNode instanceof ProcessingElementNode))
            {
                continue;
            }
           
            ProcessingElementNode pe = (ProcessingElementNode)requestNode;
            ProcessingElementDescriptor descriptor =
                pe.getProcessingElementDescriptor();
            for (ProcessingElementInputDescriptor inputDescriptor : descriptor.getInputs())
            {
                Map<Integer, Connection> input =
                    requestNode.getAllInputs().get(inputDescriptor.getName());
                if (input == null)
View Full Code Here

Examples of eu.admire.dispel.graph.ProcessingElementNode

    }

    public void testSimpleSequenceLiteral()
    {
        LiteralValuesNode literal = new LiteralValuesNode("x", "y", "<a href=\".\"/>", 1, 2);
        ProcessingElementNode a = new ProcessingElementNode("eu.admire.A");
        a.connectInput("in", 0, literal.getOutput());
        Graph graph = new Graph();
        graph.add(a);
        graph.add(literal);
//        System.out.println(GraphConverter.convertToDISPEL(graph));
    }
View Full Code Here

Examples of eu.admire.dispel.graph.ProcessingElementNode

    {
        LiteralValuesNode literal =
            new LiteralValuesNode(
                    ListMarker.BEGIN, "x", "y", ListMarker.END,
                    ListMarker.BEGIN, 1, 2, ListMarker.END);
        ProcessingElementNode a = new ProcessingElementNode("eu.admire.A");
        a.connectInput("in", 0, literal.getOutput());
        Graph graph = new Graph();
        graph.add(a);
        graph.add(literal);
//        System.out.println(GraphConverter.convertToDISPEL(graph));
    }
View Full Code Here

Examples of eu.admire.dispel.graph.ProcessingElementNode

            RequestNode node, String outputName)
    {
        ProcessingElementOutputDescriptor result = null;
        if (node instanceof ProcessingElementNode)
        {
            ProcessingElementNode pe = (ProcessingElementNode)node;
            ProcessingElementDescriptor descriptor =
                pe.getProcessingElementDescriptor();
            result = descriptor.getOutput(outputName);
        }
        else if (node instanceof LiteralValuesNode)
        {
            LiteralValuesNode literal = (LiteralValuesNode)node;
View Full Code Here

Examples of eu.admire.dispel.graph.ProcessingElementNode

                    ListMarker.END,
                    ListMarker.BEGIN,
                    ListMarker.BEGIN, 0, 1, 2.3, ListMarker.END,
                    ListMarker.END
                    );
        ProcessingElementNode a = new ProcessingElementNode("eu.admire.A");
        a.connectInput("in", 0, literal.getOutput());
        Graph graph = new Graph();
        graph.add(a);
        graph.add(literal);
//        System.out.println(GraphConverter.convertToDISPEL(graph));
    }
View Full Code Here

Examples of eu.admire.dispel.graph.ProcessingElementNode

//        System.out.println(GraphConverter.convertToDISPEL(graph));
    }
   
    public void testMultipleOutputs()
    {
        ProcessingElementNode a = new ProcessingElementNode("eu.admire.A");
        ProcessingElementNode b = new ProcessingElementNode("eu.admire.B");
        a.connectOutput("out", 0, b.getInput("left", 0));
        a.connectOutput("out", 1, b.getInput("right", 0));
        Graph graph = new Graph();
        graph.add(a);
        graph.add(b);
//        System.out.println(GraphConverter.convertToDISPEL(graph));
    }
View Full Code Here

Examples of eu.admire.dispel.graph.ProcessingElementNode

    {
        for (RequestNode node : graph.getNodes())
        {
            if (node instanceof ProcessingElementNode)
            {
                ProcessingElementNode pen = (ProcessingElementNode) node;
                ProcessingElementDescriptor descriptor =
                    pen.getProcessingElementDescriptor();

                if (descriptor == null)
                {
                    throw new ValidationException(
                        "Graph validation failed.",
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.