Here are the examples of the java api play.Configuration.keys() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
6 Examples
16
Source : SQLBasedRetrieverConfig.java
with MIT License
from grouplens
with MIT License
from grouplens
public static RetrieverConfig getRetrieverConfig(Configuration retrieverConfig, Injector injector) {
int limit = 500;
if (retrieverConfig.asMap().containsKey("limit")) {
limit = retrieverConfig.getInt("limit");
}
int offset = 0;
if (retrieverConfig.asMap().containsKey("offset")) {
offset = retrieverConfig.getInt("offset");
}
Map<String, Boolean> orderByFields = new HashMap<>();
if (retrieverConfig.asMap().containsKey("orderByFields")) {
Configuration orderConfig = retrieverConfig.getConfig("orderByFields");
for (String name : orderConfig.keys()) {
orderByFields.put(name, orderConfig.getBoolean(name));
}
}
Map<String, String> renameMap = new HashMap<>();
if (retrieverConfig.asMap().containsKey("renameFields")) {
Configuration renameConfig = retrieverConfig.getConfig("renameFields");
for (String name : renameConfig.keys()) {
renameMap.put(name, renameConfig.getString(name));
}
}
return new SQLBasedRetrieverConfig(retrieverConfig.getString("setCursorKey"), limit, offset, retrieverConfig.getString("selectSqlKey"), retrieverConfig.getStringList("matchFields"), retrieverConfig.getStringList("greaterFields"), retrieverConfig.getStringList("lessFields"), retrieverConfig.getStringList("matchFieldTypes"), retrieverConfig.getStringList("greaterFieldTypes"), retrieverConfig.getStringList("lessFieldTypes"), retrieverConfig.getString("db"), retrieverConfig.getStringList("selectFields"), renameMap, retrieverConfig.getString("table"), orderByFields, injector, retrieverConfig);
}
16
Source : PercentileBlendingRankerConfig.java
with MIT License
from grouplens
with MIT License
from grouplens
public static RankerConfig getRankerConfig(Configuration rankerConfig, Injector injector) {
int pageSize = 24;
if (rankerConfig.asMap().containsKey(ConfigKey.RANKER_PAGE_SIZE.get())) {
rankerConfig.getInt(ConfigKey.RANKER_PAGE_SIZE.get());
}
Object2DoubleMap<String> defaults = new Object2DoubleOpenHashMap<>();
Configuration defaultConfig = rankerConfig.getConfig("blendingDefaults");
for (String key : defaultConfig.keys()) {
defaults.put(key, defaultConfig.getDouble(key));
}
return new PercentileBlendingRankerConfig(pageSize, defaults, injector, rankerConfig);
}
16
Source : FieldBlendingRankerConfig.java
with MIT License
from grouplens
with MIT License
from grouplens
public static RankerConfig getRankerConfig(Configuration rankerConfig, Injector injector) {
int pageSize = 24;
if (rankerConfig.asMap().containsKey(ConfigKey.RANKER_PAGE_SIZE.get())) {
rankerConfig.getInt(ConfigKey.RANKER_PAGE_SIZE.get());
}
Object2DoubleMap<String> defaults = new Object2DoubleOpenHashMap<>();
Configuration defaultConfig = rankerConfig.getConfig("blendingDefaults");
for (String key : defaultConfig.keys()) {
defaults.put(key, defaultConfig.getDouble(key));
}
return new FieldBlendingRankerConfig(pageSize, defaults, injector, rankerConfig);
}
15
Source : HashBucketRouter.java
with MIT License
from grouplens
with MIT License
from grouplens
private String route(RequestContext requestContext, List<String> hashAttrs, Integer numBuckets, Configuration name2range) {
String key = FeatureExtractorUtilities.composeConcatenatedKey(requestContext.getRequestBody(), hashAttrs);
Integer bucket = Math.floorMod(key.hashCode(), numBuckets);
String hit = null;
for (String name : name2range.keys()) {
List<Integer> ranges = name2range.getIntList(name);
for (int i = 0; i < ranges.size(); i += 2) {
if (bucket >= ranges.get(i) && bucket <= ranges.get(i + 1)) {
hit = name;
}
}
}
return hit;
}
15
Source : SVDFeatureFactorExtractorConfig.java
with MIT License
from grouplens
with MIT License
from grouplens
public static FeatureExtractorConfig getFeatureExtractorConfig(Configuration extractorConfig, Injector injector) {
Map<String, List<String>> fea2svdfeas = new HashMap<>();
Configuration config = extractorConfig.getConfig("feature2dependents");
for (String key : config.keys()) {
fea2svdfeas.put(key, config.getStringList(key));
}
Boolean sparse = false;
if (extractorConfig.asMap().containsKey("sparse")) {
sparse = extractorConfig.getBoolean("sparse");
}
return new SVDFeatureFactorExtractorConfig(injector, fea2svdfeas, extractorConfig.getString("indexName"), extractorConfig.getString("predictorName"), extractorConfig.getString("modelName"), sparse);
}
12
Source : FieldBlendingPredictorConfig.java
with MIT License
from grouplens
with MIT License
from grouplens
public static PredictorConfig getPredictorConfig(Configuration predictorConfig, Injector injector) {
Object2DoubleMap<String> defaults = new Object2DoubleOpenHashMap<>();
Configuration defaultConfig = predictorConfig.getConfig("blendingDefaults");
for (String key : defaultConfig.keys()) {
defaults.put(key, defaultConfig.getDouble(key));
}
List<Configuration> expanders = ExpanderUtilities.getEnreplacedyExpandersConfig(predictorConfig);
return new FieldBlendingPredictorConfig(predictorConfig, predictorConfig.getConfig(ConfigKey.ENreplacedY_DAOS_CONFIG.get()), injector, expanders, defaults, predictorConfig.getString("daoConfigKey"));
}