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");
}
Aggregations