Examples of IndexTask


Examples of com.aerospike.client.task.IndexTask

    // Send index command to one node. That node will distribute the command to other nodes.
    String response = sendInfoCommand(policy, sb.toString());
   
    if (response.equalsIgnoreCase("OK")) {
      // Return task that could optionally be polled for completion.
      return new IndexTask(cluster, namespace, indexName);
    }
   
    if (response.equals("FAIL:208:ERR FOUND")) {
      // Index has already been created.  Do not need to poll for completion.
      return new IndexTask();
    }
     
    throw new AerospikeException("Create index failed: " + response);
  }
View Full Code Here

Examples of com.aerospike.client.task.IndexTask

    // Send index command to one node. That node will distribute the command to other nodes.
    String response = sendInfoCommand(policy, sb.toString());
   
    if (response.equalsIgnoreCase("OK")) {
      // Return task that could optionally be polled for completion.
      return new IndexTask(cluster, namespace, indexName);
    }
   
    if (response.startsWith("FAIL:200")) {
      // Index has already been created.  Do not need to poll for completion.
      return new IndexTask();
    }
     
    throw new AerospikeException("Create index failed: " + response);
  }
View Full Code Here

Examples of com.aerospike.client.task.IndexTask

    // Send index command to one node. That node will distribute the command to other nodes.
    String response = sendInfoCommand(policy, sb.toString());
   
    if (response.equalsIgnoreCase("OK")) {
      // Return task that could optionally be polled for completion.
      return new IndexTask(cluster, namespace, indexName);
    }
   
    if (response.startsWith("FAIL:200")) {
      // Index has already been created.  Do not need to poll for completion.
      return new IndexTask();
    }
     
    throw new AerospikeException("Create index failed: " + response);
  }
View Full Code Here

Examples of com.aerospike.client.task.IndexTask

    // Send index command to one node. That node will distribute the command to other nodes.
    String response = sendInfoCommand(policy, sb.toString());
   
    if (response.equalsIgnoreCase("OK")) {
      // Return task that could optionally be polled for completion.
      return new IndexTask(cluster, namespace, indexName);
    }
   
    if (response.startsWith("FAIL:200")) {
      // Index has already been created.  Do not need to poll for completion.
      return new IndexTask();
    }
     
    throw new AerospikeException("Create index failed: " + response);
  }
View Full Code Here

Examples of com.aerospike.client.task.IndexTask

    // Send index command to one node. That node will distribute the command to other nodes.
    String response = sendInfoCommand(policy, sb.toString());
   
    if (response.equalsIgnoreCase("OK")) {
      // Return task that could optionally be polled for completion.
      return new IndexTask(cluster, namespace, indexName);
    }
   
    if (response.startsWith("FAIL:200")) {
      // Index has already been created.  Do not need to poll for completion.
      return new IndexTask();
    }
     
    throw new AerospikeException("Create index failed: " + response);
  }
View Full Code Here

Examples of com.aerospike.client.task.IndexTask

    // Send index command to one node. That node will distribute the command to other nodes.
    String response = sendInfoCommand(policy, sb.toString());
   
    if (response.equalsIgnoreCase("OK")) {
      // Return task that could optionally be polled for completion.
      return new IndexTask(cluster, namespace, indexName);
    }
   
    if (response.startsWith("FAIL:200")) {
      // Index has already been created.  Do not need to poll for completion.
      return new IndexTask();
    }
     
    throw new AerospikeException("Create index failed: " + response);
  }
View Full Code Here

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

  }

  @Test
  public void testIndexTask() throws Exception
  {
    final Task indexTask = new IndexTask(
        null,
        null,
        "foo",
        new UniformGranularitySpec(
            Granularity.DAY,
            null,
            ImmutableList.of(new Interval("2010-01-01/P2D")),
            Granularity.DAY
        ),
        new AggregatorFactory[]{new DoubleSumAggregatorFactory("met", "met")},
        QueryGranularity.NONE,
        10000,
        newMockFirehoseFactory(
            ImmutableList.of(
                IR("2010-01-01T01", "x", "y", 1),
                IR("2010-01-01T01", "x", "z", 1),
                IR("2010-01-02T01", "a", "b", 2),
                IR("2010-01-02T01", "a", "c", 1)
            )
        ),
        -1,
        TestUtils.MAPPER
    );

    final Optional<TaskStatus> preRunTaskStatus = tsqa.getStatus(indexTask.getId());
    Assert.assertTrue("pre run task status not present", !preRunTaskStatus.isPresent());

    final TaskStatus mergedStatus = runTask(indexTask);
    final TaskStatus status = ts.getStatus(indexTask.getId()).get();
    final List<DataSegment> publishedSegments = byIntervalOrdering.sortedCopy(mdc.getPublished());
    final List<DataSegment> loggedSegments = byIntervalOrdering.sortedCopy(tsqa.getInsertedSegments(indexTask.getId()));

    Assert.assertEquals("statusCode", TaskStatus.Status.SUCCESS, status.getStatusCode());
    Assert.assertEquals("merged statusCode", TaskStatus.Status.SUCCESS, mergedStatus.getStatusCode());
    Assert.assertEquals("segments logged vs published", loggedSegments, publishedSegments);
    Assert.assertEquals("num segments published", 2, mdc.getPublished().size());
View Full Code Here

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

  }

  @Test
  public void testIndexTaskFailure() throws Exception
  {
    final Task indexTask = new IndexTask(
        null,
        null,
        "foo",
        new UniformGranularitySpec(Granularity.DAY, null, ImmutableList.of(new Interval("2010-01-01/P1D")), Granularity.DAY),
        new AggregatorFactory[]{new DoubleSumAggregatorFactory("met", "met")},
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.