mynameborat commented on a change in pull request #1095: SAMZA-2264 :
Offset.default for intermediate streams
URL: https://github.com/apache/samza/pull/1095#discussion_r301253210
##########
File path: samza-core/src/main/java/org/apache/samza/execution/StreamEdge.java
##########
@@ -125,7 +126,12 @@ Config generateConfig() {
if (isIntermediate()) {
streamConfig.put(String.format(StreamConfig.IS_INTERMEDIATE_FOR_STREAM_ID(),
spec.getId()), "true");
streamConfig.put(String.format(StreamConfig.DELETE_COMMITTED_MESSAGES_FOR_STREAM_ID(),
spec.getId()), "true");
-
streamConfig.put(String.format(StreamConfig.CONSUMER_OFFSET_DEFAULT_FOR_STREAM_ID(),
spec.getId()), "oldest");
+
+ // Setting offset.default to oldest only if the job is running in batch
mode
+ if (new
ApplicationConfig(config).getAppMode().equals(ApplicationConfig.ApplicationMode.BATCH))
{
Review comment:
nit: I'd suggest to do this other way round to guard against getAppMode()
returning potential nulls even though currently it seems to return STREAM by
default.
`ApplicationConfig.ApplicationMode.BATCH.equals(...)`
----------------------------------------------------------------
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