wardlican commented on code in PR #3950:
URL: https://github.com/apache/amoro/pull/3950#discussion_r3007259009


##########
amoro-optimizer/amoro-optimizer-common/src/main/java/org/apache/amoro/optimizer/common/OptimizerToucher.java:
##########
@@ -32,7 +32,7 @@
 public class OptimizerToucher extends AbstractOptimizerOperator {
   private static final Logger LOG = 
LoggerFactory.getLogger(OptimizerToucher.class);
 
-  private TokenChangeListener tokenChangeListener;
+  private transient TokenChangeListener tokenChangeListener;

Review Comment:
   The reason is that `AbstractOptimizerOperator` implements `Serializable`; 
consequently, `OptimizerToucher`—being a subclass—is also a serializable 
object. `TokenChangeListener` is an interface that is typically implemented by 
callers (such as the Flink or Spark optimizer) using lambda expressions or 
anonymous classes. If the `transient` keyword is omitted, a 
`NotSerializableException` will be thrown whenever `OptimizerToucher` is 
serialized (for instance, when Flink or Spark distributes tasks to executors).



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to