Package org.apache.flink.api.common.operators.util

Examples of org.apache.flink.api.common.operators.util.FieldList


      }
     
      // 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);
View Full Code Here


      SingleInputPlanNode map2 = new SingleInputPlanNode(getMapNode(), "Mapper 2", toMap2, DriverStrategy.MAP);
     
      // set ship strategy in first channel, so later non matching global properties do not matter
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(1, 2));
        LocalProperties lp = LocalProperties.EMPTY;
       
        RequestedGlobalProperties reqGp = new RequestedGlobalProperties();
        reqGp.setAnyPartitioning(new FieldSet(2, 5));
       
        toMap1.setShipStrategy(ShipStrategyType.PARTITION_HASH, new FieldList(2, 5));
        toMap1.setLocalStrategy(LocalStrategy.NONE);
       
        toMap2.setShipStrategy(ShipStrategyType.FORWARD);
        toMap2.setLocalStrategy(LocalStrategy.NONE);
       
       
        toMap1.setRequiredGlobalProps(null);
        toMap1.setRequiredLocalProps(null);
       
        toMap2.setRequiredGlobalProps(reqGp);
        toMap2.setRequiredLocalProps(null);
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertEquals(MET, report);
      }
     
      // set ship strategy in second channel, so previous non matching global properties void the match
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(1, 2));
        LocalProperties lp = LocalProperties.EMPTY;
       
        RequestedGlobalProperties reqGp = new RequestedGlobalProperties();
        reqGp.setAnyPartitioning(new FieldSet(2, 5));
       
        toMap1.setShipStrategy(ShipStrategyType.FORWARD);
        toMap1.setLocalStrategy(LocalStrategy.NONE);
       
        toMap2.setShipStrategy(ShipStrategyType.PARTITION_HASH, new FieldList(2, 5));
        toMap2.setLocalStrategy(LocalStrategy.NONE);
       
       
        toMap1.setRequiredGlobalProps(reqGp);
        toMap1.setRequiredLocalProps(null);
       
        toMap2.setRequiredGlobalProps(null);
        toMap2.setRequiredLocalProps(null);
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertEquals(NOT_MET, report);
      }
     
      // set local strategy in first channel, so later non matching local properties do not matter
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(1, 2));
        LocalProperties lp = LocalProperties.forOrdering(new Ordering(3, null, Order.ASCENDING).appendOrdering(1, null, Order.DESCENDING));
       
        RequestedLocalProperties reqLp = new RequestedLocalProperties();
        reqLp.setGroupedFields(new FieldList(4, 1));
       
        toMap1.setShipStrategy(ShipStrategyType.FORWARD);
        toMap1.setLocalStrategy(LocalStrategy.SORT, new FieldList(5, 7), new boolean[] {false, false});
       
        toMap2.setShipStrategy(ShipStrategyType.FORWARD);
        toMap2.setLocalStrategy(LocalStrategy.NONE);
       
        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);
      }
     
      // set local strategy in second channel, so previous non matching local properties void the match
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(1, 2));
        LocalProperties lp = LocalProperties.forOrdering(new Ordering(3, null, Order.ASCENDING).appendOrdering(1, null, Order.DESCENDING));
       
        RequestedLocalProperties reqLp = new RequestedLocalProperties();
        reqLp.setGroupedFields(new FieldList(4, 1));
       
        toMap1.setShipStrategy(ShipStrategyType.FORWARD);
        toMap1.setLocalStrategy(LocalStrategy.NONE);
       
        toMap2.setShipStrategy(ShipStrategyType.FORWARD);
        toMap2.setLocalStrategy(LocalStrategy.SORT, new FieldList(5, 7), new boolean[] {false, false});
       
       
        toMap1.setRequiredGlobalProps(null);
        toMap1.setRequiredLocalProps(reqLp);
       
        toMap2.setRequiredGlobalProps(null);
        toMap2.setRequiredLocalProps(null);
       
        FeedbackPropertiesMeetRequirementsReport report = map2.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertEquals(NOT_MET, report);
      }
     
      // create the properties on the same node as the requirement
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(1, 2));
        LocalProperties lp = LocalProperties.forOrdering(new Ordering(3, null, Order.ASCENDING).appendOrdering(1, null, Order.DESCENDING));
       
        RequestedGlobalProperties reqGp = new RequestedGlobalProperties();
        reqGp.setAnyPartitioning(new FieldSet(5, 7));
       
        RequestedLocalProperties reqLp = new RequestedLocalProperties();
        reqLp.setGroupedFields(new FieldList(5, 7));
       
        toMap1.setShipStrategy(ShipStrategyType.PARTITION_HASH, new FieldList(5, 7));
        toMap1.setLocalStrategy(LocalStrategy.SORT, new FieldList(5, 7), new boolean[] {false, false});
       
        toMap2.setShipStrategy(ShipStrategyType.FORWARD);
        toMap2.setLocalStrategy(LocalStrategy.NONE);
       
        toMap1.setRequiredGlobalProps(reqGp);
View Full Code Here

      {
        GlobalProperties gp = new GlobalProperties();
        LocalProperties lp = LocalProperties.forOrdering(new Ordering(3, null, Order.ASCENDING).appendOrdering(1, null, Order.DESCENDING));
       
        RequestedLocalProperties reqLp = new RequestedLocalProperties();
        reqLp.setGroupedFields(new FieldList(4, 1));
       
        toMap1.setShipStrategy(ShipStrategyType.FORWARD);
        toMap1.setLocalStrategy(LocalStrategy.SORT, new FieldList(5, 7), new boolean[] {false, false});
       
        toMap2.setShipStrategy(ShipStrategyType.FORWARD);
        toMap2.setLocalStrategy(LocalStrategy.NONE);
       
        toMap3.setShipStrategy(ShipStrategyType.FORWARD);
        toMap3.setLocalStrategy(LocalStrategy.NONE);
       
        toMap1.setRequiredGlobalProps(null);
        toMap1.setRequiredLocalProps(null);
       
        toMap2.setRequiredGlobalProps(null);
        toMap2.setRequiredLocalProps(null);
       
        toMap3.setRequiredGlobalProps(null);
        toMap3.setRequiredLocalProps(reqLp);
       
        FeedbackPropertiesMeetRequirementsReport report = map3.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertTrue(report != null && report != NO_PARTIAL_SOLUTION && report != NOT_MET);
      }
     
      // set global strategy in first channel, so later non matching global properties do not matter
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(5, 3));
        LocalProperties lp = LocalProperties.EMPTY;
       
        RequestedGlobalProperties reqGp = new RequestedGlobalProperties();
        reqGp.setAnyPartitioning(new FieldSet(2, 3));
       
        toMap1.setShipStrategy(ShipStrategyType.PARTITION_HASH, new FieldList(1, 2));
        toMap1.setLocalStrategy(LocalStrategy.NONE);
       
        toMap2.setShipStrategy(ShipStrategyType.FORWARD);
        toMap2.setLocalStrategy(LocalStrategy.NONE);
       
