Skip to content

Commit

Permalink
reset seders logic
Browse files Browse the repository at this point in the history
  • Loading branch information
VGalaxies committed Oct 25, 2024
1 parent 4e8edf8 commit 4686d23
Showing 1 changed file with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,9 @@
import org.apache.iotdb.rpc.TSStatusCode;
import org.apache.iotdb.rpc.subscription.exception.SubscriptionException;

import org.apache.tsfile.utils.ReadWriteIOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.DataOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
Expand All @@ -62,6 +60,8 @@ public abstract class AbstractOperateSubscriptionProcedure
private static final int RETRY_THRESHOLD = 1;

// Only used in rollback to reduce the number of network calls
// Pure in-memory object, not involved in snapshot serialization and deserialization.
// TODO: consider serializing this variable later
protected boolean isRollbackFromOperateOnDataNodesSuccessful = false;

protected AtomicReference<SubscriptionInfo> subscriptionInfo;
Expand Down Expand Up @@ -375,16 +375,4 @@ protected int getStateId(OperateSubscriptionState state) {
protected OperateSubscriptionState getInitialState() {
return OperateSubscriptionState.VALIDATE;
}

@Override
public void serialize(DataOutputStream stream) throws IOException {
super.serialize(stream);
ReadWriteIOUtils.write(isRollbackFromOperateOnDataNodesSuccessful, stream);
}

@Override
public void deserialize(ByteBuffer byteBuffer) {
super.deserialize(byteBuffer);
isRollbackFromOperateOnDataNodesSuccessful = ReadWriteIOUtils.readBool(byteBuffer);
}
}

0 comments on commit 4686d23

Please sign in to comment.