@Test public void testBasic() { FluoConfiguration conf = new FluoConfiguration(); Assert.assertEquals(FluoConfigurationImpl.CW_MIN_THREADS_DEFAULT, FluoConfigurationImpl.getNumCWThreads(conf, 3)); Assert.assertEquals(10, FluoConfigurationImpl.getNumCWThreads(conf, 10)); Assert.assertEquals(FluoConfigurationImpl.CW_MAX_THREADS_DEFAULT, FluoConfigurationImpl.getNumCWThreads(conf, 100)); conf.setProperty(FluoConfigurationImpl.CW_MAX_THREADS_PROP, 40); Assert.assertEquals(40, FluoConfigurationImpl.getNumCWThreads(conf, 100)); Assert.assertEquals(FluoConfigurationImpl.CW_MIN_THREADS_DEFAULT, FluoConfigurationImpl.getNumCWThreads(conf, 3)); conf.setProperty(FluoConfigurationImpl.CW_MIN_THREADS_PROP, 5); Assert.assertEquals(5, FluoConfigurationImpl.getNumCWThreads(conf, 3)); }
public static int getNumCWThreads(FluoConfiguration conf, int numTservers) { int min = conf.getInt(CW_MIN_THREADS_PROP, CW_MIN_THREADS_DEFAULT); int max = conf.getInt(CW_MAX_THREADS_PROP, CW_MAX_THREADS_DEFAULT); if (min < 0 || max < 0 || min > max) { throw new IllegalArgumentException("Bad conditional writer thread props " + min + " " + max); } int numThreads = numTservers; numThreads = Math.min(numThreads, max); numThreads = Math.max(numThreads, min); return numThreads; }
FluoConfigurationImpl { public static int getNumCWThreads(FluoConfiguration conf, int numTservers) { int min = conf.getInt(CW_MIN_THREADS_PROP, CW_MIN_THREADS_DEFAULT); int max = conf.getInt(CW_MAX_THREADS_PROP, CW_MAX_THREADS_DEFAULT); if (min < 0 || max < 0 || min > max) { throw new IllegalArgumentException("Bad conditional writer thread props " + min + " " + max); } int numThreads = numTservers; numThreads = Math.min(numThreads, max); numThreads = Math.max(numThreads, min); return numThreads; } }
FluoConfigurationImpl { public static int getNumCWThreads(FluoConfiguration conf, int numTservers) { int min = conf.getInt(CW_MIN_THREADS_PROP, CW_MIN_THREADS_DEFAULT); int max = conf.getInt(CW_MAX_THREADS_PROP, CW_MAX_THREADS_DEFAULT); if (min < 0 || max < 0 || min > max) { throw new IllegalArgumentException("Bad conditional writer thread props " + min + " " + max); } int numThreads = numTservers; numThreads = Math.min(numThreads, max); numThreads = Math.max(numThreads, min); return numThreads; }  }
FluoConfigurationImpl { public static int getNumCWThreads(FluoConfiguration conf, int numTservers) { int min = conf.getInt(CW_MIN_THREADS_PROP, CW_MIN_THREADS_DEFAULT); int max = conf.getInt(CW_MAX_THREADS_PROP, CW_MAX_THREADS_DEFAULT); if (min < 0 || max < 0 || min > max) { throw new IllegalArgumentException("Bad conditional writer thread props " + min + " " + max); } int numThreads = numTservers; numThreads = Math.min(numThreads, max); numThreads = Math.max(numThreads, min); return numThreads; }  static int getNumCWThreads(FluoConfiguration conf, int numTservers); static int getNumBWThreads(FluoConfiguration conf, int numTservers); static int getTxCommitMemory(FluoConfiguration conf); static long getTxInfoCacheWeight(FluoConfiguration conf); static long getTxIfoCacheTimeout(FluoConfiguration conf, TimeUnit tu); static long getVisibilityCacheWeight(FluoConfiguration conf); static long getVisibilityCacheTimeout(FluoConfiguration conf, TimeUnit tu); static long getTransactorMaxCacheSize(FluoConfiguration conf); static long getTransactorCacheTimeout(FluoConfiguration conf, TimeUnit tu); }
FluoConfigurationImpl { public static int getNumCWThreads(FluoConfiguration conf, int numTservers) { int min = conf.getInt(CW_MIN_THREADS_PROP, CW_MIN_THREADS_DEFAULT); int max = conf.getInt(CW_MAX_THREADS_PROP, CW_MAX_THREADS_DEFAULT); if (min < 0 || max < 0 || min > max) { throw new IllegalArgumentException("Bad conditional writer thread props " + min + " " + max); } int numThreads = numTservers; numThreads = Math.min(numThreads, max); numThreads = Math.max(numThreads, min); return numThreads; }  static int getNumCWThreads(FluoConfiguration conf, int numTservers); static int getNumBWThreads(FluoConfiguration conf, int numTservers); static int getTxCommitMemory(FluoConfiguration conf); static long getTxInfoCacheWeight(FluoConfiguration conf); static long getTxIfoCacheTimeout(FluoConfiguration conf, TimeUnit tu); static long getVisibilityCacheWeight(FluoConfiguration conf); static long getVisibilityCacheTimeout(FluoConfiguration conf, TimeUnit tu); static long getTransactorMaxCacheSize(FluoConfiguration conf); static long getTransactorCacheTimeout(FluoConfiguration conf, TimeUnit tu); static final String FLUO_IMPL_PREFIX; static final String ORACLE_PORT_PROP; static final String WORKER_FINDER_PROP; static final String WORKER_PARTITION_GROUP_SIZE; static final int WORKER_PARTITION_GROUP_SIZE_DEFAULT; static final String METRICS_RESERVOIR_PROP; static final String NTFY_FINDER_MIN_SLEEP_TIME_PROP; static final int NTFY_FINDER_MIN_SLEEP_TIME_DEFAULT; static final String NTFY_FINDER_MAX_SLEEP_TIME_PROP; static final int NTFY_FINDER_MAX_SLEEP_TIME_DEFAULT; static final String ACCUMULO_JARS_REGEX_PROP; static final String ACCUMULO_JARS_REGEX_DEFAULT; static final String ZK_UPDATE_PERIOD_PROP; static final long ZK_UPDATE_PERIOD_MS_DEFAULT; static final String CW_MIN_THREADS_PROP; static final int CW_MIN_THREADS_DEFAULT; static final String CW_MAX_THREADS_PROP; static final int CW_MAX_THREADS_DEFAULT; static final String BW_MIN_THREADS_PROP; static final int BW_MIN_THREADS_DEFAULT; static final String BW_MAX_THREADS_PROP; static final int BW_MAX_THREADS_DEFAULT; static final String COMMIT_MEMORY_PROP; static final int COMMIT_MEMORY_DEFAULT; static final String TX_INFO_CACHE_WEIGHT; static final long TX_INFO_CACHE_WEIGHT_DEFAULT; static final String TX_INFO_CACHE_TIMEOUT; static final long TX_INFO_CACHE_TIMEOUT_DEFAULT; static final String VISIBILITY_CACHE_WEIGHT; static final long VISIBILITY_CACHE_WEIGHT_DEFAULT; static final String VISIBILITY_CACHE_TIMEOUT; static final long VISIBILITY_CACHE_TIMEOUT_DEFAULT; static final String TRANSACTOR_CACHE_TIMEOUT; static final long TRANSACTOR_CACHE_TIMEOUT_DEFAULT; static final String ASYNC_CW_THREADS; static final int ASYNC_CW_THREADS_DEFAULT; static final String ASYNC_CW_LIMIT; static final int ASYNC_CW_LIMIT_DEFAULT; static final String ASYNC_COMMIT_THREADS; static final int ASYNC_COMMIT_THREADS_DEFAULT; static final String SYNC_COMMIT_THREADS; static final int SYNC_COMMIT_THREADS_DEFAULT; }