Search in sources :

Example 1 with FileBasedInstanceDataManager

use of com.linkedin.pinot.core.data.manager.offline.FileBasedInstanceDataManager in project pinot by linkedin.

the class QueriesSentinelTest method setup.

@BeforeClass
public void setup() throws Exception {
    serverMetrics = new ServerMetrics(new MetricsRegistry());
    TableDataManagerProvider.setServerMetrics(serverMetrics);
    CONFIG_BUILDER = new TestingServerPropertiesBuilder("testTable");
    setupSegmentFor("testTable");
    setUpTestQueries("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();
    //    System.out.println("************************** : " + new File(INDEX_DIR, "segment").getAbsolutePath());
    File segmentFile = new File(INDEX_DIR, "segment").listFiles()[0];
    segmentName = segmentFile.getName();
    final IndexSegment indexSegment = ColumnarSegmentLoader.load(segmentFile, ReadMode.heap);
    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()));
}
Also used : MetricsRegistry(com.yammer.metrics.core.MetricsRegistry) FileBasedInstanceDataManager(com.linkedin.pinot.core.data.manager.offline.FileBasedInstanceDataManager) IndexSegment(com.linkedin.pinot.core.indexsegment.IndexSegment) ServerQueryExecutorV1Impl(com.linkedin.pinot.core.query.executor.ServerQueryExecutorV1Impl) ServerMetrics(com.linkedin.pinot.common.metrics.ServerMetrics) FileBasedInstanceDataManagerConfig(com.linkedin.pinot.core.data.manager.config.FileBasedInstanceDataManagerConfig) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) File(java.io.File) BeforeClass(org.testng.annotations.BeforeClass)

Example 2 with FileBasedInstanceDataManager

use of com.linkedin.pinot.core.data.manager.offline.FileBasedInstanceDataManager in project pinot by linkedin.

the class QueryExceptionTest method setup.

@BeforeClass
public void setup() throws Exception {
    TableDataManagerProvider.setServerMetrics(new ServerMetrics(new MetricsRegistry()));
    CONFIG_BUILDER = new TestingServerPropertiesBuilder("testTable");
    setupSegmentFor("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();
    //    System.out.println("************************** : " + new File(INDEX_DIR, "segment").getAbsolutePath());
    File segmentFile = new File(INDEX_DIR, "segment").listFiles()[0];
    segmentName = segmentFile.getName();
    final IndexSegment indexSegment = ColumnarSegmentLoader.load(segmentFile, ReadMode.heap);
    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()));
}
Also used : MetricsRegistry(com.yammer.metrics.core.MetricsRegistry) FileBasedInstanceDataManager(com.linkedin.pinot.core.data.manager.offline.FileBasedInstanceDataManager) IndexSegment(com.linkedin.pinot.core.indexsegment.IndexSegment) ServerQueryExecutorV1Impl(com.linkedin.pinot.core.query.executor.ServerQueryExecutorV1Impl) ServerMetrics(com.linkedin.pinot.common.metrics.ServerMetrics) FileBasedInstanceDataManagerConfig(com.linkedin.pinot.core.data.manager.config.FileBasedInstanceDataManagerConfig) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) File(java.io.File) BeforeClass(org.testng.annotations.BeforeClass)

Example 3 with FileBasedInstanceDataManager

use of com.linkedin.pinot.core.data.manager.offline.FileBasedInstanceDataManager in project pinot by linkedin.

the class BrokerReduceServiceTest method setup.

@BeforeClass
public void setup() throws Exception {
    TableDataManagerProvider.setServerMetrics(new ServerMetrics(new MetricsRegistry()));
    File confDir = new File(QueryExecutorTest.class.getClassLoader().getResource("conf").toURI());
    setupSegmentList(2);
    FileUtils.deleteDirectory(new File("/tmp/pinot/test1"));
    // ServerBuilder serverBuilder = new ServerBuilder(confDir.getAbsolutePath());
    String configFilePath = confDir.getAbsolutePath();
    // build _serverConf
    PropertiesConfiguration serverConf = new PropertiesConfiguration();
    serverConf.setDelimiterParsingDisabled(false);
    serverConf.load(new File(configFilePath, PINOT_PROPERTIES));
    FileBasedInstanceDataManager instanceDataManager1 = FileBasedInstanceDataManager.getInstanceDataManager();
    instanceDataManager1.init(new FileBasedInstanceDataManagerConfig(serverConf.subset("pinot.server.instance")));
    instanceDataManager1.start();
    for (int i = 0; i < 2; ++i) {
        instanceDataManager1.getTableDataManager("midas");
        instanceDataManager1.getTableDataManager("midas").addSegment(_indexSegmentList.get(i));
    }
    _queryExecutor = new ServerQueryExecutorV1Impl();
    _queryExecutor.init(serverConf.subset("pinot.server.query.executor"), instanceDataManager1, new ServerMetrics(new MetricsRegistry()));
}
Also used : MetricsRegistry(com.yammer.metrics.core.MetricsRegistry) FileBasedInstanceDataManager(com.linkedin.pinot.core.data.manager.offline.FileBasedInstanceDataManager) ServerQueryExecutorV1Impl(com.linkedin.pinot.core.query.executor.ServerQueryExecutorV1Impl) ServerMetrics(com.linkedin.pinot.common.metrics.ServerMetrics) FileBasedInstanceDataManagerConfig(com.linkedin.pinot.core.data.manager.config.FileBasedInstanceDataManagerConfig) File(java.io.File) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) BeforeClass(org.testng.annotations.BeforeClass)

