Examples of PartitionPlanImpl


Examples of javax.batch.api.partition.PartitionPlanImpl

        props[i] = new Properties();
        props[i].put("collectorName", "collector" + i);
        props[i].put("batchletName", "batchlet" + i);
      }

      PartitionPlan plan = new PartitionPlanImpl();
      plan.setPartitions(3);
      plan.setThreads(3);
      plan.setPartitionProperties(props);

      return plan;
    }
View Full Code Here

Examples of javax.batch.api.partition.PartitionPlanImpl

    @Override
    public PartitionPlan mapPartitions() throws Exception {
      name = artifactName;

      PartitionPlan plan = new PartitionPlanImpl();
      plan.setPartitions(3);
      plan.setThreads(3);

      return plan;
    }
View Full Code Here

Examples of javax.batch.api.partition.PartitionPlanImpl

  public void testMapperProvidesPartitions() throws Exception {
    handler.setPartitionMapper(new PartitionMapper() {

      @Override
      public PartitionPlan mapPartitions() throws Exception {
        PartitionPlan plan = new PartitionPlanImpl();
        plan.setPartitions(3);
        plan.setThreads(0);
        return plan;
      }
    });

    handler.afterPropertiesSet();
View Full Code Here

Examples of javax.batch.api.partition.PartitionPlanImpl

  public void testMapperProvidesPartitionsAndThreads() throws Exception {
    handler.setPartitionMapper(new PartitionMapper() {

      @Override
      public PartitionPlan mapPartitions() throws Exception {
        PartitionPlan plan = new PartitionPlanImpl();
        plan.setPartitions(3);
        plan.setThreads(1);
        return plan;
      }
    });

    handler.afterPropertiesSet();
View Full Code Here

Examples of javax.batch.api.partition.PartitionPlanImpl

  public void testMapperWithProperties() throws Exception {
    handler.setPartitionMapper(new PartitionMapper() {

      @Override
      public PartitionPlan mapPartitions() throws Exception {
        PartitionPlan plan = new PartitionPlanImpl();
        Properties [] props = new Properties[2];
        props[0] = new Properties();
        props[0].put("key1", "value1");
        props[1] = new Properties();
        props[1].put("key1", "value2");
        plan.setPartitionProperties(props);
        plan.setPartitions(3);
        plan.setThreads(1);
        return plan;
      }
    });

    handler.afterPropertiesSet();
View Full Code Here

Examples of javax.batch.api.partition.PartitionPlanImpl

    @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 javax.batch.api.partition.PartitionPlanImpl

@Named
public class MyMapper implements PartitionMapper {

    @Override
    public PartitionPlan mapPartitions() throws Exception {
        return new PartitionPlanImpl() {

            @Override
            public int getPartitions() {
                return 2;
            }
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.