Skip to content

Make MemTableRepFactory into a Customizable class - #8419

Closed
mrambacher wants to merge 33 commits into
meta:mainfrom
mrambacher:CustomMemTableRepFactory
Closed

mrambacher wants to merge 33 commits into
meta:mainfrom
mrambacher:CustomMemTableRepFactory

Conversation

@mrambacher

Copy link
Copy Markdown
Contributor

This PR does the following:
-> Makes the MemTableRepFactory into a Customizable class and creatable/configurable via CreateFromString
-> Makes the existing implementations compatible with configurations
-> Moves the "SpecialRepFactory" test class into testutil, accessible via the ObjectRegistry or a NewSpecial API

New tests were added to validate the functionality and all existing tests pass. db_bench and memtablerep_bench were hand-tested to verify the functionality in those tools.

- Add a loaded test (via SpecialSkipListFactory)
- Moved SpecialSkipListFactory into testutil.cc and hide behind a constructor.
- Fix IsInstanceOf method for the factories to use the alternate names and class names
- Fix db_bench and memtablerep_bench to use the new CreateFromString methods
- Add test for setting the properties via configure methods
@mrambacher
mrambacher force-pushed the CustomMemTableRepFactory branch from 9478e32 to 9db1dd2 Compare June 30, 2021 01:09
@facebook-github-bot

Copy link
Copy Markdown
Contributor

@mrambacher has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Comment thread memtable/skiplistrep.cc
&skiplist_factory_info);
}

std::string SkipListFactory::GetId() const {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Any rule here to create the ID based on name:lookahead_value?

#ifndef ROCKSDB_LITE
status = config_options.registry->NewUniqueObject(id, result);
#else
std::vector<std::string> opts_list = StringSplit(id, ':');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Based on the previous code, id=name:lookahead_. But it is still strange to me to use it from the ID. not options in the "value"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The old serialized options could contain things like memtable=VectorRepFactory. The new one will say memtable=VectorRepFactory:size. The latter form (in the new code) should be parsed just fine by the old code (I will run a compatibility test against old versions soon).

If I do not use id=name:lookahead_, then the format will be memtable={id=VectoryRepFactory; lookahead=#}. This format will not work for the old code.

If you prefer to not use the "id", I can make that work but am not sure there is any real advantage one way or another.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see. Then it is fine here. But maybe add comment to make it clear why.

Comment thread tools/db_bench_tool.cc Resolved

@zhichao-cao zhichao-cao left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks!

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@mrambacher has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@mrambacher has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@mrambacher has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@mrambacher has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@mrambacher has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@mrambacher has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@mrambacher has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@mrambacher has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@mrambacher has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@mrambacher has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@mrambacher has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

1 similar comment
@facebook-github-bot

Copy link
Copy Markdown
Contributor

@mrambacher has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@mrambacher has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@mrambacher has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@mrambacher has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@mrambacher has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@mrambacher has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@mrambacher has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@mrambacher merged this pull request in beed864.

yoori pushed a commit to yoori/rocksdb that referenced this pull request Nov 26, 2023
Summary:
This PR does the following:
-> Makes the MemTableRepFactory into a Customizable class and creatable/configurable via CreateFromString
-> Makes the existing implementations compatible with configurations
-> Moves the "SpecialRepFactory" test class into testutil, accessible via the ObjectRegistry or a NewSpecial API

New tests were added to validate the functionality and all existing tests pass.  db_bench and memtablerep_bench were hand-tested to verify the functionality in those tools.

Pull Request resolved: meta/rocksdb#8419

Reviewed By: zhichao-cao

Differential Revision: D29558961

Pulled By: mrambacher

fbshipit-source-id: 81b7229636e4e649a0c914e73ac7b0f8454c931c
Tim-Reed pushed a commit to Tim-Reed/rocksdb that referenced this pull request Oct 1, 2026
Summary:
This PR does the following:
-> Makes the MemTableRepFactory into a Customizable class and creatable/configurable via CreateFromString
-> Makes the existing implementations compatible with configurations
-> Moves the "SpecialRepFactory" test class into testutil, accessible via the ObjectRegistry or a NewSpecial API

New tests were added to validate the functionality and all existing tests pass.  db_bench and memtablerep_bench were hand-tested to verify the functionality in those tools.

Pull Request resolved: meta#8419

Reviewed By: zhichao-cao

Differential Revision: D29558961

Pulled By: mrambacher

fbshipit-source-id: 81b7229636e4e649a0c914e73ac7b0f8454c931c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants