Search in sources :

Example 11 with ObjectMetadata

use of org.apache.druid.indexing.overlord.ObjectMetadata in project druid by druid-io.

the class IndexerSQLMetadataStorageCoordinatorTest method testTransactionalAnnounceFailDbNullWantNotNull.

@Test
public void testTransactionalAnnounceFailDbNullWantNotNull() throws IOException {
    final SegmentPublishResult result1 = coordinator.announceHistoricalSegments(ImmutableSet.of(defaultSegment), ImmutableSet.of(), new ObjectMetadata(ImmutableMap.of("foo", "bar")), new ObjectMetadata(ImmutableMap.of("foo", "baz")));
    Assert.assertEquals(SegmentPublishResult.fail("java.lang.RuntimeException: Aborting transaction!"), result1);
    // Should only be tried once.
    Assert.assertEquals(1, metadataUpdateCounter.get());
}
Also used : SegmentPublishResult(org.apache.druid.indexing.overlord.SegmentPublishResult) ObjectMetadata(org.apache.druid.indexing.overlord.ObjectMetadata) Test(org.junit.Test)

Aggregations

ObjectMetadata (org.apache.druid.indexing.overlord.ObjectMetadata)11 Test (org.junit.Test)11 SegmentPublishResult (org.apache.druid.indexing.overlord.SegmentPublishResult)7 NoopTask (org.apache.druid.indexing.common.task.NoopTask)2 Task (org.apache.druid.indexing.common.task.Task)2 AtomicLong (java.util.concurrent.atomic.AtomicLong)1 DataSourceMetadata (org.apache.druid.indexing.overlord.DataSourceMetadata)1 Handle (org.skife.jdbi.v2.Handle)1