use of org.apache.commons.configuration.ConfigurationMap in project pinot by linkedin.
the class SegmentFetcherFactory method initSegmentFetcherFactory.
public static void initSegmentFetcherFactory(Configuration pinotHelixProperties) {
Configuration segmentFetcherFactoryConfig = pinotHelixProperties.subset(CommonConstants.Server.PREFIX_OF_CONFIG_OF_SEGMENT_FETCHER_FACTORY);
Iterator segmentFetcherFactoryConfigIterator = segmentFetcherFactoryConfig.getKeys();
while (segmentFetcherFactoryConfigIterator.hasNext()) {
Object configKeyObject = segmentFetcherFactoryConfigIterator.next();
try {
String segmentFetcherConfigKey = configKeyObject.toString();
String protocol = segmentFetcherConfigKey.split(".", 2)[0];
if (!SegmentFetcherFactory.containsProtocol(protocol)) {
SegmentFetcherFactory.initSegmentFetcher(new ConfigurationMap(segmentFetcherFactoryConfig.subset(protocol)));
}
} catch (Exception e) {
LOGGER.error("Got exception to process the key: " + configKeyObject);
}
}
}
use of org.apache.commons.configuration.ConfigurationMap in project pinot by linkedin.
the class PercentageBasedRoutingTableSelector method init.
public void init(Configuration configuration, ZkHelixPropertyStore<ZNRecord> propertyStore) {
try {
Configuration tablesConfig = configuration.subset(TABLE_KEY);
if (tablesConfig == null || tablesConfig.isEmpty()) {
LOGGER.info("No specific table configuration. Using 0% LLC for all tables");
return;
}
ConfigurationMap cmap = new ConfigurationMap(tablesConfig);
Set<Map.Entry<String, Integer>> mapEntrySet = cmap.entrySet();
for (Map.Entry<String, Integer> entry : mapEntrySet) {
LOGGER.info("Using {} percent LLC routing for table {}", entry.getValue(), entry.getKey());
_percentMap.put(entry.getKey(), entry.getValue());
}
} catch (Exception e) {
LOGGER.warn("Could not parse get config for {}. Using no LLC routing", TABLE_KEY, e);
}
}
Aggregations