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