use of org.apache.commons.configuration.PropertiesConfiguration in project pinot by linkedin.
the class DictionaryToRawIndexConverter method updateMetadata.
/**
* Helper method to update the metadata.properties for the converted segment.
*
* @param segmentDir Segment directory
* @param columns Converted columns
* @param tableName New table name to be written in the meta-data. Skipped if null.
* @throws IOException
* @throws ConfigurationException
*/
private void updateMetadata(File segmentDir, String[] columns, String tableName) throws IOException, ConfigurationException {
File metadataFile = new File(segmentDir, V1Constants.MetadataKeys.METADATA_FILE_NAME);
PropertiesConfiguration properties = new PropertiesConfiguration(metadataFile);
if (tableName != null) {
properties.setProperty(V1Constants.MetadataKeys.Segment.TABLE_NAME, tableName);
}
for (String column : columns) {
properties.setProperty(V1Constants.MetadataKeys.Column.getKeyFor(column, V1Constants.MetadataKeys.Column.HAS_DICTIONARY), false);
properties.setProperty(V1Constants.MetadataKeys.Column.getKeyFor(column, V1Constants.MetadataKeys.Column.BITS_PER_ELEMENT), -1);
}
properties.save();
}
use of org.apache.commons.configuration.PropertiesConfiguration in project pinot by linkedin.
the class HllIndexCreationTest method setUp.
@BeforeMethod
public void setUp() throws Exception {
hllConfig = new HllConfig(hllLog2m, columnsToDeriveHllFields, hllDeriveColumnSuffix);
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);
}
use of org.apache.commons.configuration.PropertiesConfiguration in project pinot by linkedin.
the class SegmentPreProcessorTest method testAddColumnMinMaxValue.
@Test
public void testAddColumnMinMaxValue() throws Exception {
constructSegment();
IndexLoadingConfigMetadata indexLoadingConfigMetadata = new IndexLoadingConfigMetadata(new PropertiesConfiguration());
indexLoadingConfigMetadata.setGenerateColumnMinMaxValueMode(ColumnMinMaxValueGeneratorMode.NONE.toString());
SegmentPreProcessor processor = new SegmentPreProcessor(_segmentDirectoryFile, indexLoadingConfigMetadata, null);
processor.process();
SegmentMetadataImpl segmentMetadata = new SegmentMetadataImpl(_segmentDirectoryFile);
ColumnMetadata timeColumnMetadata = segmentMetadata.getColumnMetadataFor("daysSinceEpoch");
ColumnMetadata dimensionColumnMetadata = segmentMetadata.getColumnMetadataFor("column1");
ColumnMetadata metricColumnMetadata = segmentMetadata.getColumnMetadataFor("count");
Assert.assertNull(timeColumnMetadata.getMinValue());
Assert.assertNull(timeColumnMetadata.getMaxValue());
Assert.assertNull(dimensionColumnMetadata.getMinValue());
Assert.assertNull(dimensionColumnMetadata.getMaxValue());
Assert.assertNull(metricColumnMetadata.getMinValue());
Assert.assertNull(metricColumnMetadata.getMaxValue());
indexLoadingConfigMetadata = new IndexLoadingConfigMetadata(new PropertiesConfiguration());
indexLoadingConfigMetadata.setGenerateColumnMinMaxValueMode(ColumnMinMaxValueGeneratorMode.TIME.toString());
processor = new SegmentPreProcessor(_segmentDirectoryFile, indexLoadingConfigMetadata, null);
processor.process();
segmentMetadata = new SegmentMetadataImpl(_segmentDirectoryFile);
timeColumnMetadata = segmentMetadata.getColumnMetadataFor("daysSinceEpoch");
dimensionColumnMetadata = segmentMetadata.getColumnMetadataFor("column5");
metricColumnMetadata = segmentMetadata.getColumnMetadataFor("count");
Assert.assertEquals(timeColumnMetadata.getMinValue(), 1756015683);
Assert.assertEquals(timeColumnMetadata.getMaxValue(), 1756015683);
Assert.assertNull(dimensionColumnMetadata.getMinValue());
Assert.assertNull(dimensionColumnMetadata.getMaxValue());
Assert.assertNull(metricColumnMetadata.getMinValue());
Assert.assertNull(metricColumnMetadata.getMaxValue());
indexLoadingConfigMetadata.setGenerateColumnMinMaxValueMode(ColumnMinMaxValueGeneratorMode.NON_METRIC.toString());
processor = new SegmentPreProcessor(_segmentDirectoryFile, indexLoadingConfigMetadata, null);
processor.process();
segmentMetadata = new SegmentMetadataImpl(_segmentDirectoryFile);
timeColumnMetadata = segmentMetadata.getColumnMetadataFor("daysSinceEpoch");
dimensionColumnMetadata = segmentMetadata.getColumnMetadataFor("column5");
metricColumnMetadata = segmentMetadata.getColumnMetadataFor("count");
Assert.assertEquals(timeColumnMetadata.getMinValue(), 1756015683);
Assert.assertEquals(timeColumnMetadata.getMaxValue(), 1756015683);
Assert.assertEquals(dimensionColumnMetadata.getMinValue(), "AKXcXcIqsqOJFsdwxZ");
Assert.assertEquals(dimensionColumnMetadata.getMaxValue(), "yQkJTLOQoOqqhkAClgC");
Assert.assertNull(metricColumnMetadata.getMinValue());
Assert.assertNull(metricColumnMetadata.getMaxValue());
indexLoadingConfigMetadata.setGenerateColumnMinMaxValueMode(ColumnMinMaxValueGeneratorMode.ALL.toString());
processor = new SegmentPreProcessor(_segmentDirectoryFile, indexLoadingConfigMetadata, null);
processor.process();
segmentMetadata = new SegmentMetadataImpl(_segmentDirectoryFile);
timeColumnMetadata = segmentMetadata.getColumnMetadataFor("daysSinceEpoch");
dimensionColumnMetadata = segmentMetadata.getColumnMetadataFor("column5");
metricColumnMetadata = segmentMetadata.getColumnMetadataFor("count");
Assert.assertEquals(timeColumnMetadata.getMinValue(), 1756015683);
Assert.assertEquals(timeColumnMetadata.getMaxValue(), 1756015683);
Assert.assertEquals(dimensionColumnMetadata.getMinValue(), "AKXcXcIqsqOJFsdwxZ");
Assert.assertEquals(dimensionColumnMetadata.getMaxValue(), "yQkJTLOQoOqqhkAClgC");
Assert.assertEquals(metricColumnMetadata.getMinValue(), 890662862);
Assert.assertEquals(metricColumnMetadata.getMaxValue(), 890662862);
}
use of org.apache.commons.configuration.PropertiesConfiguration in project pinot by linkedin.
the class BrokerRequestValidationTest method setup.
/**
* Setup method to start the broker. Stars the broker with
* a query response limit of {@value QUERY_RESPONSE_LIMIT}
* @return
* @throws Exception
*/
@BeforeClass
public BrokerServerBuilder setup() throws Exception {
// Read default configurations.
PropertiesConfiguration config = new PropertiesConfiguration(new File(BrokerServerBuilderTest.class.getClassLoader().getResource("broker.properties").toURI()));
// Set the value for query response limit.
config.addProperty(QUERY_RESPONSE_LIMIT_CONFIG, QUERY_RESPONSE_LIMIT);
brokerBuilder = new BrokerServerBuilder(config, null, null, null);
brokerBuilder.buildNetwork();
brokerBuilder.buildHTTP();
brokerBuilder.start();
return brokerBuilder;
}
use of org.apache.commons.configuration.PropertiesConfiguration in project pinot by linkedin.
the class DefaultHelixBrokerConfig method getDefaultBrokerConf.
public static Configuration getDefaultBrokerConf() {
Configuration brokerConf = new PropertiesConfiguration();
// config based routing
brokerConf.addProperty("pinot.broker.transport.routingMode", "HELIX");
brokerConf.addProperty("pinot.broker.routing.table.builder.default.offline.class", "balanced");
brokerConf.addProperty("pinot.broker.routing.table.builder.default.offline.numOfRoutingTables", "10");
brokerConf.addProperty("pinot.broker.routing.table.builder.default.realtime.class", "Kafkahighlevelconsumerbased");
brokerConf.addProperty("pinot.broker.routing.table.builder.tables", "");
//client properties
brokerConf.addProperty("pinot.broker.client.enableConsole", "true");
brokerConf.addProperty("pinot.broker.client.queryPort", "8099");
brokerConf.addProperty("pinot.broker.client.consolePath", "../webapp");
// [PINOT-2435] setting to 0 so it doesn't disconnect from zk
brokerConf.addProperty("pinot.broker.helix.flappingTimeWindowMs", "0");
return brokerConf;
}
Aggregations