[
https://issues.apache.org/jira/browse/GOBBLIN-706?focusedWorklogId=217341&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-217341
]
ASF GitHub Bot logged work on GOBBLIN-706:
------------------------------------------
Author: ASF GitHub Bot
Created on: 22/Mar/19 16:53
Start Date: 22/Mar/19 16:53
Worklog Time Spent: 10m
Work Description: ibuenros commented on pull request #2576:
[GOBBLIN-706]enable dynamic mappers
URL: https://github.com/apache/incubator-gobblin/pull/2576#discussion_r268254738
##########
File path:
gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/source/extractor/extract/kafka/KafkaSource.java
##########
@@ -258,9 +258,15 @@ public String apply(KafkaTopic topic) {
// Create empty WorkUnits for skipped partitions (i.e., partitions that
have previous offsets,
// but aren't processed).
createEmptyWorkUnitsForSkippedPartitions(workUnits,
topicSpecificStateMap, state);
-
+ //determine the number of mappers
int numOfMultiWorkunits =
state.getPropAsInt(ConfigurationKeys.MR_JOB_MAX_MAPPERS_KEY,
ConfigurationKeys.DEFAULT_MR_JOB_MAX_MAPPERS);
+ if(state.contains(ConfigurationKeys.TARGET_MAPPER_SIZE)) {
+ double totalEstDataSize = KafkaWorkUnitPacker.getInstance(this,
state).getWorkUnitEstSizes(workUnits);
+ LOG.info(String.format("The total estimated data size is %.2f",
totalEstDataSize));
+ double targetMapperSize =
state.getPropAsDouble(ConfigurationKeys.TARGET_MAPPER_SIZE);
+ numOfMultiWorkunits = (int) (totalEstDataSize / targetMapperSize);
Review comment:
You probably need to add 1 to this. If `totalEstDataSize < targetMapperSize`
you would end up with 0 mappers :)
----------------------------------------------------------------
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 217341)
Time Spent: 1h (was: 50m)
> Making KafkaSource dynamically determine the number of mapper
> -------------------------------------------------------------
>
> Key: GOBBLIN-706
> URL: https://issues.apache.org/jira/browse/GOBBLIN-706
> Project: Apache Gobblin
> Issue Type: Improvement
> Reporter: Lei Sun
> Priority: Major
> Time Spent: 1h
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)