prateekm commented on a change in pull request #1039: SAMZA-2197: [Scala
cleanup] Convert TaskConfig to Java
URL: https://github.com/apache/samza/pull/1039#discussion_r291298548
##########
File path:
samza-core/src/main/scala/org/apache/samza/checkpoint/CheckpointTool.scala
##########
@@ -158,14 +159,12 @@ class CheckpointTool(newOffsets:
TaskNameToCheckpointMap, coordinatorStreamStore
combinedConfigMap.putAll(userDefinedConfig)
val combinedConfig: Config = new MapConfig(combinedConfigMap)
+ val taskConfig = new TaskConfig(combinedConfig)
// Instantiate the checkpoint manager with coordinator stream
configuration.
- val checkpointManager: CheckpointManager =
combinedConfig.getCheckpointManagerFactory() match {
- case Some(className) =>
- ReflectionUtil.getObj(classLoader, className,
classOf[CheckpointManagerFactory])
- .getCheckpointManager(combinedConfig, new MetricsRegistryMap)
- case _ =>
- throw new SamzaException("Configuration: task.checkpoint.factory is
not defined.")
- }
+ val checkpointManager: CheckpointManager =
+ JavaOptionals.toRichOptional(taskConfig.getCheckpointManager(new
MetricsRegistryMap, classLoader))
Review comment:
Minor: Can we just call Optional#orElseThrow instead?
----------------------------------------------------------------
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