View Full Code Here

      SingleInputPlanNode afterJoin = new SingleInputPlanNode(getMapNode(), "After Join Mapper", toAfterJoin, DriverStrategy.MAP);
     
      // attach some properties to the non-relevant input
      {
        toMap2.setShipStrategy(ShipStrategyType.BROADCAST);
        toMap2.setLocalStrategy(LocalStrategy.SORT, new FieldList(2, 7), new boolean[] {true, true});
       
        RequestedGlobalProperties joinGp = new RequestedGlobalProperties();
        joinGp.setFullyReplicated();
       
        RequestedLocalProperties joinLp = new RequestedLocalProperties();
        joinLp.setOrdering(new Ordering(2, null, Order.ASCENDING).appendOrdering(7, null, Order.ASCENDING));
       
        toJoin2.setShipStrategy(ShipStrategyType.FORWARD);
        toJoin2.setLocalStrategy(LocalStrategy.NONE);
        toJoin2.setRequiredGlobalProps(joinGp);
        toJoin2.setRequiredLocalProps(joinLp);
      }
     
      // ------------------------------------------------------------------------------------
     
      // no properties from the partial solution, no required properties
      {
        toJoin1.setShipStrategy(ShipStrategyType.FORWARD);
        toJoin1.setLocalStrategy(LocalStrategy.NONE);
       
        GlobalProperties gp = new GlobalProperties();
        LocalProperties lp = LocalProperties.EMPTY;
       
        FeedbackPropertiesMeetRequirementsReport report = join.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertTrue(report != null && report != NO_PARTIAL_SOLUTION && report != NOT_MET);
      }
     
      // some properties from the partial solution, no required properties
      {
        toJoin1.setShipStrategy(ShipStrategyType.FORWARD);
        toJoin1.setLocalStrategy(LocalStrategy.NONE);
       
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(0));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(2, 1));
       
        FeedbackPropertiesMeetRequirementsReport report = join.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertTrue(report != null && report != NO_PARTIAL_SOLUTION && report != NOT_MET);
      }
     
     
      // produced properties match relevant input
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(0));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(2, 1));
       
        RequestedGlobalProperties rgp = new RequestedGlobalProperties();
        rgp.setHashPartitioned(new FieldList(0));
       
        RequestedLocalProperties rlp = new RequestedLocalProperties();
        rlp.setGroupedFields(new FieldList(2));
       
        toJoin1.setRequiredGlobalProps(rgp);
        toJoin1.setRequiredLocalProps(rlp);
       
        toJoin1.setShipStrategy(ShipStrategyType.FORWARD);
        toJoin1.setLocalStrategy(LocalStrategy.NONE);
       
        FeedbackPropertiesMeetRequirementsReport report = join.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertTrue(report != null && report != NO_PARTIAL_SOLUTION && report != NOT_MET);
      }
     
      // produced properties do not match relevant input
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(0));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(2, 1));
       
        RequestedGlobalProperties rgp = new RequestedGlobalProperties();
        rgp.setHashPartitioned(new FieldList(0));
       
        RequestedLocalProperties rlp = new RequestedLocalProperties();
        rlp.setGroupedFields(new FieldList(1, 2, 3));
       
        toJoin1.setRequiredGlobalProps(rgp);
        toJoin1.setRequiredLocalProps(rlp);
       
        toJoin1.setShipStrategy(ShipStrategyType.FORWARD);
        toJoin1.setLocalStrategy(LocalStrategy.NONE);
       
        FeedbackPropertiesMeetRequirementsReport report = join.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertEquals(NOT_MET, report);
      }
     
      // produced properties overridden before join
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(0));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(2, 1));
       
        RequestedGlobalProperties rgp = new RequestedGlobalProperties();
        rgp.setHashPartitioned(new FieldList(0));
       
        RequestedLocalProperties rlp = new RequestedLocalProperties();
        rlp.setGroupedFields(new FieldList(2, 1));
       
        toMap1.setRequiredGlobalProps(rgp);
        toMap1.setRequiredLocalProps(rlp);
       
        toJoin1.setRequiredGlobalProps(null);
        toJoin1.setRequiredLocalProps(null);
       
        toJoin1.setShipStrategy(ShipStrategyType.PARTITION_HASH, new FieldList(2, 1));
        toJoin1.setLocalStrategy(LocalStrategy.SORT, new FieldList(7, 3), new boolean[] {true, false});
       
        FeedbackPropertiesMeetRequirementsReport report = join.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertEquals(MET, report);
      }
     
      // produced properties before join match, after join match as well
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(0));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(2, 1));
       
        RequestedGlobalProperties rgp = new RequestedGlobalProperties();
        rgp.setHashPartitioned(new FieldList(0));
       
        RequestedLocalProperties rlp = new RequestedLocalProperties();
        rlp.setGroupedFields(new FieldList(2, 1));
       
        toMap1.setRequiredGlobalProps(null);
        toMap1.setRequiredLocalProps(null);
       
        toJoin1.setShipStrategy(ShipStrategyType.FORWARD);
        toJoin1.setLocalStrategy(LocalStrategy.NONE);
       
        toJoin1.setRequiredGlobalProps(rgp);
        toJoin1.setRequiredLocalProps(rlp);
     
        toAfterJoin.setShipStrategy(ShipStrategyType.FORWARD);
        toAfterJoin.setLocalStrategy(LocalStrategy.NONE);
       
        toAfterJoin.setRequiredGlobalProps(rgp);
        toAfterJoin.setRequiredLocalProps(rlp);
       
        FeedbackPropertiesMeetRequirementsReport report = join.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertTrue(report != null && report != NO_PARTIAL_SOLUTION && report != NOT_MET);
      }
     
      // produced properties before join match, after join do not match
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(0));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(2, 1));
       
        RequestedGlobalProperties rgp1 = new RequestedGlobalProperties();
        rgp1.setHashPartitioned(new FieldList(0));
       
        RequestedGlobalProperties rgp2 = new RequestedGlobalProperties();
        rgp2.setHashPartitioned(new FieldList(3));
       
        RequestedLocalProperties rlp1 = new RequestedLocalProperties();
        rlp1.setGroupedFields(new FieldList(2, 1));
       
        RequestedLocalProperties rlp2 = new RequestedLocalProperties();
        rlp2.setGroupedFields(new FieldList(3, 4));
       
        toJoin1.setRequiredGlobalProps(rgp1);
        toJoin1.setRequiredLocalProps(rlp1);
     
        toAfterJoin.setShipStrategy(ShipStrategyType.FORWARD);
        toAfterJoin.setLocalStrategy(LocalStrategy.NONE);
       
        toAfterJoin.setRequiredGlobalProps(rgp2);
        toAfterJoin.setRequiredLocalProps(rlp2);
       
        FeedbackPropertiesMeetRequirementsReport report = afterJoin.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertEquals(NOT_MET, report);
      }
     
      // produced properties are overridden, does not matter that they do not match
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setAnyPartitioning(new FieldList(0));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(2, 1));
       
        RequestedGlobalProperties rgp = new RequestedGlobalProperties();
        rgp.setHashPartitioned(new FieldList(1));
       
        RequestedLocalProperties rlp = new RequestedLocalProperties();
        rlp.setGroupedFields(new FieldList(1, 2, 3));
       
        toJoin1.setRequiredGlobalProps(null);
        toJoin1.setRequiredLocalProps(null);
       
        toJoin1.setShipStrategy(ShipStrategyType.PARTITION_HASH, new FieldList(2, 1));
        toJoin1.setLocalStrategy(LocalStrategy.SORT, new FieldList(7, 3), new boolean[] {true, false});
       
        toAfterJoin.setRequiredGlobalProps(rgp);
        toAfterJoin.setRequiredLocalProps(rlp);
       
        FeedbackPropertiesMeetRequirementsReport report = afterJoin.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertEquals(MET, report);
      }
     
      // local property overridden before join, local property mismatch after join not relevant
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setAnyPartitioning(new FieldList(0));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(2, 1));
       
        RequestedLocalProperties rlp = new RequestedLocalProperties();
        rlp.setGroupedFields(new FieldList(1, 2, 3));
       
        toJoin1.setRequiredGlobalProps(null);
        toJoin1.setRequiredLocalProps(null);
       
        toJoin1.setShipStrategy(ShipStrategyType.FORWARD);
        toJoin1.setLocalStrategy(LocalStrategy.SORT, new FieldList(7, 3), new boolean[] {true, false});
       
        toAfterJoin.setRequiredGlobalProps(null);
        toAfterJoin.setRequiredLocalProps(rlp);
       
        FeedbackPropertiesMeetRequirementsReport report = afterJoin.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertTrue(report != null && report != NO_PARTIAL_SOLUTION && report != NOT_MET);
      }
     
      // local property overridden before join, global property mismatch after join void the match
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setAnyPartitioning(new FieldList(0));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(2, 1));
       
        RequestedGlobalProperties rgp = new RequestedGlobalProperties();
        rgp.setHashPartitioned(new FieldList(1));
       
        RequestedLocalProperties rlp = new RequestedLocalProperties();
        rlp.setGroupedFields(new FieldList(1, 2, 3));
       
        toJoin1.setRequiredGlobalProps(null);
        toJoin1.setRequiredLocalProps(null);
       
        toJoin1.setShipStrategy(ShipStrategyType.FORWARD);
        toJoin1.setLocalStrategy(LocalStrategy.SORT, new FieldList(7, 3), new boolean[] {true, false});
       
        toAfterJoin.setRequiredGlobalProps(rgp);
        toAfterJoin.setRequiredLocalProps(rlp);
       
        FeedbackPropertiesMeetRequirementsReport report = afterJoin.checkPartialSolutionPropertiesMet(target, gp, lp);
