Package com.asakusafw.vocabulary.flow.graph

Examples of com.asakusafw.vocabulary.flow.graph.FlowElementDescription


        private RendezvousProcessor.Context createConext(
                Factor factor,
                SimpleName argument) {
            assert argument != null;

            FlowElementDescription desc = factor.getElement().getDescription();
            if ((desc instanceof OperatorDescription) == false) {
                throw new IllegalArgumentException(desc.toString());
            }
            OperatorDescription description = (OperatorDescription) desc;
            Map<FlowElementPortDescription, Expression> inputs = Maps.create();
            for (FlowElementInput port : factor.getElement().getInputPorts()) {
                inputs.put(port.getDescription(), argument);
View Full Code Here


     */
    public static Set<FlowElement> collectFlowParts(FlowGraph graph) {
        Precondition.checkMustNotBeNull(graph, "graph"); //$NON-NLS-1$
        Set<FlowElement> results = Sets.create();
        for (FlowElement element : collectElements(graph)) {
            FlowElementDescription description = element.getDescription();
            if (description.getKind() == FlowElementKind.FLOW_COMPONENT) {
                results.add(element);
            }
        }
        return results;
    }
View Full Code Here

        FlowElement mapped = elemMapping.get(orig);
        if (mapped != null) {
            return mapped;
        }
        FlowElement copy;
        FlowElementDescription description = orig.getDescription();
        if (description.getKind() == FlowElementKind.FLOW_COMPONENT) {
            FlowPartDescription fcd = (FlowPartDescription) description;
            FlowGraph subgraph = deepCopy(fcd.getFlowGraph());
            FlowPartDescription partCopy = new FlowPartDescription(subgraph);
            copy = new FlowElement(partCopy, orig.getAttributeOverride());
        } else {
View Full Code Here

     * @return フロー境界でなく、かつ恒等関数である場合のみ{@code true}
     * @throws IllegalArgumentException 引数に{@code null}が指定された場合
     */
    public static boolean isIdentity(FlowElement element) {
        Precondition.checkMustNotBeNull(element, "element"); //$NON-NLS-1$
        FlowElementDescription description = element.getDescription();
        return isBoundary(element) == false
                && description.getKind() == FlowElementKind.PSEUD
                && element.getInputPorts().size() == 1
                && element.getOutputPorts().size() == 1;
    }
View Full Code Here

     * @param output 停止演算子を接続するポート
     * @throws IllegalArgumentException 引数に{@code null}が指定された場合
     */
    public static void stop(FlowElementOutput output) {
        Precondition.checkMustNotBeNull(output, "output"); //$NON-NLS-1$
        FlowElementDescription desc = new PseudElementDescription(
                "implicit-stop",
                output.getDescription().getDataType(),
                true,
                false,
                FlowBoundary.STAGE);
View Full Code Here

     * @param attributes インライン化する際のバイパス要素に付与する属性
     * @throws IllegalArgumentException 引数に{@code null}が指定された場合
     */
    public static void inlineFlowPart(FlowElement element, FlowElementAttribute... attributes) {
        Precondition.checkMustNotBeNull(element, "element"); //$NON-NLS-1$
        FlowElementDescription description = element.getDescription();
        if (description.getKind() != FlowElementKind.FLOW_COMPONENT) {
            throw new IllegalArgumentException("element must be a flow component"); //$NON-NLS-1$
        }

        FlowPartDescription component = (FlowPartDescription) description;
        FlowGraph graph = component.getFlowGraph();
View Full Code Here

        Collection<FlowElementOutput> upstreams = input.disconnectAll();
        Collection<FlowElementInput> downstreams = output.disconnectAll();
        for (FlowElementOutput upstream : upstreams) {
            for (FlowElementInput downstream : downstreams) {
                if (attributes.length >= 1) {
                    FlowElementDescription desc = new PseudElementDescription(
                            "bypass",
                            output.getDescription().getDataType(),
                            true,
                            true,
                            attributes);
View Full Code Here

        assert name != null;
        assert attributes != null;

        Collection<FlowElementInput> originalDownstreams = output.disconnectAll();

        FlowElementDescription desc = new PseudElementDescription(
                name,
                output.getDescription().getDataType(),
                true,
                true,
                attributes);
View Full Code Here

        LOG.debug("シャッフルへの各セグメントを分析しています");

        List<ShuffleModel.Segment> segments = Lists.create();
        for (int elementId = 0, n = elements.size(); elementId < n; elementId++) {
            FlowElement element = elements.get(elementId);
            FlowElementDescription description = element.getDescription();
            RendezvousProcessor proc = environment.getProcessors()
                .findRendezvousProcessor(description);
            if (proc == null) {
                error("{0}に対する{1}が見つかりませんでした",
                        description,
View Full Code Here

            Class<?> type, String name,
            String inputList, String outputList,
            FlowElementAttribute... attributes) {
        List<FlowElementPortDescription> inputs = parsePorts(PortDirection.INPUT, inputList);
        List<FlowElementPortDescription> outputs = parsePorts(PortDirection.OUTPUT, outputList);
        FlowElementDescription desc = new OperatorDescription(
                new OperatorDescription.Declaration(
                        Identity.class,
                        type,
                        type,
                        name,
View Full Code Here

TOP

Related Classes of com.asakusafw.vocabulary.flow.graph.FlowElementDescription

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.