Search in sources :

Example 6 with PropertiesConfiguration

use of org.apache.commons.configuration.PropertiesConfiguration in project pinot by linkedin.

the class PerfBenchmarkDriver method startBroker.

private void startBroker() throws Exception {
    if (!_conf.isStartBroker()) {
        LOGGER.info("Skipping start broker step. Assumes broker is already started.");
        return;
    }
    Configuration brokerConfiguration = new PropertiesConfiguration();
    String brokerInstanceName = "Broker_localhost_" + CommonConstants.Helix.DEFAULT_BROKER_QUERY_PORT;
    brokerConfiguration.setProperty("instanceId", brokerInstanceName);
    LOGGER.info("Starting broker instance: {}", brokerInstanceName);
    new HelixBrokerStarter(_clusterName, _zkAddress, brokerConfiguration);
}
Also used : Configuration(org.apache.commons.configuration.Configuration) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) HelixBrokerStarter(com.linkedin.pinot.broker.broker.helix.HelixBrokerStarter) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration)

Example 7 with PropertiesConfiguration

use of org.apache.commons.configuration.PropertiesConfiguration in project pinot by linkedin.

the class ScatterGatherPerfClient method main.

public static void main(String[] args) throws Exception {
    //Process Command Line to get config and port
    CommandLineParser cliParser = new GnuParser();
    Options cliOptions = buildCommandLineOptions();
    CommandLine cmd = cliParser.parse(cliOptions, args, true);
    if ((!cmd.hasOption(BROKER_CONFIG_OPT_NAME)) || (!cmd.hasOption(REQUEST_SIZE_OPT_NAME)) || (!cmd.hasOption(TABLE_NAME_OPT_NAME)) || (!cmd.hasOption(TABLE_NAME_OPT_NAME))) {
        System.err.println("Missing required arguments !!");
        System.err.println(cliOptions);
        throw new RuntimeException("Missing required arguments !!");
    }
    String brokerConfigPath = cmd.getOptionValue(BROKER_CONFIG_OPT_NAME);
    int requestSize = Integer.parseInt(cmd.getOptionValue(REQUEST_SIZE_OPT_NAME));
    int numRequests = Integer.parseInt(cmd.getOptionValue(NUM_REQUESTS_OPT_NAME));
    String resourceName = cmd.getOptionValue(TABLE_NAME_OPT_NAME);
    // build  brokerConf
    PropertiesConfiguration brokerConf = new PropertiesConfiguration();
    brokerConf.setDelimiterParsingDisabled(false);
    brokerConf.load(brokerConfigPath);
    RoutingTableConfig config = new RoutingTableConfig();
    config.init(brokerConf.subset(ROUTING_CFG_PREFIX));
    ScatterGatherPerfClient client = new ScatterGatherPerfClient(config, requestSize, resourceName, false, numRequests, 1, 1);
    client.run();
    System.out.println("Shutting down !!");
    client.shutdown();
    System.out.println("Shut down complete !!");
}
Also used : Options(org.apache.commons.cli.Options) CommandLine(org.apache.commons.cli.CommandLine) GnuParser(org.apache.commons.cli.GnuParser) RoutingTableConfig(com.linkedin.pinot.transport.config.RoutingTableConfig) CommandLineParser(org.apache.commons.cli.CommandLineParser) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration)

Example 8 with PropertiesConfiguration

use of org.apache.commons.configuration.PropertiesConfiguration in project pinot by linkedin.

the class IndexLoadingConfigMetadataTest method getTestResourceMetadata.

private Configuration getTestResourceMetadata() {
    Configuration resourceMetadata = new PropertiesConfiguration();
    String columnNames = null;
    for (int i = 0; i < 10; ++i) {
        if (columnNames == null) {
            columnNames = ("col" + i);
        } else {
            columnNames += (", col" + i);
        }
    }
    resourceMetadata.addProperty(KEY_OF_LOADING_INVERTED_INDEX, columnNames);
    resourceMetadata.addProperty(KEY_OF_ENABLE_DEFAULT_COLUMNS, true);
    return resourceMetadata;
}
Also used : Configuration(org.apache.commons.configuration.Configuration) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration)

Example 9 with PropertiesConfiguration

use of org.apache.commons.configuration.PropertiesConfiguration in project pinot by linkedin.

the class SegmentPreProcessorTest method setUp.

