Package org.apache.flink.compiler.plan

Examples of org.apache.flink.compiler.plan.SingleInputPlanNode


     
      Plan p = env.createProgramPlan();
      OptimizedPlan op = compileNoStats(p);
     
      SinkPlanNode sink = op.getDataSinks().iterator().next();
      SingleInputPlanNode mapper = (SingleInputPlanNode) sink.getInput().getSource();
     
      assertEquals(TempMode.NONE, mapper.getInput().getTempMode());
    }
    catch (Exception e) {
      e.printStackTrace();
      fail(e.getMessage());
    }
View Full Code Here


       
        Plan p = env.createProgramPlan();
        OptimizedPlan op = compileNoStats(p);
       
        SinkPlanNode sink = op.getDataSinks().iterator().next();
        SingleInputPlanNode mapper = (SingleInputPlanNode) sink.getInput().getSource();
       
        assertEquals(TempMode.PIPELINE_BREAKER, mapper.getInput().getTempMode());
      }
      catch (Exception e) {
        e.printStackTrace();
        fail(e.getMessage());
      }
View Full Code Here

     
      Plan p = env.createProgramPlan();
      OptimizedPlan op = compileNoStats(p);
     
      SinkPlanNode sink = op.getDataSinks().iterator().next();
      SingleInputPlanNode mapper = (SingleInputPlanNode) sink.getInput().getSource();
     
      assertTrue(mapper.getInput().getTempMode().breaksPipeline());
    }
    catch (Exception e) {
      e.printStackTrace();
      fail(e.getMessage());
    }
View Full Code Here

     
      Plan p = env.createProgramPlan();
      OptimizedPlan op = compileNoStats(p);
     
      SinkPlanNode sink = op.getDataSinks().iterator().next();
      SingleInputPlanNode mapper = (SingleInputPlanNode) sink.getInput().getSource();
     
      assertTrue(mapper.getInput().getTempMode().breaksPipeline());
    }
    catch (Exception e) {
      e.printStackTrace();
      fail(e.getMessage());
    }
View Full Code Here

      Plan p = env.createProgramPlan();
      OptimizedPlan op = compileNoStats(p);
     
      SinkPlanNode sink = op.getDataSinks().iterator().next();
      BulkIterationPlanNode iterationPlanNode = (BulkIterationPlanNode) sink.getInput().getSource();
      SingleInputPlanNode mapper = (SingleInputPlanNode) iterationPlanNode.getRootOfStepFunction();
     
      assertTrue(mapper.getInput().getTempMode().breaksPipeline());
    }
    catch (Exception e) {
      e.printStackTrace();
      fail(e.getMessage());
    }
View Full Code Here

    }
   
    OptimizerPlanNodeResolver resolver = getOptimizerPlanNodeResolver(oPlan);
    DualInputPlanNode joinWithInvariantNode = resolver.getNode(JOIN_WITH_INVARIANT_NAME);
    DualInputPlanNode joinWithSolutionSetNode = resolver.getNode(JOIN_WITH_SOLUTION_SET);
    SingleInputPlanNode worksetReducer = resolver.getNode(NEXT_WORKSET_REDUCER_NAME);
    SingleInputPlanNode deltaMapper = resolver.getNode(SOLUTION_DELTA_MAPPER_NAME);
   
    // iteration preserves partitioning in reducer, so the first partitioning is out of the loop,
    // the in-loop partitioning is before the final reducer
   
    // verify joinWithInvariant
    assertEquals(ShipStrategyType.FORWARD, joinWithInvariantNode.getInput1().getShipStrategy());
    assertEquals(ShipStrategyType.PARTITION_HASH, joinWithInvariantNode.getInput2().getShipStrategy());
    assertEquals(list0, joinWithInvariantNode.getKeysForInput1());
    assertEquals(list0, joinWithInvariantNode.getKeysForInput2());
   
    // verify joinWithSolutionSet
    assertEquals(ShipStrategyType.FORWARD, joinWithSolutionSetNode.getInput1().getShipStrategy());
    assertEquals(ShipStrategyType.FORWARD, joinWithSolutionSetNode.getInput2().getShipStrategy());
   
    // verify reducer
    assertEquals(ShipStrategyType.PARTITION_HASH, worksetReducer.getInput().getShipStrategy());
    assertEquals(list0, worksetReducer.getKeys(0));
   
    // currently, the system may partition before or after the mapper
    ShipStrategyType ss1 = deltaMapper.getInput().getShipStrategy();
    ShipStrategyType ss2 = deltaMapper.getOutgoingChannels().get(0).getShipStrategy();
   
    assertTrue( (ss1 == ShipStrategyType.FORWARD && ss2 == ShipStrategyType.PARTITION_HASH) ||
          (ss2 == ShipStrategyType.FORWARD && ss1 == ShipStrategyType.PARTITION_HASH) );
   
    new NepheleJobGraphGenerator().compileJobGraph(oPlan);
