@@ -152,24 +152,6 @@ public final class BatchContext<PropertiesT> implements Closeable {
152152 /** Lightway check to ensure users cannot send on a closed context. */
153153 private volatile boolean closed ;
154154
155- // /** Closing state. */
156- // private volatile Closing closing;
157-
158- // /**
159- // * setClosing trasitions BatchContext to {@link Closing} state exactly once.
160- // * Once this method returns, the caller can call {@code closing.await()}.
161- // */
162- // void setClosing(Exception ex) {
163- // if (closing == null) {
164- // synchronized (Closing.class) {
165- // if (closing == null) {
166- // closing = new Closing(ex);
167- // setState(closing);
168- // }
169- // }
170- // }
171- // }
172-
173155 BatchContext (
174156 StreamFactory <Message , Event > streamFactory ,
175157 int maxSizeBytes ,
@@ -207,6 +189,7 @@ void start(State nextState) {
207189 workers = new CountDownLatch (2 );
208190
209191 messages = streamFactory .createStream (new Recv ());
192+ System .out .println ("create stream" );
210193
211194 // Start the stream and await Started message.
212195 messages .onNext (Message .start (collectionHandleDefaults .consistencyLevel ()));
@@ -654,9 +637,6 @@ private final void onResults(Event.Results results) {
654637 }
655638
656639 private final void onBackoff (Event .Backoff backoff ) {
657- System .out .print ("========== BACKOFF ==============" );
658- System .out .print (backoff .maxSize ());
659- System .out .print ("=================================" );
660640 batch .setMaxSize (backoff .maxSize ());
661641 }
662642
@@ -840,11 +820,13 @@ private void reconnectNow() {
840820 /**
841821 * Schedule a task to {@link #reconnect} after a delay.
842822 *
843- * @param delaySeconds Delay in seconds.
823+ * <h3>API Note</h3>
824+ * The task is scheduled on {@link #scheduledExec} even if
825+ * {@code delaySeconds == 0} to avoid blocking gRPC worker
826+ * thread,
827+ * where the {@link BatchContext#onEvent} callback runs.
844828 *
845- * @apiNote The task is scheduled on {@link #scheduledExec} even if
846- * {@code delaySeconds == 0} to avoid blocking gRPC worker thread,
847- * where the {@link BatchContext#onEvent} callback runs.
829+ * @param delaySeconds Delay in seconds.
848830 */
849831 private void reconnectAfter (long delaySeconds ) {
850832 retries ++;
0 commit comments