@BeforeClass
public void setUp() throws Exception {
    // For indexLoadingConfigMetadata, we specify two columns without inverted index ('column1', 'column13'), one
    // non-existing column ('noSuchColumn') and one column with existed inverted index ('column7').
    _indexLoadingConfigMetadata = new IndexLoadingConfigMetadata(new PropertiesConfiguration());
    _indexLoadingConfigMetadata.initLoadingInvertedIndexColumnSet(new String[] { COLUMN1_NAME, COLUMN7_NAME, COLUMN13_NAME, NO_SUCH_COLUMN_NAME });
    _indexLoadingConfigMetadata.setEnableDefaultColumns(true);
    // For newColumnsSchema, we add 4 different data type metric columns with one user-defined default null value, and
    // 3 different data type dimension columns with one user-defined default null value and one multi-value column.
    ClassLoader classLoader = getClass().getClassLoader();
    URL resourceUrl = classLoader.getResource(SCHEMA);
    Preconditions.checkNotNull(resourceUrl);
    _schema = Schema.fromFile(new File(resourceUrl.getFile()));
    resourceUrl = classLoader.getResource(NEW_COLUMNS_SCHEMA1);
    Preconditions.checkNotNull(resourceUrl);
    _newColumnsSchema1 = Schema.fromFile(new File(resourceUrl.getFile()));
    resourceUrl = classLoader.getResource(NEW_COLUMNS_SCHEMA2);
    Preconditions.checkNotNull(resourceUrl);
    _newColumnsSchema2 = Schema.fromFile(new File(resourceUrl.getFile()));
    resourceUrl = classLoader.getResource(NEW_COLUMNS_SCHEMA3);
    Preconditions.checkNotNull(resourceUrl);
    _newColumnsSchema3 = Schema.fromFile(new File(resourceUrl.getFile()));
}
Also used : IndexLoadingConfigMetadata(com.linkedin.pinot.common.metadata.segment.IndexLoadingConfigMetadata) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) File(java.io.File) URL(java.net.URL) BeforeClass(org.testng.annotations.BeforeClass)

Example 10 with PropertiesConfiguration

use of org.apache.commons.configuration.PropertiesConfiguration in project pinot by linkedin.

the class SegmentV1V2ToV3FormatConverterTest method setUp.

@BeforeMethod
public void setUp() throws Exception {
    INDEX_DIR = Files.createTempDirectory(SegmentV1V2ToV3FormatConverter.class.getName() + "_segmentDir").toFile();
    final String filePath = TestUtils.getFileFromResourceUrl(SegmentV1V2ToV3FormatConverter.class.getClassLoader().getResource(AVRO_DATA));
    // intentionally changed this to TimeUnit.Hours to make it non-default for testing
    final SegmentGeneratorConfig config = SegmentTestUtils.getSegmentGenSpecWithSchemAndProjectedColumns(new File(filePath), INDEX_DIR, "daysSinceEpoch", TimeUnit.HOURS, "testTable");
    config.setSegmentNamePostfix("1");
    config.setTimeColumnName("daysSinceEpoch");
    final SegmentIndexCreationDriver driver = SegmentCreationDriverFactory.get(null);
    driver.init(config);
    driver.build();
    segmentDirectory = new File(INDEX_DIR, driver.getSegmentName());
    File starTreeFile = new File(segmentDirectory, V1Constants.STAR_TREE_INDEX_FILE);
    FileUtils.touch(starTreeFile);
    FileUtils.writeStringToFile(starTreeFile, "This is a star tree index");
    Configuration tableConfig = new PropertiesConfiguration();
    tableConfig.addProperty(IndexLoadingConfigMetadata.KEY_OF_SEGMENT_FORMAT_VERSION, "v1");
    v1LoadingConfig = new IndexLoadingConfigMetadata(tableConfig);
    tableConfig.clear();
    tableConfig.addProperty(IndexLoadingConfigMetadata.KEY_OF_SEGMENT_FORMAT_VERSION, "v3");
    v3LoadingConfig = new IndexLoadingConfigMetadata(tableConfig);
}
Also used : SegmentIndexCreationDriver(com.linkedin.pinot.core.segment.creator.SegmentIndexCreationDriver) Configuration(org.apache.commons.configuration.Configuration) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) SegmentGeneratorConfig(com.linkedin.pinot.core.indexsegment.generator.SegmentGeneratorConfig) IndexLoadingConfigMetadata(com.linkedin.pinot.common.metadata.segment.IndexLoadingConfigMetadata) File(java.io.File) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

PropertiesConfiguration (org.apache.commons.configuration.PropertiesConfiguration)102 File (java.io.File)37 Configuration (org.apache.commons.configuration.Configuration)29 ConfigurationException (org.apache.commons.configuration.ConfigurationException)26 IOException (java.io.IOException)12 Test (org.testng.annotations.Test)11 BeforeClass (org.testng.annotations.BeforeClass)10 MetricsRegistry (com.yammer.metrics.core.MetricsRegistry)9 IndexLoadingConfigMetadata (com.linkedin.pinot.common.metadata.segment.IndexLoadingConfigMetadata)8 FileBasedInstanceDataManager (com.linkedin.pinot.core.data.manager.offline.FileBasedInstanceDataManager)8 CompositeConfiguration (org.apache.commons.configuration.CompositeConfiguration)7 FileInputStream (java.io.FileInputStream)6 URL (java.net.URL)6 ServerQueryExecutorV1Impl (com.linkedin.pinot.core.query.executor.ServerQueryExecutorV1Impl)5 ServerConf (com.linkedin.pinot.server.conf.ServerConf)5 FileNotFoundException (java.io.FileNotFoundException)5 Properties (java.util.Properties)5 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)4 ServerMetrics (com.linkedin.pinot.common.metrics.ServerMetrics)4 FileBasedInstanceDataManagerConfig (com.linkedin.pinot.core.data.manager.config.FileBasedInstanceDataManagerConfig)4