Examples of RuleOperator


Examples of lupos.gui.operatorgraph.visualeditor.ruleeditor.operators.RuleOperator

      if(ruleOpLoadObject.has("op type") && ruleOpLoadObject.getString("op type").equals("JumpOverOperator")) {
        op = new JumpOverOperator(ruleOpName, ruleOpLoadObject);
      }
      else {
        op = new RuleOperator(ruleOpName, ruleOpLoadObject);
      }

      JSONArray positionArray = ruleOpLoadObject.getJSONArray("position");

      this.addOperator(positionArray.getInt(0), positionArray.getInt(1), op);
View Full Code Here

Examples of lupos.gui.operatorgraph.visualeditor.ruleeditor.operators.RuleOperator

    this.checkMethodCode = new StringBuffer();
    this.buffers = new LinkedList<StringBuffer>();

    if(rImplementationPanel.useGeneratedJavaCode_CheckMethod()) {
      RuleOperator startNode = rRuleEditorPane.getStartNode();
      startNodeClass = startNode.getClassType().getOpClass().getName();

      this.count_private = 0;

      int maxDimension = 0;
      StringBuffer spaces = new StringBuffer("    ");
View Full Code Here

Examples of lupos.gui.operatorgraph.visualeditor.visualrif.operators.RuleOperator

  @Override
  public Object visit(final Rule obj, final Object arg) throws RIFException {
    System.out.println("visit(Rule obj, Object arg)");

    final RuleOperator ro = new RuleOperator();
    ro.setVisualRifEditor(this.visualRifEditor);
    ro.initRule();

    ro.setUnVisitedObject(obj);
    return ro;
  }
View Full Code Here

Examples of lupos.gui.operatorgraph.visualeditor.visualrif.operators.RuleOperator

          rootList.add(gwo);
        }

        // Rule
        if ( rootNodes[i] instanceof RuleOperator ){
          final RuleOperator ro = (RuleOperator) rootNodes[i];

          final GraphWrapperOperator gwo = new GraphWrapperOperator(ro);
          ro.getRulePanel().getRuleEditorPane().evaluate(ro.getUnVisitedObject(),this.vrg);
          rootList.add(gwo);
        }else{

          rootList.add(new GraphWrapperOperator(rootNodes[i]));
        }
View Full Code Here

Examples of lupos.gui.operatorgraph.visualeditor.visualrif.operators.RuleOperator

   
//    Iterator<String> keyIt = loadObject.keys();

//    HashMap<String, GraphWrapperEditable> tmp = new HashMap<String, GraphWrapperEditable>();

    RuleOperator op = null;

//    JSONObject opLoadObject = loadObject.getJSONObject(ruleOpName);
   
    JSONObject canvasInfo = loadObject.getJSONObject("CANVASINFO");
   
    JSONArray positionArray = canvasInfo.getJSONArray("POSITION");
   
    JSONObject ruleEditorPane = loadObject.getJSONObject("RULEEDITORPANE");



      if( canvasInfo.has("OP TYPE") && canvasInfo.getString("OP TYPE").equals("RuleOperator") ) {
       
       
       
        op = new RuleOperator(ruleOpName, loadObject);
        op.setDocumentName(documentName);
        op.setVisualRifEditor(this.visualRifEditor);
        op.setDocumentName(documentName);
        op.initRule();
        op.getRulePanel().getRuleEditorPane().fromJSON(ruleEditorPane);

      }

      this.addOperator(positionArray.getInt(0), positionArray.getInt(1), op);
     
View Full Code Here

