aokolnychyi commented on a change in pull request #2287:
URL: https://github.com/apache/iceberg/pull/2287#discussion_r592961634



##########
File path: spark/src/main/java/org/apache/iceberg/actions/BaseSparkAction.java
##########
@@ -50,6 +55,7 @@
 
   private final SparkSession spark;
   private final JavaSparkContext sparkContext;
+  private AtomicInteger counter = new AtomicInteger();

Review comment:
       I think this can be final. I'd also call it `jobCounter` or something to 
be specific.
   
   If we decide to keep the job counter in `BaseSparkAction`, then we can offer 
the following method:
   
   ```
     protected JobGroupInfo newJobGroupInfo(String groupId, String desc) {
       return new JobGroupInfo(groupId, desc + "-" + 
jobCounter.incrementAndGet(), false);
     }
   ```
   
   That way, we hide the complexity of assigning the job count from individual 
actions.




----------------------------------------------------------------
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]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to