Skip to content

Commit

Permalink
Repartition RDDs before writing to Alternator
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrf committed Mar 12, 2024
1 parent 6a0895d commit 5a03158
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ object DynamoStreamReplication {
case _ => None
}
.foreachRDD { msgs =>
val rdd = msgs.collect {
case Some(item) => (new Text(), new DynamoDBItemWritable(item))
}
// FIXME re-partition by columns? msgs.repartition(???)
val rdd = msgs
.collect {
case Some(item) => (new Text(), new DynamoDBItemWritable(item))
}
.repartition(Runtime.getRuntime.availableProcessors() * 2)

log.info("Changes to be applied:")
rdd
Expand Down

0 comments on commit 5a03158

Please sign in to comment.