Examples of TaskResource


Examples of io.druid.indexing.common.task.TaskResource

  public void testSimple() throws Exception
  {
    final Task task = new AbstractFixedIntervalTask(
        "id1",
        "id1",
        new TaskResource("id1", 1),
        "ds",
        new Interval("2012-01-01/P1D")
    )
    {
      @Override
View Full Code Here

Examples of io.druid.indexing.common.task.TaskResource

      this.taskStatus = taskStatus;
    } else {
      // Can be removed when backwards compat is no longer needed
      this.taskStatus = TaskStatus.fromCode(taskId, status);
    }
    this.taskResource = taskResource == null ? new TaskResource(this.taskStatus.getId(), 1) : taskResource;
  }
View Full Code Here

Examples of io.druid.indexing.common.task.TaskResource

  @Test
  public void testBackwardsCompatibleSerde() throws Exception
  {
    final Task task = new RealtimeIndexTask(
        "theid",
        new TaskResource("rofl", 2),
        null,
        new Schema("foo", null, new AggregatorFactory[0], QueryGranularity.NONE, new NoneShardSpec()),
        null,
        null,
        new Period("PT10M"),
View Full Code Here

Examples of io.druid.indexing.common.task.TaskResource

*/
public class RealtimeishTask extends AbstractTask
{
  public RealtimeishTask()
  {
    super("rt1", "rt", new TaskResource("rt1", 1), "foo");
  }
View Full Code Here

Examples of io.druid.indexing.common.task.TaskResource

  @Test
  public void testRunSameAvailabilityGroup() throws Exception
  {
    doSetup();

    TestRealtimeTask task1 = new TestRealtimeTask("rt1", new TaskResource("rt1", 1), "foo", TaskStatus.running("rt1"));
    remoteTaskRunner.run(task1);
    Assert.assertTrue(taskAnnounced(task1.getId()));
    mockWorkerRunningTask(task1);

    TestRealtimeTask task2 = new TestRealtimeTask("rt2", new TaskResource("rt1", 1), "foo", TaskStatus.running("rt2"));
    remoteTaskRunner.run(task2);

    TestRealtimeTask task3 = new TestRealtimeTask("rt3", new TaskResource("rt2", 1), "foo", TaskStatus.running("rt3"));
    remoteTaskRunner.run(task3);

    Assert.assertTrue(
        TestUtils.conditionValid(
            new IndexingServiceCondition()
View Full Code Here

Examples of io.druid.indexing.common.task.TaskResource

  @Test
  public void testRunWithCapacity() throws Exception
  {
    doSetup();

    TestRealtimeTask task1 = new TestRealtimeTask("rt1", new TaskResource("rt1", 1), "foo", TaskStatus.running("rt1"));
    remoteTaskRunner.run(task1);
    Assert.assertTrue(taskAnnounced(task1.getId()));
    mockWorkerRunningTask(task1);

    TestRealtimeTask task2 = new TestRealtimeTask("rt2", new TaskResource("rt2", 3), "foo", TaskStatus.running("rt2"));
    remoteTaskRunner.run(task2);

    TestRealtimeTask task3 = new TestRealtimeTask("rt3", new TaskResource("rt3", 2), "foo", TaskStatus.running("rt3"));
    remoteTaskRunner.run(task3);
    Assert.assertTrue(taskAnnounced(task3.getId()));
    mockWorkerRunningTask(task3);

    Assert.assertTrue(
View Full Code Here

Examples of org.apache.sling.installer.api.tasks.TaskResource

        this.subsystemReference = ref;
    }

    @Override
    public void execute(final InstallationContext ctx) {
        final TaskResource tr = this.getResource();
        ctx.log("Uninstalling subsystem from {}", tr);

        Subsystem subsystem = null;
        try {
            subsystem = this.bundleContext.getService(this.subsystemReference);
View Full Code Here

Examples of org.apache.sling.installer.api.tasks.TaskResource

        this.subsystem = system;
    }

    @Override
    public void execute(final InstallationContext ctx) {
        final TaskResource tr = this.getResource();
        ctx.log("Starting subsystem from {}", tr);

        this.subsystem.start();
        ctx.addTaskToCurrentCycle(new ChangeStateTask(this.getResourceGroup(), ResourceState.INSTALLED));
        ctx.log("Started subsystem {}", this.subsystem);
View Full Code Here

Examples of org.apache.sling.installer.api.tasks.TaskResource

        this.rootSubsystem = rootSubsystem;
    }

    @Override
    public void execute(final InstallationContext ctx) {
        final TaskResource tr = this.getResource();
        ctx.log("Updating subsystem from {}", tr);

        Subsystem subsystem = null;
        try {
            subsystem = this.bundleContext.getService(this.subsystemReference);
View Full Code Here

Examples of org.apache.sling.installer.api.tasks.TaskResource

        this.rootSubsystem = rootSubsystem;
    }

    @Override
    public void execute(final InstallationContext ctx) {
        final TaskResource tr = this.getResource();
        ctx.log("Installing new subsystem from {}", tr);

        try {
            final Subsystem sub = this.rootSubsystem.install(tr.getURL(), tr.getInputStream());
            ctx.addTaskToCurrentCycle(new StartSubsystemTask(this.getResourceGroup(), sub));
            ctx.log("Installed new subsystem {}", sub);
        } catch (final IOException e) {
            ctx.log("Unable to install subsystem {} : {}", tr, e);
            ctx.addTaskToCurrentCycle(new ChangeStateTask(this.getResourceGroup(), ResourceState.IGNORED));
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.