View Full Code Here

      }
     
      // some properties from the partial solution, no required properties
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(0));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(2, 1));
       
        FeedbackPropertiesMeetRequirementsReport report = afterJoin.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertTrue(report != null && report != NO_PARTIAL_SOLUTION && report != NOT_MET);
      }
     
      // test requirements on one input and met
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(0));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(2, 1));
       
        RequestedGlobalProperties rgp = new RequestedGlobalProperties();
        rgp.setHashPartitioned(new FieldList(0));
       
        RequestedLocalProperties rlp = new RequestedLocalProperties();
        rlp.setGroupedFields(new FieldList(2, 1));
       
        toJoin1.setRequiredGlobalProps(rgp);
        toJoin1.setRequiredLocalProps(rlp);
       
        FeedbackPropertiesMeetRequirementsReport report = afterJoin.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertTrue(report != null && report != NO_PARTIAL_SOLUTION && report != NOT_MET);
      }
     
      // test requirements on both input and met
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(0));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(2, 1));
       
        RequestedGlobalProperties rgp = new RequestedGlobalProperties();
        rgp.setHashPartitioned(new FieldList(0));
       
        RequestedLocalProperties rlp = new RequestedLocalProperties();
        rlp.setGroupedFields(new FieldList(2, 1));
       
        toJoin1.setRequiredGlobalProps(rgp);
        toJoin1.setRequiredLocalProps(rlp);
       
        toJoin2.setRequiredGlobalProps(rgp);
        toJoin2.setRequiredLocalProps(rlp);
       
        FeedbackPropertiesMeetRequirementsReport report = afterJoin.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertTrue(report != null && report != NO_PARTIAL_SOLUTION && report != NOT_MET);
      }
     
      // test requirements on both inputs, one not met
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(0));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(2, 1));
       
        RequestedGlobalProperties rgp1 = new RequestedGlobalProperties();
        rgp1.setHashPartitioned(new FieldList(0));
       
        RequestedLocalProperties rlp1 = new RequestedLocalProperties();
        rlp1.setGroupedFields(new FieldList(2, 1));
       
        RequestedGlobalProperties rgp2 = new RequestedGlobalProperties();
        rgp2.setHashPartitioned(new FieldList(1));
       
        RequestedLocalProperties rlp2 = new RequestedLocalProperties();
        rlp2.setGroupedFields(new FieldList(0, 3));
       
        toJoin1.setRequiredGlobalProps(rgp1);
        toJoin1.setRequiredLocalProps(rlp1);
       
        toJoin2.setRequiredGlobalProps(rgp2);
        toJoin2.setRequiredLocalProps(rlp2);
       
        FeedbackPropertiesMeetRequirementsReport report = afterJoin.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertEquals(NOT_MET, report);
      }
     
      // test override on both inputs, later requirement ignored
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(0));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(2, 1));
       
        RequestedGlobalProperties rgp = new RequestedGlobalProperties();
        rgp.setHashPartitioned(new FieldList(1));
       
        RequestedLocalProperties rlp = new RequestedLocalProperties();
        rlp.setGroupedFields(new FieldList(0, 3));
       
        toJoin1.setRequiredGlobalProps(null);
        toJoin1.setRequiredLocalProps(null);
       
        toJoin2.setRequiredGlobalProps(null);
        toJoin2.setRequiredLocalProps(null);
       
        toJoin1.setShipStrategy(ShipStrategyType.PARTITION_HASH, new FieldList(88));
        toJoin2.setShipStrategy(ShipStrategyType.BROADCAST);
       
        toAfterJoin.setRequiredGlobalProps(rgp);
        toAfterJoin.setRequiredLocalProps(rlp);
       
        FeedbackPropertiesMeetRequirementsReport report = afterJoin.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertEquals(MET, report);
      }
     
      // test override on one inputs, later requirement met
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(0));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(2, 1));
       
        RequestedGlobalProperties rgp = new RequestedGlobalProperties();
        rgp.setHashPartitioned(new FieldList(0));
       
        RequestedLocalProperties rlp = new RequestedLocalProperties();
        rlp.setGroupedFields(new FieldList(2, 1));
       
        toJoin1.setShipStrategy(ShipStrategyType.PARTITION_HASH, new FieldList(88));
        toJoin2.setShipStrategy(ShipStrategyType.FORWARD);
       
        toAfterJoin.setRequiredGlobalProps(rgp);
        toAfterJoin.setRequiredLocalProps(rlp);
       
        FeedbackPropertiesMeetRequirementsReport report = afterJoin.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertEquals(PENDING, report);
      }
     
      // test override on one input, later requirement not met
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(0));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(2, 1));
       
        RequestedGlobalProperties rgp = new RequestedGlobalProperties();
        rgp.setHashPartitioned(new FieldList(3));
       
        RequestedLocalProperties rlp = new RequestedLocalProperties();
        rlp.setGroupedFields(new FieldList(77, 69));
       
        toJoin1.setShipStrategy(ShipStrategyType.PARTITION_HASH, new FieldList(88));
        toJoin2.setShipStrategy(ShipStrategyType.FORWARD);
       
        toAfterJoin.setRequiredGlobalProps(rgp);
        toAfterJoin.setRequiredLocalProps(rlp);
       
        FeedbackPropertiesMeetRequirementsReport report = afterJoin.checkPartialSolutionPropertiesMet(target, gp, lp);
        assertEquals(NOT_MET, report);
      }
     
      // test override on one input locally, later global requirement not met
      {
        GlobalProperties gp = new GlobalProperties();
        gp.setHashPartitioned(new FieldList(0));
        LocalProperties lp = LocalProperties.forGrouping(new FieldList(2, 1));
       
        RequestedGlobalProperties rgp = new RequestedGlobalProperties();
        rgp.setHashPartitioned(new FieldList(3));
       
       
        toJoin1.setShipStrategy(ShipStrategyType.FORWARD);
        toJoin1.setLocalStrategy(LocalStrategy.SORT, new FieldList(3), new boolean[] { false });
       
        toJoin2.setShipStrategy(ShipStrategyType.FORWARD);
        toJoin1.setLocalStrategy(LocalStrategy.NONE);
       
        toAfterJoin.setRequiredGlobalProps(rgp);
View Full Code Here

   
    final int[] ssKeys = iteration.getSolutionSetKeyFields();
    if (ssKeys == null || ssKeys.length == 0) {
      throw new CompilerException("Invalid WorksetIteration: No key fields defined for the solution set.");
    }
    this.solutionSetKeyFields = new FieldList(ssKeys);
    this.partitionedProperties = new GlobalProperties();
    this.partitionedProperties.setHashPartitioned(this.solutionSetKeyFields);
   
    int weight = iteration.getMaximumNumberOfIterations() > 0 ?
      iteration.getMaximumNumberOfIterations() : DEFAULT_COST_WEIGHT;
View Full Code Here

      Assert.assertEquals(ShipStrategyType.PARTITION_HASH, reducer.getInput().getShipStrategy());
      Assert.assertEquals(ShipStrategyType.FORWARD, sink.getInput().getShipStrategy());
     
      Channel c = reducer.getInput();
      Assert.assertEquals(LocalStrategy.COMBININGSORT, c.getLocalStrategy());
      FieldList l = new FieldList(0);
      Assert.assertEquals(l, c.getShipStrategyKeys());
      Assert.assertEquals(l, c.getLocalStrategyKeys());
      Assert.assertTrue(Arrays.equals(c.getLocalStrategySortOrder(), reducer.getSortOrders(0)));
     
      // check the combiner
View Full Code Here

      Assert.assertEquals(ShipStrategyType.PARTITION_RANGE, reducer.getInput().getShipStrategy());
      Assert.assertEquals(ShipStrategyType.FORWARD, sink.getInput().getShipStrategy());
     
      Channel c = reducer.getInput();
      Assert.assertEquals(LocalStrategy.COMBININGSORT, c.getLocalStrategy());
      FieldList l = new FieldList(0);
      Assert.assertEquals(l, c.getShipStrategyKeys());
      Assert.assertEquals(l, c.getLocalStrategyKeys());
     
      // check that the sort orders are descending
      Assert.assertFalse(c.getShipStrategySortOrder()[0]);
View Full Code Here

    super(pactContract);

    int[] k1 = pactContract.getKeyColumns(0);
    int[] k2 = pactContract.getKeyColumns(1);
   
    this.keys1 = k1 == null || k1.length == 0 ? null : new FieldList(k1);
    this.keys2 = k2 == null || k2.length == 0 ? null : new FieldList(k2);
   
    if (this.keys1 != null) {
      if (this.keys2 != null) {
        if (this.keys1.size() != this.keys2.size()) {
          throw new CompilerException("Unequal number of key fields on the two inputs.");
View Full Code Here

      assertTrue(ssDelta instanceof DualInputPlanNode); // this is only true if the update functions preserves the partitioning
     
      DualInputPlanNode ssJoin = (DualInputPlanNode) ssDelta;
      assertEquals(DEFAULT_PARALLELISM, ssJoin.getDegreeOfParallelism());
      assertEquals(ShipStrategyType.PARTITION_HASH, ssJoin.getInput1().getShipStrategy());
      assertEquals(new FieldList(0), ssJoin.getInput1().getShipStrategyKeys());
     
      // check the workset set join
      DualInputPlanNode edgeJoin = (DualInputPlanNode) ssJoin.getInput1().getSource();
      assertEquals(DEFAULT_PARALLELISM, edgeJoin.getDegreeOfParallelism());
      assertEquals(ShipStrategyType.PARTITION_HASH, edgeJoin.getInput1().getShipStrategy());
      assertEquals(ShipStrategyType.FORWARD, edgeJoin.getInput2().getShipStrategy());
      assertTrue(edgeJoin.getInput1().getTempMode().isCached());
     
      assertEquals(new FieldList(0), edgeJoin.getInput1().getShipStrategyKeys());
     
      // check that the initial partitioning is pushed out of the loop
      assertEquals(ShipStrategyType.PARTITION_HASH, iteration.getInput1().getShipStrategy());
      assertEquals(ShipStrategyType.PARTITION_HASH, iteration.getInput2().getShipStrategy());
      assertEquals(new FieldList(0), iteration.getInput1().getShipStrategyKeys());
      assertEquals(new FieldList(0), iteration.getInput2().getShipStrategyKeys());
     
      // check that the initial workset sort is outside the loop
      assertEquals(LocalStrategy.SORT, iteration.getInput2().getLocalStrategy());
      assertEquals(new FieldList(0), iteration.getInput2().getLocalStrategyKeys());
    }
    catch (Exception e) {
      System.err.println(e.getMessage());
      e.printStackTrace();
      fail(e.getMessage());
View Full Code Here

TOP

Related Classes of org.apache.flink.api.common.operators.util.FieldList

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.