use of com.linkedin.pinot.core.indexsegment.IndexSegment in project pinot by linkedin.
the class InstancePlanMakerImplV2 method makeInterSegmentPlan.
@Override
public Plan makeInterSegmentPlan(List<SegmentDataManager> segmentDataManagers, BrokerRequest brokerRequest, ExecutorService executorService, long timeOutMs) {
// TODO: pass in List<IndexSegment> directly.
List<IndexSegment> indexSegments = new ArrayList<>(segmentDataManagers.size());
for (SegmentDataManager segmentDataManager : segmentDataManagers) {
indexSegments.add(segmentDataManager.getSegment());
}
BrokerRequestPreProcessor.preProcess(indexSegments, brokerRequest);
List<PlanNode> planNodes = new ArrayList<>();
for (IndexSegment indexSegment : indexSegments) {
planNodes.add(makeInnerSegmentPlan(indexSegment, brokerRequest));
}
CombinePlanNode combinePlanNode = new CombinePlanNode(planNodes, brokerRequest, executorService, timeOutMs);
return new GlobalPlanImplV0(new InstanceResponsePlanNode(combinePlanNode));
}
use of com.linkedin.pinot.core.indexsegment.IndexSegment in project pinot by linkedin.
the class RealtimeQueriesSentinelTest method setup.
@BeforeClass
public void setup() throws Exception {
TableDataManagerProvider.setServerMetrics(new ServerMetrics(new MetricsRegistry()));
PINOT_SCHEMA = getTestSchema();
PINOT_SCHEMA.setSchemaName("realtimeSchema");
AVRO_RECORD_TRANSFORMER = new AvroRecordToPinotRowGenerator(PINOT_SCHEMA);
final IndexSegment indexSegment = getRealtimeSegment();
setUpTestQueries("testTable");
CONFIG_BUILDER = new TestingServerPropertiesBuilder("testTable");
final PropertiesConfiguration serverConf = CONFIG_BUILDER.build();
serverConf.setDelimiterParsingDisabled(false);
final FileBasedInstanceDataManager instanceDataManager = FileBasedInstanceDataManager.getInstanceDataManager();
instanceDataManager.init(new FileBasedInstanceDataManagerConfig(serverConf.subset("pinot.server.instance")));
instanceDataManager.start();
instanceDataManager.getTableDataManager("testTable");
instanceDataManager.getTableDataManager("testTable").addSegment(indexSegment);
QUERY_EXECUTOR = new ServerQueryExecutorV1Impl(false);
QUERY_EXECUTOR.init(serverConf.subset("pinot.server.query.executor"), instanceDataManager, new ServerMetrics(new MetricsRegistry()));
}
use of com.linkedin.pinot.core.indexsegment.IndexSegment in project pinot by linkedin.
the class TestHelper method loadSegment.
IndexSegment loadSegment(File indexDir) throws Exception {
IndexSegment indexSegment = ColumnarSegmentLoader.load(indexDir, ReadMode.mmap);
instanceDataManager.getTableDataManager(tableName).addSegment(indexSegment);
return indexSegment;
}
use of com.linkedin.pinot.core.indexsegment.IndexSegment in project pinot by linkedin.
the class RawIndexBenchmark method run.
public void run() throws Exception {
if (_segmentDir == null && _dataFile == null) {
System.out.println("Error: One of 'segmentDir' or 'dataFile' must be specified");
return;
}
File segmentFile = (_segmentDir == null) ? buildSegment() : new File(_segmentDir);
IndexSegment segment = Loaders.IndexSegment.load(segmentFile, ReadMode.valueOf(_loadMode));
compareIndexSizes(segment, segmentFile, _fwdIndexColumn, _rawIndexColumn);
compareLookups(segment);
// Cleanup the temporary directory
if (_segmentDir != null) {
FileUtils.deleteQuietly(new File(SEGMENT_DIR_NAME));
}
segment.destroy();
}
use of com.linkedin.pinot.core.indexsegment.IndexSegment in project pinot by linkedin.
the class TableSizeResourceTest method testTableSizeOld.
@Test
public void testTableSizeOld() {
TableSizeInfo tableSizeInfo = target.path("/table/" + TABLE_NAME + "/size").request().get(TableSizeInfo.class);
Assert.assertEquals(tableSizeInfo.tableName, TABLE_NAME);
IndexSegment indexSegment = testHelper.indexSegment;
Assert.assertEquals(tableSizeInfo.diskSizeInBytes, indexSegment.getDiskSizeBytes());
Assert.assertEquals(tableSizeInfo.segments.size(), 1);
Assert.assertEquals(tableSizeInfo.segments.get(0).segmentName, indexSegment.getSegmentName());
Assert.assertEquals(tableSizeInfo.segments.get(0).diskSizeInBytes, indexSegment.getDiskSizeBytes());
Assert.assertEquals(tableSizeInfo.diskSizeInBytes, indexSegment.getDiskSizeBytes());
}
Aggregations