PawasChhokra 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_r282278044
##########
File path:
samza-kv/src/main/scala/org/apache/samza/storage/kv/LoggedStore.scala
##########
@@ -19,34 +19,44 @@
package org.apache.samza.storage.kv
+import org.apache.samza.SamzaException
+import org.apache.samza.config.Config
import org.apache.samza.util.Logging
import org.apache.samza.system.{OutgoingMessageEnvelope, SystemStreamPartition}
import org.apache.samza.task.MessageCollector
+import scala.collection.JavaConverters.asScalaBufferConverter
+
/**
* A key/value store decorator that adds a changelog for any changes made to
the underlying store
*/
-class LoggedStore[K, V](
- val store: KeyValueStore[K, V],
+class LoggedStore(
+ val store: KeyValueStore[Array[Byte], Array[Byte]],
+ val storeName: String,
+ val storeConfig: Config,
val systemStreamPartition: SystemStreamPartition,
val collector: MessageCollector,
- val metrics: LoggedStoreMetrics = new LoggedStoreMetrics) extends
KeyValueStore[K, V] with Logging {
+ val metrics: LoggedStoreMetrics = new LoggedStoreMetrics) extends
KeyValueStore[Array[Byte], Array[Byte]] with Logging {
val systemStream = systemStreamPartition.getSystemStream
val partitionId = systemStreamPartition.getPartition.getPartitionId
+ private val DEFAULT_CHANGELOG_MAX_MSG_SIZE_BYTES = 1000000
+ private val CHANGELOG_MAX_MSG_SIZE_BYTES = "changelog.max.message.size.bytes"
+ private val maxMessageSize =
storeConfig.getInt(CHANGELOG_MAX_MSG_SIZE_BYTES,
DEFAULT_CHANGELOG_MAX_MSG_SIZE_BYTES) // slightly less than 1 MB
Review comment:
Done.
----------------------------------------------------------------
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