/** * @param config Oryx {@link Config} object * @since 2.0.0 */ protected AbstractServingModelManager(Config config) { this.config = config; this.readOnly = config.getBoolean("oryx.serving.api.read-only"); }
public boolean getBoolean(String path, boolean def) { if (m_config.hasPath(path)) return m_config.getBoolean(path); else return def; }
/** * Check whether metrics collection and reporting are enabled or not. * * @param cfg a {@link State} object containing configuration properties * @return whether metrics collection and reporting are enabled */ public static boolean isEnabled(Config cfg) { return cfg.hasPath(ConfigurationKeys.METRICS_ENABLED_KEY) ? cfg.getBoolean(ConfigurationKeys.METRICS_ENABLED_KEY) : Boolean.parseBoolean(ConfigurationKeys.DEFAULT_METRICS_ENABLED); }
/** Adds the JMX monitoring settings. */ private void addMonitoring() { configuration.setStatisticsEnabled(merged.getBoolean("monitoring.statistics")); configuration.setManagementEnabled(merged.getBoolean("monitoring.management")); }
public boolean conservative() { return config().getBoolean("tiny-lfu.count-min.conservative"); } public CountMin4Settings countMin4() {
public boolean strictCapacity() { return config().getBoolean("collision.strict-capacity"); } public Stream<Density> density() {
public boolean enabled() { return config().getBoolean(basePath + ".doorkeeper.enabled"); } public double fpp() {
public boolean ascending() { return config().getBoolean("report.ascending"); } public String output() {
@ValidateMe public boolean recordInternalTransactionsData() { if (recordInternalTransactionsData == null) { recordInternalTransactionsData = config.getBoolean("record.internal.transactions.data"); } return recordInternalTransactionsData; }
@ValidateMe public boolean dumpFull() { return config.getBoolean("dump.full"); }
@ValidateMe public boolean fastSyncBackupState() { return config.getBoolean("sync.fast.backupState"); }
@ValidateMe public boolean dumpCleanOnRestart() { return config.getBoolean("dump.clean.on.restart"); }
@ValidateMe public boolean isSyncEnabled() { return this.syncEnabled == null ? config.getBoolean("sync.enabled") : syncEnabled; }
/** Adds the entry listeners settings. */ private void addListeners() { for (String path : merged.getStringList("listeners")) { Config listener = root.getConfig(path); Factory<? extends CacheEntryListener<? super K, ? super V>> listenerFactory = factoryCreator.factoryOf(listener.getString("class")); Factory<? extends CacheEntryEventFilter<? super K, ? super V>> filterFactory = null; if (listener.hasPath("filter")) { filterFactory = factoryCreator.factoryOf(listener.getString("filter")); } boolean oldValueRequired = listener.getBoolean("old-value-required"); boolean synchronous = listener.getBoolean("synchronous"); configuration.addCacheEntryListenerConfiguration( new MutableCacheEntryListenerConfiguration<>( listenerFactory, filterFactory, oldValueRequired, synchronous)); } }
public ALSSpeedModelManager(Config config) { noKnownItems = config.getBoolean("oryx.als.no-known-items"); minModelLoadFraction = config.getDouble("oryx.speed.min-model-load-fraction"); Preconditions.checkArgument(minModelLoadFraction >= 0.0 && minModelLoadFraction <= 1.0); logRateLimit = new RateLimitCheck(1, TimeUnit.MINUTES); }
public DbFlushManager(SystemProperties config, Set<DbSource> dbSources, AbstractCachedSource<byte[], byte[]> stateDbCache) { this.config = config; this.dbSources = dbSources; sizeThreshold = config.getConfig().getInt("cache.flush.writeCacheSize") * 1024 * 1024; commitsCountThreshold = config.getConfig().getInt("cache.flush.blocks"); flushAfterSyncDone = config.getConfig().getBoolean("cache.flush.shortSyncFlush"); this.stateDbCache = stateDbCache; }
/** Adds the write through settings. */ private void addWriteThrough() { configuration.setWriteThrough(merged.getBoolean("write-through.enabled")); if (isSet("write-through.writer")) { configuration.setCacheWriterFactory(factoryCreator.factoryOf( merged.getString("write-through.writer"))); } }
/** Adds the store-by-value settings. */ private void addStoreByValue() { configuration.setStoreByValue(merged.getBoolean("store-by-value.enabled")); if (isSet("store-by-value.strategy")) { configuration.setCopierFactory(factoryCreator.factoryOf( merged.getString("store-by-value.strategy"))); } }
/** Adds the read through settings. */ private void addReadThrough() { configuration.setReadThrough(merged.getBoolean("read-through.enabled")); if (isSet("read-through.loader")) { configuration.setCacheLoaderFactory(factoryCreator.factoryOf( merged.getString("read-through.loader"))); } }
@Test public void testMergeConfigs4() { String firstConfig = "peer.listen.port=30123,sync.enabled=true"; SystemProperties props = new SystemProperties(); Config config = props.mergeConfigs(firstConfig, ConfigFactory::parseString); assertEquals(30123, config.getInt("peer.listen.port")); assertEquals(Boolean.TRUE, config.getBoolean("sync.enabled")); }