Search in sources :

Example 6 with ColumnMetadataTest

use of com.linkedin.pinot.core.segment.index.ColumnMetadataTest in project pinot by linkedin.

the class DefaultSegmentNameGeneratorTest method testOnlyTableName.

@Test
public void testOnlyTableName() throws Exception {
    ColumnMetadataTest columnMetadataTest = new ColumnMetadataTest();
    // Build the Segment metadata.
    SegmentGeneratorConfig config = columnMetadataTest.CreateSegmentConfigWithoutCreator();
    SegmentNameGenerator segmentNameGenerator = new DefaultSegmentNameGenerator(null, "mytable", null, -1);
    config.setSegmentNameGenerator(segmentNameGenerator);
    SegmentIndexCreationDriver driver = SegmentCreationDriverFactory.get(null);
    driver.init(config);
    driver.build();
    Assert.assertEquals(driver.getSegmentName(), "mytable");
}
Also used : SegmentIndexCreationDriver(com.linkedin.pinot.core.segment.creator.SegmentIndexCreationDriver) ColumnMetadataTest(com.linkedin.pinot.core.segment.index.ColumnMetadataTest) SegmentGeneratorConfig(com.linkedin.pinot.core.indexsegment.generator.SegmentGeneratorConfig) ColumnMetadataTest(com.linkedin.pinot.core.segment.index.ColumnMetadataTest) Test(org.testng.annotations.Test)

Example 7 with ColumnMetadataTest

use of com.linkedin.pinot.core.segment.index.ColumnMetadataTest in project pinot by linkedin.

the class DefaultSegmentNameGeneratorTest method testNullPostfixWithNonNegSequenceId.

@Test
public void testNullPostfixWithNonNegSequenceId() throws Exception {
    ColumnMetadataTest columnMetadataTest = new ColumnMetadataTest();
    // Build the Segment metadata.
    SegmentGeneratorConfig config = columnMetadataTest.CreateSegmentConfigWithoutCreator();
    SegmentNameGenerator segmentNameGenerator = new DefaultSegmentNameGenerator("daysSinceEpoch", "mytable", null, 2);
    config.setSegmentNameGenerator(segmentNameGenerator);
    SegmentIndexCreationDriver driver = SegmentCreationDriverFactory.get(null);
    driver.init(config);
    driver.build();
    Assert.assertEquals(driver.getSegmentName(), "mytable_1756015683_1756015683_2");
}
Also used : SegmentIndexCreationDriver(com.linkedin.pinot.core.segment.creator.SegmentIndexCreationDriver) ColumnMetadataTest(com.linkedin.pinot.core.segment.index.ColumnMetadataTest) SegmentGeneratorConfig(com.linkedin.pinot.core.indexsegment.generator.SegmentGeneratorConfig) ColumnMetadataTest(com.linkedin.pinot.core.segment.index.ColumnMetadataTest) Test(org.testng.annotations.Test)

Aggregations

SegmentGeneratorConfig (com.linkedin.pinot.core.indexsegment.generator.SegmentGeneratorConfig)7 SegmentIndexCreationDriver (com.linkedin.pinot.core.segment.creator.SegmentIndexCreationDriver)7 ColumnMetadataTest (com.linkedin.pinot.core.segment.index.ColumnMetadataTest)7 Test (org.testng.annotations.Test)7