Package com.asakusafw.vocabulary.flow.graph

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


     */
    public FormalParameterDeclaration toFactoryMethodInput(OperatorPortDeclaration var, SimpleName name) {
        Precondition.checkMustNotBeNull(var, "var"); //$NON-NLS-1$
        Precondition.checkMustNotBeNull(name, "name"); //$NON-NLS-1$
        AttributeBuilder attributes = new AttributeBuilder(factory);
        ShuffleKey key = var.getShuffleKey();
        if (key != null) {
            List<Expression> group = new ArrayList<Expression>();
            for (String entry : key.getGroupProperties()) {
                group.addAll(new AttributeBuilder(factory)
                        .annotation(t(KeyInfo.Group.class), "expression", Models.toLiteral(factory, entry))
                        .toAnnotations());
            }
            List<Expression> order = new ArrayList<Expression>();
            for (ShuffleKey.Order entry : key.getOrderings()) {
                order.addAll(new AttributeBuilder(factory)
                        .annotation(
                                t(KeyInfo.Order.class),
                                "direction", new TypeBuilder(factory, t(KeyInfo.Direction.class))
                                        .field(entry.getDirection().name())
View Full Code Here


            DataModelMirror model,
            AnnotationMirror annotation) {
        if (annotation == null) {
            return null;
        }
        ShuffleKey key = toUncheckedShuffleKey(position, annotation);
        if (key == null) {
            return null;
        }
        checkShuffleKey(position, model, key);
        return key;
View Full Code Here

                error(position, "@Keyのorder \"{0}\" を正しく解析できません", orderString);
            } else {
                formedOrder.add(o);
            }
        }
        return new ShuffleKey(group, formedOrder);
    }
View Full Code Here

    }

    private List<Property> toJoinKey(FlowElementInput input) {
        assert input != null;
        DataClass dataClass = toDataClass(input);
        ShuffleKey key = input.getDescription().getShuffleKey();
        assert key != null;
        List<Property> results = Lists.create();
        for (String name : key.getGroupProperties()) {
            Property property = dataClass.findProperty(name);
            if (property == null) {
                getEnvironment().error(
                        "型{0}にプロパティ{1}が見つかりませんでした",
                        dataClass,
View Full Code Here

            int portId,
            FlowElementInput input,
            ShuffleDescription desciption) {
        assert input != null;
        assert desciption != null;
        ShuffleKey keyInfo = desciption.getKeyInfo();

        Type inputType = input.getDescription().getDataType();

        DataClassRepository dataClasses = environment.getDataClasses();
        DataClass source = dataClasses.load(inputType);
        DataClass target = dataClasses.load(desciption.getOutputType());
        if (source == null) {
            error("データクラス{0}は定義されていません", inputType);
        }
        if (target == null) {
            error("データクラス{0}は定義されていません", desciption.getOutputType());
        }
        if (source == null || target == null) {
            return null;
        }

        List<ShuffleModel.Term> terms = Lists.create();
        for (String name : keyInfo.getGroupProperties()) {
            int termId = terms.size() + 1;
            DataClass.Property property = target.findProperty(name);
            if (property == null) {
                error("データクラス{0}にはプロパティ{1}が定義されていません", target, name);
                continue;
            }
            terms.add(new ShuffleModel.Term(
                    termId,
                    property,
                    ShuffleModel.Arrangement.GROUPING));
        }
        for (ShuffleKey.Order order : keyInfo.getOrderings()) {
            int termId = terms.size() + 1;
            DataClass.Property property = target.findProperty(order.getProperty());
            if (property == null) {
                error("データクラス{0}にはプロパティ{1}が定義されていません",
                        target,
View Full Code Here

        if (joined.isJoinedModel(master.getType(), transaction.getType()) == false) {
            a.error("マスタ結合演算子の戻り値型は引数の結合結果を表す型である必要があります");
            return null;
        }

        ShuffleKey masterKey = joined.getJoinKey(master.getType());
        ShuffleKey transactionKey = joined.getJoinKey(transaction.getType());

        MasterJoin annotation = context.element.getAnnotation(MasterJoin.class);
        if (annotation == null) {
            a.error("注釈の解釈に失敗しました");
            return null;
View Full Code Here

                        input.getShuffleKey(),
                        mapping));
            }
            remapped.add(target);
        }
        return new ShuffleKey(remapped, Collections.<ShuffleKey.Order>emptyList());
    }
View Full Code Here

        FoldAdd(Source<Ex1> in) {
            OperatorDescription.Builder builder = new OperatorDescription.Builder(Fold.class);
            builder.declare(ExOperator.class, ExOperatorImpl.class, "foldAdd");
            builder.declareParameter(Ex1.class);
            builder.declareParameter(Ex1.class);
            builder.addInput("in", in, new ShuffleKey(Arrays.asList(new String[]{"STRING"}), Arrays.asList(new
                    ShuffleKey.Order[]{})));
            builder.addOutput("out", in);
            builder.addAttribute(FlowBoundary.SHUFFLE);
            builder.addAttribute(ObservationCount.DONT_CARE);
            builder.addAttribute(PartialAggregation.DEFAULT);
View Full Code Here

        CogroupAdd(Source<Ex1> list) {
            OperatorDescription.Builder builder5 = new OperatorDescription.Builder(CoGroup.class);
            builder5.declare(ExOperator.class, ExOperatorImpl.class, "cogroupAdd");
            builder5.declareParameter(List.class);
            builder5.declareParameter(Result.class);
            builder5.addInput("list", list, new ShuffleKey(Arrays.asList(new String[]{"STRING"}), Arrays.asList(new
                    ShuffleKey.Order[]{new ShuffleKey.Order("SID", ShuffleKey.Direction.ASC)})));
            builder5.addOutput("result", Ex1.class);
            builder5.addAttribute(FlowBoundary.SHUFFLE);
            builder5.addAttribute(ObservationCount.DONT_CARE);
            builder5.addAttribute(InputBuffer.EXPAND);
View Full Code Here

            builder6.declare(ExOperator.class, ExOperatorImpl.class, "cogroup");
            builder6.declareParameter(List.class);
            builder6.declareParameter(List.class);
            builder6.declareParameter(Result.class);
            builder6.declareParameter(Result.class);
            builder6.addInput("ex1", ex1, new ShuffleKey(Arrays.asList(new String[]{"value"}), Arrays.asList(new
                    ShuffleKey.Order[]{new ShuffleKey.Order("sid", ShuffleKey.Direction.ASC)})));
            builder6.addInput("ex2", ex2, new ShuffleKey(Arrays.asList(new String[]{"value"}), Arrays.asList(new
                    ShuffleKey.Order[]{new ShuffleKey.Order("string", ShuffleKey.Direction.DESC)})));
            builder6.addOutput("r1", Ex1.class);
            builder6.addOutput("r2", Ex2.class);
            builder6.addAttribute(FlowBoundary.SHUFFLE);
            builder6.addAttribute(ObservationCount.DONT_CARE);
View Full Code Here

TOP

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

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.