keith-turner commented on a change in pull request #956: FLUO-939 Make 
TransactorCache configurable
URL: https://github.com/apache/fluo/pull/956#discussion_r146914724
 
 

 ##########
 File path: 
modules/core/src/main/java/org/apache/fluo/core/impl/FluoConfigurationImpl.java
 ##########
 @@ -185,6 +185,52 @@ public static long 
getVisibilityCacheTimeout(FluoConfiguration conf, TimeUnit tu
     return tu.convert(millis, TimeUnit.MILLISECONDS);
   }
 
+  private static final String TRANSACTOR_MAX_CACHE_SIZE =
+      FLUO_IMPL_PREFIX + ".transactor.cache.max.size";
+  private static final long TRANSACTOR_MAX_CACHE_SIZE_DEFAULT = 32768; // this 
equals 2^15 
+
+  public static long getTransactorMaxCacheSize(FluoConfiguration conf) {
+    long size = conf.getLong(TRANSACTOR_MAX_CACHE_SIZE, 
TRANSACTOR_MAX_CACHE_SIZE_DEFAULT);
+    if (size <= 0) {
+      throw new IllegalArgumentException(
+          "Cache size must be positive for " + TRANSACTOR_MAX_CACHE_SIZE);
+    }
+    return size;
+  }
+
+  public static final String TRANSACTOR_CACHE_SIZE = FLUO_IMPL_PREFIX + 
".transactor.cache.size.mb";
+  public static final long TRANSACTOR_CACHE_SIZE_DEFAULT = 10_000_000;
+
+  /** 
+   * Gets the transactor cache size
+   * 
+   * @param conf The FluoConfiguration
+   * @return The size of the cache value from the property value {@value 
#TRANSACTOR_CACHE_SIZE}
+   *     if it is set, else the value of the default value {@value 
#TRANSACTOR_CACHE_SIZE_DEFAULT}
+   */
+
+  public static long getTransactorCacheSize(FluoConfiguration conf) {
 
 Review comment:
   This method is not used and can be dropped.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to