Skip to content

Single conditional writer for UserFateStore #5670

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kevinrr888
Copy link
Member

@kevinrr888 kevinrr888 commented Jun 20, 2025

Avoids creating multiple conditional writers for UserFateStore.

  • FateStore now extends AutoCloseable
    • MetaFateStore.close() falls back to AbstractFateStores impl of close() which is no-op
    • UserFateStore.close() closes the conditional writer
    • All tests using a FateStore now call close()
    • The real fate stores are closed on the shutdown of fate
  • UserFateStore now only creates a single conditional writer
    • Num threads for this conditional writer set by a new prop CONDITIONAL_WRITER_THREADS_MAX_FATE_TABLE
    • writer in UserFateStore is a memoized Supplier so it's not created when using a ReadOnlyFateStore.

Diff is much larger than actual changes, much of the changes are from needing to put the fate stores in a try-with-resources.
Verified sunny passes and all FATE tests pass

closes #5660

Avoids creating multiple conditional writers for UserFateStore.

* FateStore now extends AutoCloseable
	* MetaFateStore.close() falls back to AbstractFateStores impl of close() which is no-op
	* UserFateStore.close() closes the conditional writer
	* All tests using a FateStore now call close()
	* The real fate stores are closed on the shutdown of fate
* UserFateStore now only creates a single conditional writer
	* Num threads for this conditional writer set by a new prop CONDITIONAL_WRITER_THREADS_MAX_FATE_TABLE
	* writer in UserFateStore is a memoized Supplier so it's not created when using a ReadOnlyFateStore.

closes apache#5660
@kevinrr888 kevinrr888 added this to the 4.0.0 milestone Jun 20, 2025
@kevinrr888 kevinrr888 self-assigned this Jun 20, 2025
Comment on lines +837 to +847
public ConditionalWriter createConditionalWriterForFateTable(String tableName)
throws TableNotFoundException {
ConditionalWriterImpl writer = (ConditionalWriterImpl) createConditionalWriter(tableName);
Integer maxThreads =
ClientProperty.CONDITIONAL_WRITER_THREADS_MAX_FATE_TABLE.getInteger(getClientProperties());
if (maxThreads != null) {
writer.getConfig().setMaxWriteThreads(maxThreads);
}
return writer;
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't want this in public API, so not putting this declaration in AccumuloClient

Comment on lines +84 to +87
CONDITIONAL_WRITER_THREADS_MAX_FATE_TABLE("conditional.writer.threads.max.fate.table", "3",
PropertyType.COUNT,
"Maximum number of threads to use for writing data to tablet servers of the FATE system table.",
"4.0.0", false),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's a good default val for this?

was using try-with-resources on a ReadOnlyFateStore in one place. Reverted the added
try-with-resources
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avoid creating a conditional writer per compaction commit
1 participant