Examples of PartitionPlan


Examples of javax.batch.api.partition.PartitionPlan

    @Override
    public PartitionPlan mapPartitions() throws Exception {
      count++;

      PartitionPlan plan = new PartitionPlanImpl();

      if(count % 2 == 1) {
        plan.setPartitions(3);
        plan.setThreads(3);
      } else {
        plan.setPartitions(5);
        plan.setThreads(5);
      }

      plan.setPartitionsOverride(Boolean.valueOf(overrideString));

      Properties[] props = new Properties[3];
      props[0] = new Properties();
      props[1] = new Properties();
      props[2] = new Properties();

      if(count % 2 == 1) {
        props[1].put("fail", "true");
      }

      plan.setPartitionProperties(props);
      return plan;
    }
View Full Code Here

Examples of org.jberet.job.PartitionPlan

            if (!oldVal.equals(newVal)) {
                reducer.setRef(newVal);
            }
            resolve(reducer.getProperties(), true);
        }
        PartitionPlan plan = partition.getPlan();
        if (plan != null) {
            oldVal = plan.getPartitions();
            if (oldVal != null) {
                newVal = resolve(oldVal);
                if (!oldVal.equals(newVal)) {
                    plan.setPartitions(newVal);
                }
            }
            oldVal = plan.getThreads();
            if (oldVal != null) {
                newVal = resolve(oldVal);
                if (!oldVal.equals(newVal)) {
                    plan.setThreads(newVal);
                }
            }
            //plan properties should be resolved at job load time (1st pass)
            if (!resolvePartitionPlanProperties) {
                for (org.jberet.job.Properties p : plan.getProperties()) {
                    resolve(p, true);
                }
            }
        }
        PartitionMapper mapper = partition.getMapper();
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.