cameronlee314 commented on a change in pull request #1008: SAMZA-2174: Throw a 
record too large exception for oversized records in changelog
URL: https://github.com/apache/samza/pull/1008#discussion_r297888348
 
 

 ##########
 File path: 
samza-kv/src/main/scala/org/apache/samza/storage/kv/BaseKeyValueStorageEngineFactory.scala
 ##########
 @@ -162,4 +184,28 @@ trait BaseKeyValueStorageEngineFactory[K, V] extends 
StorageEngineFactory[K, V]
       keyValueStorageEngineMetrics, batchSize, () => clock.nanoTime())
   }
 
+  def createCachedStore[K, V](enableCache: Boolean, storeName: String, 
registry: MetricsRegistry,
+    underlyingStore: KeyValueStore[K, V], cacheSize: Int, batchSize: Int): 
KeyValueStore[K, V] = {
+    // maybe wrap with caching
+    val maybeCachedStore = if (enableCache) {
+      val cachedStoreMetrics = new CachedStoreMetrics(storeName, registry)
+      new CachedStore(underlyingStore, cacheSize, batchSize, 
cachedStoreMetrics)
+    } else {
+      underlyingStore
+    }
+    maybeCachedStore
+  }
+
+  def createLargeMessageSafeStore(underlyingStore: KeyValueStore[Array[Byte], 
Array[Byte]], storeName: String,
 
 Review comment:
   I think I had suggested this. It wasn't for saving code. It was just to help 
with readability. When everything was inlined, I thought it was a bit difficult 
to keep track of all of the different "store" variables through all of the 
wiring being done. I thought helped to isolate some things so the reader 
doesn't have to keep track of everything all at once.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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