-
Notifications
You must be signed in to change notification settings - Fork 20
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
CASSANDRA-18221: Add AccordConfig to track accord specific configs #39
base: trunk
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ | |
|
||
import javax.annotation.Nullable; | ||
|
||
import accord.utils.AccordConfig; | ||
import accord.utils.IntrusiveLinkedList; | ||
import accord.utils.IntrusiveLinkedListNode; | ||
import accord.coordinate.*; | ||
|
@@ -88,11 +89,13 @@ boolean isAtLeastCommitted() | |
enum DisseminateStatus { NotExecuted, Durable, Done } | ||
|
||
final Node node; | ||
final AccordConfig config; | ||
final List<Instance> instances = new CopyOnWriteArrayList<>(); | ||
|
||
public SimpleProgressLog(Node node) | ||
public SimpleProgressLog(Node node, AccordConfig config) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should |
||
{ | ||
this.node = node; | ||
this.config = config; | ||
} | ||
|
||
class Instance extends IntrusiveLinkedList<Instance.State.Monitoring> implements ProgressLog, Runnable | ||
|
@@ -822,7 +825,7 @@ void ensureScheduled() | |
return; | ||
|
||
isScheduled = true; | ||
node.scheduler().once(() -> commandStore.execute(PreLoadContext.empty(), ignore -> run()).begin(commandStore.agent()), 200L, TimeUnit.MILLISECONDS); | ||
node.scheduler().once(() -> commandStore.execute(PreLoadContext.empty(), ignore -> run()).begin(commandStore.agent()), config.progress_log_scheduler_delay_in_ms, TimeUnit.MILLISECONDS); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we are trying to move away from |
||
} | ||
|
||
@Override | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package accord.utils; | ||
|
||
public class AccordConfig { | ||
public long progress_log_scheduler_delay_in_ms = 200L; | ||
|
||
public AccordConfig(long progress_log_scheduler_delay_in_ms) { | ||
this.progress_log_scheduler_delay_in_ms = progress_log_scheduler_delay_in_ms; | ||
} | ||
Comment on lines
+6
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this constructor isn't something we can maintain, as we add more and more configs this will become an issue |
||
|
||
public AccordConfig() {} | ||
} |
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.
I feel we should have
accord.config
package, this is likely to expand over time