keith-turner commented on code in PR #305:
URL: https://github.com/apache/accumulo-testing/pull/305#discussion_r2926984992


##########
src/main/java/org/apache/accumulo/testing/stress/DataWriter.java:
##########
@@ -18,27 +18,19 @@
  */
 package org.apache.accumulo.testing.stress;
 
-import java.lang.ref.Cleaner.Cleanable;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.MutationsRejectedException;
-import org.apache.accumulo.core.util.cleaner.CleanerUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 public class DataWriter extends Stream<Void> implements AutoCloseable {
   private final BatchWriter writer;
   private final RandomMutations mutations;
-  private final Cleanable cleanable;
   private final AtomicBoolean closed = new AtomicBoolean(false);
 
-  private static final Logger log = LoggerFactory.getLogger(DataWriter.class);
-
   public DataWriter(BatchWriter writer, RandomMutations mutations) {
     this.writer = writer;
     this.mutations = mutations;
-    this.cleanable = CleanerUtil.unclosed(this, DataWriter.class, closed, log, 
writer);

Review Comment:
   This was causing problems because `this` escaped in a constructor.  
DataWriter is only used in try with resources, so this extra complexity for the 
cleaner seems unessecary.  Removed it instead of trying to fix the issue w/ 
this.



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