Search in sources :

Example 1 with HelixExternalViewBasedTimeBoundaryService

use of com.linkedin.pinot.routing.HelixExternalViewBasedTimeBoundaryService in project pinot by linkedin.

the class TimeBoundaryServiceTest method testExternalViewBasedTimeBoundaryService.

@Test
public void testExternalViewBasedTimeBoundaryService() throws Exception {
    addingTableToPropertyStore("testResource0");
    addingTableToPropertyStore("testResource1");
    HelixExternalViewBasedTimeBoundaryService tbs = new HelixExternalViewBasedTimeBoundaryService(_propertyStore);
    addingSegmentsToPropertyStore(5, _propertyStore, "testResource0");
    ExternalView externalView = constructExternalView("testResource0");
    tbs.updateTimeBoundaryService(externalView);
    TimeBoundaryInfo tbi = tbs.getTimeBoundaryInfoFor("testResource0");
    Assert.assertEquals(tbi.getTimeColumn(), "timestamp");
    Assert.assertEquals(tbi.getTimeValue(), "4");
    addingSegmentsToPropertyStore(50, _propertyStore, "testResource1");
    externalView = constructExternalView("testResource1");
    tbs.updateTimeBoundaryService(externalView);
    tbi = tbs.getTimeBoundaryInfoFor("testResource1");
    Assert.assertEquals(tbi.getTimeColumn(), "timestamp");
    Assert.assertEquals(tbi.getTimeValue(), "49");
    addingSegmentsToPropertyStore(50, _propertyStore, "testResource0");
    externalView = constructExternalView("testResource0");
    tbs.updateTimeBoundaryService(externalView);
    tbi = tbs.getTimeBoundaryInfoFor("testResource0");
    Assert.assertEquals(tbi.getTimeColumn(), "timestamp");
    Assert.assertEquals(tbi.getTimeValue(), "49");
}
Also used : HelixExternalViewBasedTimeBoundaryService(com.linkedin.pinot.routing.HelixExternalViewBasedTimeBoundaryService) ExternalView(org.apache.helix.model.ExternalView) TimeBoundaryInfo(com.linkedin.pinot.routing.TimeBoundaryService.TimeBoundaryInfo) Test(org.testng.annotations.Test) AfterTest(org.testng.annotations.AfterTest) BeforeTest(org.testng.annotations.BeforeTest)

Aggregations

HelixExternalViewBasedTimeBoundaryService (com.linkedin.pinot.routing.HelixExternalViewBasedTimeBoundaryService)1 TimeBoundaryInfo (com.linkedin.pinot.routing.TimeBoundaryService.TimeBoundaryInfo)1 ExternalView (org.apache.helix.model.ExternalView)1 AfterTest (org.testng.annotations.AfterTest)1 BeforeTest (org.testng.annotations.BeforeTest)1 Test (org.testng.annotations.Test)1