Package com.asakusafw.vocabulary.flow.graph

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


                context,
                (JoinResourceDescription) resource);
        ModelFactory f = context.getModelFactory();
        OperatorDescription desc = context.getOperatorDescription();

        FlowElementPortDescription updatedPort = context.getOutputPort(SideDataJoinUpdate.ID_OUTPUT_UPDATED);
        FlowElementPortDescription missedPort = context.getOutputPort(SideDataJoinUpdate.ID_OUTPUT_MISSED);
        ResultMirror updated = context.getOutput(updatedPort);
        ResultMirror missed = context.getOutput(missedPort);

        Expression impl = context.createImplementation();
        List<Expression> arguments = Lists.create();
View Full Code Here


                context,
                (JoinResourceDescription) resource);

        ModelFactory f = context.getModelFactory();

        FlowElementPortDescription foundPort = context.getOutputPort(SideDataCheck.ID_OUTPUT_FOUND);
        FlowElementPortDescription missedPort = context.getOutputPort(SideDataCheck.ID_OUTPUT_MISSED);
        ResultMirror found = context.getOutput(foundPort);
        ResultMirror missed = context.getOutput(missedPort);

        context.add(f.newIfStatement(
                helper.getHasMasterExpresion(),
View Full Code Here

    private void processMasterFirst(RendezvousProcessor.Context context) {
        assert context != null;
        ModelFactory f = context.getModelFactory();
        OperatorDescription desc = context.getOperatorDescription();
        FlowElementPortDescription master = desc.getInputPorts().get(0);

        Expression hasMaster = context.createField(boolean.class, "sawMaster");
        DataObjectMirror masterCache = context.createModelCache(master.getDataType());
        context.addBegin(new ExpressionBuilder(f, hasMaster)
            .assignFrom(Models.toLiteral(f, false))
            .toStatement());
        context.addProcess(master, f.newIfStatement(
                new ExpressionBuilder(f, hasMaster)
View Full Code Here

            OperatorHelper selector) {
        assert context != null;
        assert selector != null;
        ModelFactory f = context.getModelFactory();
        OperatorDescription desc = context.getOperatorDescription();
        FlowElementPortDescription master = desc.getInputPorts().get(0);
        FlowElementPortDescription tx = desc.getInputPorts().get(1);

        ListBufferMirror list = context.createListBuffer(master.getDataType(), InputBuffer.EXPAND);
        context.addBegin(list.createBegin());
        Expression proc = context.getProcessInput(master);
        context.addProcess(master, list.createAdvance(proc));
View Full Code Here

    @Override
    public ShuffleDescription getShuffleDescription(
            FlowElementDescription element,
            FlowElementPortDescription port) {
        FlowElementPortDescription output = element.getOutputPorts().get(Summarize.ID_OUTPUT);
        LinePartProcessor line = new Prologue(port.getDataType(), output.getDataType());
        line.initialize(getEnvironment());
        return new ShuffleDescription(
                output.getDataType(),
                rebuildShuffleKey(output, port),
                line);
    }
View Full Code Here

    @Override
    public void emitRendezvous(Context context) {
        ModelFactory f = context.getModelFactory();

        FlowElementPortDescription input = context.getInputPort(Summarize.ID_INPUT);
        FlowElementPortDescription output = context.getOutputPort(Summarize.ID_OUTPUT);

        Expression init = context.createField(boolean.class, "initialized");
        context.addBegin(new ExpressionBuilder(f, init)
            .assignFrom(Models.toLiteral(f, false))
            .toStatement());

        DataObjectMirror cache = context.createModelCache(output.getDataType());

        List<Statement> combine = Lists.create();
        DataClass outputType = getEnvironment().getDataClasses().load(output.getDataType());
        Summarized summarized = TypeUtil.erase(output.getDataType()).getAnnotation(Summarized.class);
        for (Summarized.Folding folding : summarized.term().foldings()) {
            if (folding.aggregator() == Aggregator.ANY) {
                continue;
            }
            combine.add(createAddSummarizeFor(context, folding, outputType, cache.get()));
View Full Code Here

@TargetOperator(Extend.class)
public class ExtendFlowProcessor extends LinePartProcessor {

    @Override
    public void emitLinePart(Context context) {
        FlowElementPortDescription input = context.getInputPort(Extend.ID_INPUT);
        FlowElementPortDescription output = context.getOutputPort(Extend.ID_OUTPUT);
        DataObjectMirror cache = context.createModelCache(output.getDataType());
        context.setOutput(cache.get());

        DataClass sourceType = loadChecked(input);
        DataClass sinkType = loadChecked(output);
        if (sourceType == null || sinkType == null) {
View Full Code Here

    @Override
    public void emitRendezvous(Context context) {
        MasterKindFlowAnalyzer masterAnalyzer = new MasterKindFlowAnalyzer(context);
        ModelFactory f = context.getModelFactory();

        FlowElementPortDescription tx = context.getInputPort(MasterJoin.ID_INPUT_TRANSACTION);

        FlowElementPortDescription joinedPort = context.getOutputPort(MasterJoin.ID_OUTPUT_JOINED);
        FlowElementPortDescription missedPort = context.getOutputPort(MasterJoin.ID_OUTPUT_MISSED);

        DataObjectMirror resultCache = context.createModelCache(joinedPort.getDataType());
        DataClass outputType = getEnvironment().getDataClasses().load(joinedPort.getDataType());
        List<Statement> process = Lists.create();
        process.add(resultCache.createReset());
View Full Code Here

@TargetOperator(Project.class)
public class ProjectFlowProcessor extends LinePartProcessor {

    @Override
    public void emitLinePart(Context context) {
        FlowElementPortDescription input = context.getInputPort(Project.ID_INPUT);
        FlowElementPortDescription output = context.getOutputPort(Project.ID_OUTPUT);
        DataObjectMirror cache = context.createModelCache(output.getDataType());
        context.setOutput(cache.get());

        DataClass sourceType = loadChecked(input);
        DataClass sinkType = loadChecked(output);
        if (sourceType == null || sinkType == null) {
View Full Code Here

    @Override
    public void emitRendezvous(Context context) {
        ModelFactory f = context.getModelFactory();
        OperatorDescription desc = context.getOperatorDescription();

        FlowElementPortDescription input = context.getInputPort(Fold.ID_INPUT);
        FlowElementPortDescription output = context.getOutputPort(Fold.ID_OUTPUT);

        Expression init = context.createField(boolean.class, "initialized");
        context.addBegin(new ExpressionBuilder(f, init)
            .assignFrom(Models.toLiteral(f, false))
            .toStatement());

        DataObjectMirror cache = context.createModelCache(output.getDataType());
        Expression impl = context.createImplementation();
        Expression proc = context.getProcessInput(input);
        List<Expression> arguments = Lists.create();
        arguments.add(cache.get());
        arguments.add(proc);
View Full Code Here

TOP

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

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.