-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RIP-74] Rocketmq-flink dynamic load balancing #126
base: main
Are you sure you want to change the base?
Conversation
import java.util.concurrent.atomic.AtomicBoolean; | ||
|
||
public class SpinLock { | ||
private AtomicBoolean lock = new AtomicBoolean(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why default value is true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially, the lock is free
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is suggested to reverse
@@ -26,6 +25,8 @@ | |||
import org.apache.flink.connector.rocketmq.source.util.UtilAll; | |||
import org.apache.flink.util.FlinkRuntimeException; | |||
import org.apache.flink.util.StringUtils; | |||
|
|||
import com.alibaba.fastjson.JSON; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Configure IDE, avoid unnecessary changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flink use specific code style, could use "mvn clean install"
// The internal states of the enumerator. | ||
// This set is only accessed by the partition discovery callable in the callAsync() method. | ||
// The current assignment by reader id. Only accessed by the coordinator thread. | ||
// The discovered and initialized partition splits that are waiting for owner reader to be | ||
// ready. | ||
private final Set<MessageQueue> allocatedSet; | ||
private final Map<MessageQueue, Byte> allocatedSet; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need rename allocatedSet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This object may be manipulated by multiple threads
import java.util.concurrent.atomic.AtomicBoolean; | ||
|
||
public class SpinLock { | ||
private AtomicBoolean lock = new AtomicBoolean(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is suggested to reverse
// check | ||
SourceCheckEvent sourceCheckEvent = new SourceCheckEvent(); | ||
sourceCheckEvent.setAssignedMq(currentOffsetTable.keySet()); | ||
sourceReaderContext.sendSourceEventToCoordinator(sourceCheckEvent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
send event to coordinator too frequency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done~,It has been changed to a scheduled task
#125
docs: https://shimo.im/docs/RKAWMOEYgXfM88q8