View Full Code Here

    }
   
    OptimizerPlanNodeResolver resolver = getOptimizerPlanNodeResolver(oPlan);
    DualInputPlanNode joinWithInvariantNode = resolver.getNode(JOIN_WITH_INVARIANT_NAME);
    DualInputPlanNode joinWithSolutionSetNode = resolver.getNode(JOIN_WITH_SOLUTION_SET);
    SingleInputPlanNode worksetReducer = resolver.getNode(NEXT_WORKSET_REDUCER_NAME);
   
    // iteration preserves partitioning in reducer, so the first partitioning is out of the loop,
    // the in-loop partitioning is before the final reducer
   
    // verify joinWithInvariant
    assertEquals(ShipStrategyType.FORWARD, joinWithInvariantNode.getInput1().getShipStrategy());
    assertEquals(ShipStrategyType.PARTITION_HASH, joinWithInvariantNode.getInput2().getShipStrategy());
    assertEquals(list0, joinWithInvariantNode.getKeysForInput1());
    assertEquals(list0, joinWithInvariantNode.getKeysForInput2());
   
    // verify joinWithSolutionSet
    assertEquals(ShipStrategyType.FORWARD, joinWithSolutionSetNode.getInput1().getShipStrategy());
    assertEquals(ShipStrategyType.FORWARD, joinWithSolutionSetNode.getInput2().getShipStrategy());
   
    // verify reducer
    assertEquals(ShipStrategyType.PARTITION_HASH, worksetReducer.getInput().getShipStrategy());
    assertEquals(list0, worksetReducer.getKeys(0));
   
   
    // verify solution delta
    assertEquals(2, joinWithSolutionSetNode.getOutgoingChannels().size());
    assertEquals(ShipStrategyType.PARTITION_HASH, joinWithSolutionSetNode.getOutgoingChannels().get(0).getShipStrategy());
View Full Code Here

    }
   
    OptimizerPlanNodeResolver resolver = getOptimizerPlanNodeResolver(oPlan);
    DualInputPlanNode joinWithInvariantNode = resolver.getNode(JOIN_WITH_INVARIANT_NAME);
    DualInputPlanNode joinWithSolutionSetNode = resolver.getNode(JOIN_WITH_SOLUTION_SET);
    SingleInputPlanNode worksetReducer = resolver.getNode(NEXT_WORKSET_REDUCER_NAME);
   
    // iteration preserves partitioning in reducer, so the first partitioning is out of the loop,
    // the in-loop partitioning is before the final reducer
   
    // verify joinWithInvariant
    assertEquals(ShipStrategyType.FORWARD, joinWithInvariantNode.getInput1().getShipStrategy());
    assertEquals(ShipStrategyType.PARTITION_HASH, joinWithInvariantNode.getInput2().getShipStrategy());
    assertEquals(list0, joinWithInvariantNode.getKeysForInput1());
    assertEquals(list0, joinWithInvariantNode.getKeysForInput2());
   
    // verify joinWithSolutionSet
    assertEquals(ShipStrategyType.FORWARD, joinWithSolutionSetNode.getInput1().getShipStrategy());
    assertEquals(ShipStrategyType.FORWARD, joinWithSolutionSetNode.getInput2().getShipStrategy());
   
    // verify reducer
    assertEquals(ShipStrategyType.FORWARD, worksetReducer.getInput().getShipStrategy());
    assertEquals(list0, worksetReducer.getKeys(0));
   
   
    // verify solution delta
    assertEquals(1, joinWithSolutionSetNode.getOutgoingChannels().size());
    assertEquals(ShipStrategyType.FORWARD, joinWithSolutionSetNode.getOutgoingChannels().get(0).getShipStrategy());