Example 4 with FileBasedInstanceDataManager

use of com.linkedin.pinot.core.data.manager.offline.FileBasedInstanceDataManager in project pinot by linkedin.

the class QueryExecutorTest method setup.

@BeforeClass
public void setup() throws Exception {
    serverMetrics = new ServerMetrics(new MetricsRegistry());
    TableDataManagerProvider.setServerMetrics(serverMetrics);
    File confDir = new File(QueryExecutorTest.class.getClassLoader().getResource("conf").toURI());
    setupSegmentList(2);
    // ServerBuilder serverBuilder = new ServerBuilder(confDir.getAbsolutePath());
    String configFilePath = confDir.getAbsolutePath();
    // build _serverConf
    PropertiesConfiguration serverConf = new PropertiesConfiguration();
    serverConf.setDelimiterParsingDisabled(false);
    serverConf.load(new File(configFilePath, PINOT_PROPERTIES));
    FileBasedInstanceDataManager instanceDataManager = FileBasedInstanceDataManager.getInstanceDataManager();
    instanceDataManager.init(new FileBasedInstanceDataManagerConfig(serverConf.subset("pinot.server.instance")));
    instanceDataManager.start();
    for (int i = 0; i < 2; ++i) {
        instanceDataManager.getTableDataManager("midas");
        instanceDataManager.getTableDataManager("midas").addSegment(_indexSegmentList.get(i));
    }
    _queryExecutor = new ServerQueryExecutorV1Impl();
    _queryExecutor.init(serverConf.subset("pinot.server.query.executor"), instanceDataManager, new ServerMetrics(new MetricsRegistry()));
}
Also used : MetricsRegistry(com.yammer.metrics.core.MetricsRegistry) FileBasedInstanceDataManager(com.linkedin.pinot.core.data.manager.offline.FileBasedInstanceDataManager) ServerQueryExecutorV1Impl(com.linkedin.pinot.core.query.executor.ServerQueryExecutorV1Impl) ServerMetrics(com.linkedin.pinot.common.metrics.ServerMetrics) FileBasedInstanceDataManagerConfig(com.linkedin.pinot.core.data.manager.config.FileBasedInstanceDataManagerConfig) File(java.io.File) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) BeforeClass(org.testng.annotations.BeforeClass)

Example 5 with FileBasedInstanceDataManager

use of com.linkedin.pinot.core.data.manager.offline.FileBasedInstanceDataManager 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()));
}
Also used : MetricsRegistry(com.yammer.metrics.core.MetricsRegistry) AvroRecordToPinotRowGenerator(com.linkedin.pinot.core.realtime.impl.kafka.AvroRecordToPinotRowGenerator) IndexSegment(com.linkedin.pinot.core.indexsegment.IndexSegment) FileBasedInstanceDataManager(com.linkedin.pinot.core.data.manager.offline.FileBasedInstanceDataManager) ServerQueryExecutorV1Impl(com.linkedin.pinot.core.query.executor.ServerQueryExecutorV1Impl) ServerMetrics(com.linkedin.pinot.common.metrics.ServerMetrics) FileBasedInstanceDataManagerConfig(com.linkedin.pinot.core.data.manager.config.FileBasedInstanceDataManagerConfig) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

FileBasedInstanceDataManager (com.linkedin.pinot.core.data.manager.offline.FileBasedInstanceDataManager)7 PropertiesConfiguration (org.apache.commons.configuration.PropertiesConfiguration)7 MetricsRegistry (com.yammer.metrics.core.MetricsRegistry)6 File (java.io.File)6 ServerMetrics (com.linkedin.pinot.common.metrics.ServerMetrics)5 FileBasedInstanceDataManagerConfig (com.linkedin.pinot.core.data.manager.config.FileBasedInstanceDataManagerConfig)5 ServerQueryExecutorV1Impl (com.linkedin.pinot.core.query.executor.ServerQueryExecutorV1Impl)5 BeforeClass (org.testng.annotations.BeforeClass)5 IndexSegment (com.linkedin.pinot.core.indexsegment.IndexSegment)3 TableDataManagerConfig (com.linkedin.pinot.core.data.manager.config.TableDataManagerConfig)1 AvroRecordToPinotRowGenerator (com.linkedin.pinot.core.realtime.impl.kafka.AvroRecordToPinotRowGenerator)1 ServerConf (com.linkedin.pinot.server.conf.ServerConf)1 ServerInstance (com.linkedin.pinot.server.starter.ServerInstance)1 BeforeTest (org.testng.annotations.BeforeTest)1