Examples of lupos.gui.operatorgraph.visualeditor.visualrif.operators.RuleOperator

    for(GraphWrapper gw : this.boxes.keySet()) {
      Operator op = (Operator) gw.getElement();
   
      // Rule
      if (op instanceof RuleOperator){
        RuleOperator ro = ( RuleOperator ) op;
       
        if( ro.getRuleName().equals(ruleName) ){
         
//          saveObject.put(ro.getRuleName(), ro.toJSON(connectionsObject));
         
          return ro.toJSON(connectionsObject);
       
        }
      }
     
   
View Full Code Here

Examples of lupos.gui.operatorgraph.visualeditor.visualrif.operators.RuleOperator

  private void createOperator(final T newOp) {
    /* Document */
    // add Rule
    if ( newOp instanceof RuleOperator){
      final RuleOperator ro =  (RuleOperator) newOp;
      this.createNewRule(ro);
    }

    // add Prefix
    if ( newOp instanceof PrefixOperator ){
View Full Code Here

Examples of org.apache.pig.impl.plan.optimizer.RuleOperator

        // it explicit. Since the RuleMatcher doesn't handle trees properly,
        // we cheat and say that we match any node. Then we'll do the actual
        // test in the transformers check method.
       
        rulePlan = new RulePlan();
        RuleOperator anyLogicalOperator = new RuleOperator(LogicalOperator.class, RuleOperator.NodeType.ANY_NODE,
                new OperatorKey(SCOPE, nodeIdGen.getNextNodeId(SCOPE)));
        rulePlan.add(anyLogicalOperator);
        mRules.add(new Rule<LogicalOperator, LogicalPlan>(rulePlan,
                new ImplicitSplitInserter(plan), "ImplicitSplitInserter"));

       
        // this one is ordered to be before other optimizations since  later
        // optimizations may move the LOFilter that is looks for just after a
        // LOLoad
        rulePlan = new RulePlan();
        RuleOperator loLoad = new RuleOperator(LOLoad.class,
                new OperatorKey(SCOPE, nodeIdGen.getNextNodeId(SCOPE)));
        rulePlan.add(loLoad);
        mRules.add(new Rule<LogicalOperator, LogicalPlan>(rulePlan,
                new PartitionFilterOptimizer(plan), "LoadPartitionFilterOptimizer"));
       
        // Add type casting to plans where the schema has been declared (by
        // user, data, or data catalog).
        rulePlan = new RulePlan();
        loLoad = new RuleOperator(LOLoad.class,
                new OperatorKey(SCOPE, nodeIdGen.getNextNodeId(SCOPE)));
        rulePlan.add(loLoad);
        mRules.add(new Rule<LogicalOperator, LogicalPlan>(rulePlan,
                new TypeCastInserter(plan, LOLoad.class.getName()), "LoadTypeCastInserter"));

        // Add type casting to plans where the schema has been declared by
        // user in a statement with stream operator.
       
        rulePlan = new RulePlan();
        RuleOperator loStream= new RuleOperator(LOStream.class,
                new OperatorKey(SCOPE, nodeIdGen.getNextNodeId(SCOPE)));
        rulePlan.add(loStream);
        mRules.add(new Rule<LogicalOperator, LogicalPlan>(rulePlan, new TypeCastInserter(plan,
                LOStream.class.getName()), "StreamTypeCastInserter"));
       
        if(!turnAllRulesOff) {

            // Push up limit wherever possible.
            rulePlan = new RulePlan();
            RuleOperator loLimit = new RuleOperator(LOLimit.class,
          new OperatorKey(SCOPE, nodeIdGen.getNextNodeId(SCOPE)));
      rulePlan.add(loLimit);
      Rule<LogicalOperator, LogicalPlan> rule = new Rule<LogicalOperator, LogicalPlan>(rulePlan,
          new OpLimitOptimizer(plan, mode), "LimitOptimizer");
            checkAndAddRule(rule);
           
            // Push filters up wherever possible
            rulePlan = new RulePlan();
            RuleOperator loFilter = new RuleOperator(LOFilter.class,
                    new OperatorKey(SCOPE, nodeIdGen.getNextNodeId(SCOPE)));
            rulePlan.add(loFilter);
            rule = new Rule<LogicalOperator, LogicalPlan>(rulePlan,
                    new PushUpFilter(plan), "PushUpFilter");
            checkAndAddRule(rule);
           
            // Push foreach with flatten down wherever possible
            rulePlan = new RulePlan();
            RuleOperator loForeach = new RuleOperator(LOForEach.class,
                    new OperatorKey(SCOPE, nodeIdGen.getNextNodeId(SCOPE)));
            rulePlan.add(loForeach);
            rule = new Rule<LogicalOperator, LogicalPlan>(rulePlan,
                    new PushDownForeachFlatten(plan), "PushDownForeachFlatten");
            checkAndAddRule(rule);
           
            // Prune column up wherever possible
            rulePlan = new RulePlan();
            RuleOperator rulePruneColumnsOperator = new RuleOperator(RelationalOperator.class, RuleOperator.NodeType.ANY_NODE,
                    new OperatorKey(SCOPE, nodeIdGen.getNextNodeId(SCOPE)));
            rulePlan.add(rulePruneColumnsOperator);
            pruneRule = new Rule<LogicalOperator, LogicalPlan>(rulePlan,
                    new PruneColumns(plan), "PruneColumns", Rule.WalkerAlgo.ReverseDependencyOrderWalker);
        }
View Full Code Here

Examples of org.apache.pig.impl.plan.optimizer.RuleOperator

        // it explicit. Since the RuleMatcher doesn't handle trees properly,
        // we cheat and say that we match any node. Then we'll do the actual
        // test in the transformers check method.
       
        rulePlan = new RulePlan();
        RuleOperator anyLogicalOperator = new RuleOperator(LogicalOperator.class, RuleOperator.NodeType.ANY_NODE,
                new OperatorKey(SCOPE, nodeIdGen.getNextNodeId(SCOPE)));
        rulePlan.add(anyLogicalOperator);
        mRules.add(new Rule<LogicalOperator, LogicalPlan>(rulePlan,
                new ImplicitSplitInserter(plan), "ImplicitSplitInserter"));


        // Add type casting to plans where the schema has been declared (by
        // user, data, or data catalog).
        rulePlan = new RulePlan();
        RuleOperator loLoad = new RuleOperator(LOLoad.class,
                new OperatorKey(SCOPE, nodeIdGen.getNextNodeId(SCOPE)));
        rulePlan.add(loLoad);
        mRules.add(new Rule<LogicalOperator, LogicalPlan>(rulePlan,
                new TypeCastInserter(plan, LOLoad.class.getName()), "LoadTypeCastInserter"));

        // Add type casting to plans where the schema has been declared by
        // user in a statement with stream operator.
        rulePlan = new RulePlan();
        RuleOperator loStream= new RuleOperator(LOStream.class,
                new OperatorKey(SCOPE, nodeIdGen.getNextNodeId(SCOPE)));
        rulePlan.add(loStream);
        mRules.add(new Rule<LogicalOperator, LogicalPlan>(rulePlan, new TypeCastInserter(plan,
                LOStream.class.getName()), "StreamTypeCastInserter"));
       
        // Add type casting to plans where the schema has been declared by
        // user in a statement with native operator.
        rulePlan = new RulePlan();
        RuleOperator loNative= new RuleOperator(LONative.class,
                new OperatorKey(SCOPE, nodeIdGen.getNextNodeId(SCOPE)));
        rulePlan.add(loNative);
        mRules.add(new Rule<LogicalOperator, LogicalPlan>(rulePlan, new TypeCastInserter(plan,
                LONative.class.getName()), "NativeTypeCastInserter"));
       
        // Push up filters as far as we can
        rulePlan = new RulePlan();
        RuleOperator loFilter = new RuleOperator(LOFilter.class,
                new OperatorKey(SCOPE, nodeIdGen.getNextNodeId(SCOPE)));
        rulePlan.add(loFilter);
        mRules.add(new Rule<LogicalOperator, LogicalPlan>(rulePlan,
                new TypeCastInserter(plan, LOFilter.class.getName()),
                "PushUpFilter"));
View Full Code Here

Examples of org.apache.pig.impl.plan.optimizer.RuleOperator

        // it explicit. Since the RuleMatcher doesn't handle trees properly,
        // we cheat and say that we match any node. Then we'll do the actual
        // test in the transformers check method.
       
        rulePlan = new RulePlan();
        RuleOperator anyLogicalOperator = new RuleOperator(LogicalOperator.class, RuleOperator.NodeType.ANY_NODE,
                new OperatorKey(SCOPE, nodeIdGen.getNextNodeId(SCOPE)));
        rulePlan.add(anyLogicalOperator);
        mRules.add(new Rule<LogicalOperator, LogicalPlan>(rulePlan,
                new ImplicitSplitInserter(plan), "ImplicitSplitInserter"));

       
        // this one is ordered to be before other optimizations since  later
        // optimizations may move the LOFilter that is looks for just after a
        // LOLoad
        rulePlan = new RulePlan();
        RuleOperator loLoad = new RuleOperator(LOLoad.class,
                new OperatorKey(SCOPE, nodeIdGen.getNextNodeId(SCOPE)));
        rulePlan.add(loLoad);
        mRules.add(new Rule<LogicalOperator, LogicalPlan>(rulePlan,
                new PartitionFilterOptimizer(plan), "PartitionFilterOptimizer"));


        // Add type casting to plans where the schema has been declared (by
        // user, data, or data catalog).
        rulePlan = new RulePlan();
        loLoad = new RuleOperator(LOLoad.class,
                new OperatorKey(SCOPE, nodeIdGen.getNextNodeId(SCOPE)));
        rulePlan.add(loLoad);
        mRules.add(new Rule<LogicalOperator, LogicalPlan>(rulePlan,
                new TypeCastInserter(plan, LOLoad.class.getName()), "LoadTypeCastInserter"));

        // Add type casting to plans where the schema has been declared by
        // user in a statement with stream operator.
       
        rulePlan = new RulePlan();
        RuleOperator loStream= new RuleOperator(LOStream.class,
                new OperatorKey(SCOPE, nodeIdGen.getNextNodeId(SCOPE)));
        rulePlan.add(loStream);
        mRules.add(new Rule<LogicalOperator, LogicalPlan>(rulePlan, new TypeCastInserter(plan,
                LOStream.class.getName()), "StreamTypeCastInserter"));

        if(!turnAllRulesOff) {

            // Push up limit wherever possible.
            rulePlan = new RulePlan();
            RuleOperator loLimit = new RuleOperator(LOLimit.class,
          new OperatorKey(SCOPE, nodeIdGen.getNextNodeId(SCOPE)));
      rulePlan.add(loLimit);
      Rule<LogicalOperator, LogicalPlan> rule = new Rule<LogicalOperator, LogicalPlan>(rulePlan,
          new OpLimitOptimizer(plan, mode), "LimitOptimizer");
            checkAndAddRule(rule);
           
            // Push filters up wherever possible
            rulePlan = new RulePlan();
            RuleOperator loFilter = new RuleOperator(LOFilter.class,
                    new OperatorKey(SCOPE, nodeIdGen.getNextNodeId(SCOPE)));
            rulePlan.add(loFilter);
            rule = new Rule<LogicalOperator, LogicalPlan>(rulePlan,
                    new PushUpFilter(plan), "PushUpFilter");
            checkAndAddRule(rule);
           
            // Push foreach with flatten down wherever possible
            rulePlan = new RulePlan();
            RuleOperator loForeach = new RuleOperator(LOForEach.class,
                    new OperatorKey(SCOPE, nodeIdGen.getNextNodeId(SCOPE)));
            rulePlan.add(loForeach);
            rule = new Rule<LogicalOperator, LogicalPlan>(rulePlan,
                    new PushDownForeachFlatten(plan), "PushDownForeachFlatten");
            checkAndAddRule(rule);
           
            // Prune column up wherever possible
            rulePlan = new RulePlan();
            RuleOperator rulePruneColumnsOperator = new RuleOperator(RelationalOperator.class, RuleOperator.NodeType.ANY_NODE,
                    new OperatorKey(SCOPE, nodeIdGen.getNextNodeId(SCOPE)));
            rulePlan.add(rulePruneColumnsOperator);
            pruneRule = new Rule<LogicalOperator, LogicalPlan>(rulePlan,
                    new PruneColumns(plan), "PruneColumns", Rule.WalkerAlgo.ReverseDependencyOrderWalker);
        }
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.