View Full Code Here

      SourcePlanNode otherTarget = new SourcePlanNode(getSourceNode(), "Source");
     
      Channel toMap1 = new Channel(target);
      toMap1.setShipStrategy(ShipStrategyType.FORWARD);
      toMap1.setLocalStrategy(LocalStrategy.NONE);
      SingleInputPlanNode map1 = new SingleInputPlanNode(getMapNode(), "Mapper 1", toMap1, DriverStrategy.MAP);
     
      Channel toMap2 = new Channel(map1);
      toMap2.setShipStrategy(ShipStrategyType.FORWARD);
      toMap2.setLocalStrategy(LocalStrategy.NONE);
      SingleInputPlanNode map2 = new SingleInputPlanNode(getMapNode(), "Mapper 2", toMap2, DriverStrategy.MAP);
     
      {
        GlobalProperties gp = new GlobalProperties();
        LocalProperties lp = new LocalProperties();
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(otherTarget, gp, lp);
        assertTrue(report == NO_PARTIAL_SOLUTION);
      }
    }
    catch (Exception e) {
      e.printStackTrace();
View Full Code Here

      SourcePlanNode target = new SourcePlanNode(getSourceNode(), "Source");
     
      Channel toMap1 = new Channel(target);
      toMap1.setShipStrategy(ShipStrategyType.FORWARD);
      toMap1.setLocalStrategy(LocalStrategy.NONE);
      SingleInputPlanNode map1 = new SingleInputPlanNode(getMapNode(), "Mapper 1", toMap1, DriverStrategy.MAP);
     
      Channel toMap2 = new Channel(map1);
      toMap2.setShipStrategy(ShipStrategyType.FORWARD);
      toMap2.setLocalStrategy(LocalStrategy.NONE);
      SingleInputPlanNode map2 = new SingleInputPlanNode(getMapNode(), "Mapper 2", toMap2, DriverStrategy.MAP);
     
      // no feedback properties and none are ever required and present
      {
        GlobalProperties gp = new GlobalProperties();
        LocalProperties lp = new LocalProperties();
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertTrue(report != null && report != NO_PARTIAL_SOLUTION && report != NOT_MET);
      }
     
      // some global feedback properties and none are ever required and present
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(2, 5));
        LocalProperties lp = new LocalProperties();
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertTrue(report != null && report != NO_PARTIAL_SOLUTION && report != NOT_MET);
      }
     
      // some local feedback properties and none are ever required and present
      {
        GlobalProperties gp = new GlobalProperties();
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(1, 2));
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertTrue(report != null && report != NO_PARTIAL_SOLUTION && report != NOT_MET);
      }
     
      // some global and local feedback properties and none are ever required and present
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(2, 5));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(1, 2));
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertTrue(report != null && report != NO_PARTIAL_SOLUTION && report != NOT_MET);
      }
     
      // --------------------------- requirements on channel 1 -----------------------
     
      // some required global properties, which are matched exactly
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(2, 5));
        LocalProperties lp = new LocalProperties();
       
        RequestedGlobalProperties reqGp = new RequestedGlobalProperties();
        reqGp.setHashPartitioned(new FieldList(2, 5));
       
        toMap1.setRequiredGlobalProps(reqGp);
        toMap1.setRequiredLocalProps(null);
       
        toMap2.setRequiredGlobalProps(null);
        toMap2.setRequiredLocalProps(null);
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertTrue(report != null && report != NO_PARTIAL_SOLUTION && report != NOT_MET);
      }
     
      // some required local properties, which are matched exactly
      {
        GlobalProperties gp = new GlobalProperties();
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(1, 2));
       
        RequestedLocalProperties reqLp = new RequestedLocalProperties();
        reqLp.setGroupedFields(new FieldList(1, 2));
       
        toMap1.setRequiredGlobalProps(null);
        toMap1.setRequiredLocalProps(reqLp);
       
        toMap2.setRequiredGlobalProps(null);
        toMap2.setRequiredLocalProps(null);
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertTrue(report != null && report != NO_PARTIAL_SOLUTION && report != NOT_MET);
      }
     
      // some required global and local properties, which are matched exactly
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(2, 5));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(1, 2));
       
        RequestedGlobalProperties reqGp = new RequestedGlobalProperties();
        reqGp.setHashPartitioned(new FieldList(2, 5));
       
        RequestedLocalProperties reqLp = new RequestedLocalProperties();
        reqLp.setGroupedFields(new FieldList(1, 2));
       
        toMap1.setRequiredGlobalProps(reqGp);
        toMap1.setRequiredLocalProps(reqLp);
       
        toMap2.setRequiredGlobalProps(null);
        toMap2.setRequiredLocalProps(null);
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertTrue(report != null && report != NO_PARTIAL_SOLUTION && report != NOT_MET);
      }
     
      // some required global and local properties, which are over-fulfilled
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(2));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(1, 2));
       
        RequestedGlobalProperties reqGp = new RequestedGlobalProperties();
        reqGp.setHashPartitioned(new FieldList(2, 5));
       
        RequestedLocalProperties reqLp = new RequestedLocalProperties();
        reqLp.setGroupedFields(new FieldList(1));
       
        toMap1.setRequiredGlobalProps(reqGp);
        toMap1.setRequiredLocalProps(reqLp);
       
        toMap2.setRequiredGlobalProps(null);
        toMap2.setRequiredLocalProps(null);
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertTrue(report != null && report != NO_PARTIAL_SOLUTION && report != NOT_MET);
      }
     
      // some required global properties that are not met
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(2, 1));
        LocalProperties lp = new LocalProperties();
       
        RequestedGlobalProperties reqGp = new RequestedGlobalProperties();
        reqGp.setHashPartitioned(new FieldList(2, 5));
       
        toMap1.setRequiredGlobalProps(reqGp);
        toMap1.setRequiredLocalProps(null);
       
        toMap2.setRequiredGlobalProps(null);
        toMap2.setRequiredLocalProps(null);
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertEquals(NOT_MET, report);
      }
     
      // some required local properties that are not met
      {
        GlobalProperties gp = new GlobalProperties();
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(1));
       
        RequestedLocalProperties reqLp = new RequestedLocalProperties();
        reqLp.setGroupedFields(new FieldList(2, 1));
       
        toMap1.setRequiredGlobalProps(null);
        toMap1.setRequiredLocalProps(reqLp);
       
        toMap2.setRequiredGlobalProps(null);
        toMap2.setRequiredLocalProps(null);
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertEquals(NOT_MET, report);
      }
     
      // some required global and local properties where the global properties are not met
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(2, 1));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(1));
       
        RequestedGlobalProperties reqGp = new RequestedGlobalProperties();
        reqGp.setAnyPartitioning(new FieldList(2, 5));
       
        RequestedLocalProperties reqLp = new RequestedLocalProperties();
        reqLp.setGroupedFields(new FieldList(1));
       
        toMap1.setRequiredGlobalProps(reqGp);
        toMap1.setRequiredLocalProps(reqLp);
       
        toMap2.setRequiredGlobalProps(null);
        toMap2.setRequiredLocalProps(null);
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertEquals(NOT_MET, report);
      }
     
      // some required global and local properties where the local properties are not met
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(1));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(1));
       
        RequestedGlobalProperties reqGp = new RequestedGlobalProperties();
        reqGp.setAnyPartitioning(new FieldList(1));
       
        RequestedLocalProperties reqLp = new RequestedLocalProperties();
        reqLp.setGroupedFields(new FieldList(2));
       
        toMap1.setRequiredGlobalProps(reqGp);
        toMap1.setRequiredLocalProps(reqLp);
       
        toMap2.setRequiredGlobalProps(null);
        toMap2.setRequiredLocalProps(null);
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertEquals(NOT_MET, report);
      }
     
      // --------------------------- requirements on channel 2 -----------------------
     
      // some required global properties, which are matched exactly
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(2, 5));
        LocalProperties lp = new LocalProperties();
       
        RequestedGlobalProperties reqGp = new RequestedGlobalProperties();
        reqGp.setHashPartitioned(new FieldList(2, 5));
       
        toMap1.setRequiredGlobalProps(null);
        toMap1.setRequiredLocalProps(null);
       
        toMap2.setRequiredGlobalProps(reqGp);
        toMap2.setRequiredLocalProps(null);
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertTrue(report != null && report != NO_PARTIAL_SOLUTION && report != NOT_MET);
      }
     
      // some required local properties, which are matched exactly
      {
        GlobalProperties gp = new GlobalProperties();
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(1, 2));
       
        RequestedLocalProperties reqLp = new RequestedLocalProperties();
        reqLp.setGroupedFields(new FieldList(1, 2));
       
        toMap1.setRequiredGlobalProps(null);
        toMap1.setRequiredLocalProps(null);
       
        toMap2.setRequiredGlobalProps(null);
        toMap2.setRequiredLocalProps(reqLp);
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertTrue(report != null && report != NO_PARTIAL_SOLUTION && report != NOT_MET);
      }
     
      // some required global and local properties, which are matched exactly
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(2, 5));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(1, 2));
       
        RequestedGlobalProperties reqGp = new RequestedGlobalProperties();
        reqGp.setHashPartitioned(new FieldList(2, 5));
       
        RequestedLocalProperties reqLp = new RequestedLocalProperties();
        reqLp.setGroupedFields(new FieldList(1, 2));
       
        toMap1.setRequiredGlobalProps(null);
        toMap1.setRequiredLocalProps(null);
       
        toMap2.setRequiredGlobalProps(reqGp);
        toMap2.setRequiredLocalProps(reqLp);
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertTrue(report != null && report != NO_PARTIAL_SOLUTION && report != NOT_MET);
      }
     
      // some required global and local properties, which are over-fulfilled
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(2));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(1, 2));
       
        RequestedGlobalProperties reqGp = new RequestedGlobalProperties();
        reqGp.setHashPartitioned(new FieldList(2, 5));
       
        RequestedLocalProperties reqLp = new RequestedLocalProperties();
        reqLp.setGroupedFields(new FieldList(1));
       
        toMap1.setRequiredGlobalProps(null);
        toMap1.setRequiredLocalProps(null);
       
        toMap2.setRequiredGlobalProps(reqGp);
        toMap2.setRequiredLocalProps(reqLp);
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertTrue(report != null && report != NO_PARTIAL_SOLUTION && report != NOT_MET);
      }
     
      // some required global properties that are not met
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(2, 1));
        LocalProperties lp = new LocalProperties();
       
        RequestedGlobalProperties reqGp = new RequestedGlobalProperties();
        reqGp.setHashPartitioned(new FieldList(2, 5));
       
        toMap1.setRequiredGlobalProps(null);
        toMap1.setRequiredLocalProps(null);
       
        toMap2.setRequiredGlobalProps(reqGp);
        toMap2.setRequiredLocalProps(null);
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertEquals(NOT_MET, report);
      }
     
      // some required local properties that are not met
      {
        GlobalProperties gp = new GlobalProperties();
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(1));
       
        RequestedLocalProperties reqLp = new RequestedLocalProperties();
        reqLp.setGroupedFields(new FieldList(2, 1));
       
        toMap1.setRequiredGlobalProps(null);
        toMap1.setRequiredLocalProps(null);
       
        toMap2.setRequiredGlobalProps(null);
        toMap2.setRequiredLocalProps(reqLp);
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertEquals(NOT_MET, report);
      }
     
      // some required global and local properties where the global properties are not met
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(2, 1));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(1));
       
        RequestedGlobalProperties reqGp = new RequestedGlobalProperties();
        reqGp.setAnyPartitioning(new FieldList(2, 5));
       
        RequestedLocalProperties reqLp = new RequestedLocalProperties();
        reqLp.setGroupedFields(new FieldList(1));
       
        toMap1.setRequiredGlobalProps(null);
        toMap1.setRequiredLocalProps(null);
       
        toMap2.setRequiredGlobalProps(reqGp);
        toMap2.setRequiredLocalProps(reqLp);
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertEquals(NOT_MET, report);
      }
     
      // some required global and local properties where the local properties are not met
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(1));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(1));
       
        RequestedGlobalProperties reqGp = new RequestedGlobalProperties();
        reqGp.setAnyPartitioning(new FieldList(1));
       
        RequestedLocalProperties reqLp = new RequestedLocalProperties();
        reqLp.setGroupedFields(new FieldList(2));
       
        toMap1.setRequiredGlobalProps(null);
        toMap1.setRequiredLocalProps(null);
       
        toMap2.setRequiredGlobalProps(reqGp);
        toMap2.setRequiredLocalProps(reqLp);
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertEquals(NOT_MET, report);
      }
     
      // ---------------------- requirements mixed on 1 and 2 -----------------------
     
      // some required global properties at step one and some more at step 2
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(1, 2));
        LocalProperties lp = LocalProperties.EMPTY;
       
        RequestedGlobalProperties reqGp1 = new RequestedGlobalProperties();
        reqGp1.setAnyPartitioning(new FieldList(1, 2));
       
        RequestedGlobalProperties reqGp2 = new RequestedGlobalProperties();
        reqGp2.setHashPartitioned(new FieldList(1, 2));
       
        toMap1.setRequiredGlobalProps(reqGp1);
        toMap1.setRequiredLocalProps(null);
       
        toMap2.setRequiredGlobalProps(reqGp2);
        toMap2.setRequiredLocalProps(null);
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertTrue(report != null && report != NO_PARTIAL_SOLUTION && report != NOT_MET);
      }
     
      // some required local properties at step one and some more at step 2
      {
        GlobalProperties gp = new GlobalProperties();
        LocalProperties lp = LocalProperties.forOrdering(new Ordering(3, null, Order.ASCENDING).appendOrdering(1, null, Order.DESCENDING));
       
        RequestedLocalProperties reqLp1 = new RequestedLocalProperties();
        reqLp1.setGroupedFields(new FieldList(3, 1));
       
        RequestedLocalProperties reqLp2 = new RequestedLocalProperties();
        reqLp2.setOrdering(new Ordering(3, null, Order.ANY).appendOrdering(1, null, Order.ANY));
       
        toMap1.setRequiredGlobalProps(null);
        toMap1.setRequiredLocalProps(reqLp1);
       
        toMap2.setRequiredGlobalProps(null);
        toMap2.setRequiredLocalProps(reqLp2);
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertTrue(report != null && report != NO_PARTIAL_SOLUTION && report != NOT_MET);
      }
     
      // some required global properties at step one and some local ones at step 2
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(1, 2));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(2, 1));
       
        RequestedGlobalProperties reqGp = new RequestedGlobalProperties();
        reqGp.setAnyPartitioning(new FieldList(1, 2));
       
        RequestedLocalProperties reqLp = new RequestedLocalProperties();
        reqLp.setGroupedFields(new FieldList(2));
       
        toMap1.setRequiredGlobalProps(reqGp);
        toMap1.setRequiredLocalProps(null);
       
        toMap2.setRequiredGlobalProps(null);
        toMap2.setRequiredLocalProps(reqLp);
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertTrue(report != null && report != NO_PARTIAL_SOLUTION && report != NOT_MET);
      }
     
      // some required local properties at step one and some global ones at step 2
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(1, 2));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(2, 1));
       
        RequestedGlobalProperties reqGp = new RequestedGlobalProperties();
        reqGp.setAnyPartitioning(new FieldList(1, 2));
       
        RequestedLocalProperties reqLp = new RequestedLocalProperties();
        reqLp.setGroupedFields(new FieldList(2));
       
        toMap1.setRequiredGlobalProps(null);
        toMap1.setRequiredLocalProps(reqLp);
       
        toMap2.setRequiredGlobalProps(reqGp);
        toMap2.setRequiredLocalProps(null);
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertTrue(report != null && report != NO_PARTIAL_SOLUTION && report != NOT_MET);
      }
     
      // some fulfilled global properties at step one and some non-fulfilled local ones at step 2
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(1, 2));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(2, 1));
       
        RequestedGlobalProperties reqGp = new RequestedGlobalProperties();
        reqGp.setAnyPartitioning(new FieldList(1, 2));
       
        RequestedLocalProperties reqLp = new RequestedLocalProperties();
        reqLp.setGroupedFields(new FieldList(2, 3));
       
        toMap1.setRequiredGlobalProps(reqGp);
        toMap1.setRequiredLocalProps(null);
       
        toMap2.setRequiredGlobalProps(null);
        toMap2.setRequiredLocalProps(reqLp);
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertEquals(NOT_MET, report);
      }
     
      // some fulfilled local properties at step one and some non-fulfilled global ones at step 2
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(1, 2));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(2, 1));
       
        RequestedGlobalProperties reqGp = new RequestedGlobalProperties();
        reqGp.setAnyPartitioning(new FieldList(2, 3));
       
        RequestedLocalProperties reqLp = new RequestedLocalProperties();
        reqLp.setGroupedFields(new FieldList(2, 1));
       
        toMap1.setRequiredGlobalProps(null);
        toMap1.setRequiredLocalProps(reqLp);
       
        toMap2.setRequiredGlobalProps(reqGp);
        toMap2.setRequiredLocalProps(null);
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertEquals(NOT_MET, report);
      }
     
      // some non-fulfilled global properties at step one and some fulfilled local ones at step 2
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(1, 2));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(2, 1));
       
        RequestedGlobalProperties reqGp = new RequestedGlobalProperties();
        reqGp.setAnyPartitioning(new FieldList(2, 3));
       
        RequestedLocalProperties reqLp = new RequestedLocalProperties();
        reqLp.setGroupedFields(new FieldList(2, 1));
       
        toMap1.setRequiredGlobalProps(reqGp);
        toMap1.setRequiredLocalProps(null);
       
        toMap2.setRequiredGlobalProps(null);
        toMap2.setRequiredLocalProps(reqLp);
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertEquals(NOT_MET, report);
      }
     
      // some non-fulfilled local properties at step one and some fulfilled global ones at step 2
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(1, 2));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(2, 1));
       
        RequestedGlobalProperties reqGp = new RequestedGlobalProperties();
        reqGp.setAnyPartitioning(new FieldList(1, 2));
       
        RequestedLocalProperties reqLp = new RequestedLocalProperties();
        reqLp.setGroupedFields(new FieldList(2, 1, 3));
       
        toMap1.setRequiredGlobalProps(null);
        toMap1.setRequiredLocalProps(reqLp);
       
        toMap2.setRequiredGlobalProps(reqGp);
        toMap2.setRequiredLocalProps(null);
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertEquals(NOT_MET, report);
      }
    }
    catch (Exception e) {
      e.printStackTrace();
View Full Code Here

TOP

Related Classes of org.apache.flink.compiler.plan.SingleInputPlanNode

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.