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_r286653704
 
 

 ##########
 File path: 
samza-kv/src/main/scala/org/apache/samza/storage/kv/BaseKeyValueStorageEngineFactory.scala
 ##########
 @@ -124,22 +135,56 @@ trait BaseKeyValueStorageEngineFactory[K, V] extends 
StorageEngineFactory[K, V]
       new LoggedStore(rawStore, changeLogSystemStreamPartition, collector, 
loggedStoreMetrics)
     }
 
-    // wrap with serialization
-    val serializedMetrics = new SerializedKeyValueStoreMetrics(storeName, 
registry)
-    val serialized = new SerializedKeyValueStore[K, V](maybeLoggedStore, 
keySerde, msgSerde, serializedMetrics)
+    var toBeAccessLoggedStore: KeyValueStore[K, V] = null
+
+    if (largeMessagesExpected) {
+      // Execute "if" when we expect to get large messages and user defined 
config -> EXPECT_LARGE_MESSAGES = true
+      // This code path will throw a SamzaException for large message size.
+
+      // maybe wrap with caching
+      val maybeCachedStore = if (enableCache) {
+        val cachedStoreMetrics = new CachedStoreMetrics(storeName, registry)
 
 Review comment:
   The details in the class javadoc for `CachedStore` no longer seem consistent 
with this new functionality. Even though the `CachedStore` can just be used for 
caching bytes, it has some details about deserialization and memory which don't 
seem to apply anymore in this case.

----------------------------------------------------------------
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