Skip to content
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

Refactor IndexWriter implementation #2794

Open
junghoon-vans opened this issue Dec 1, 2023 · 0 comments · May be fixed by #2795
Open

Refactor IndexWriter implementation #2794

junghoon-vans opened this issue Dec 1, 2023 · 0 comments · May be fixed by #2795
Labels
type: task A general task

Comments

@junghoon-vans
Copy link
Contributor

Currently, the creation of secandary indexes and index helpers within IndexWriter is difficult to read at a glance.
So I'm going to rewrite the code in a declarative style by isolating the methods for creating these indexes.

Secondary Index

AS-IS

Set<byte[]> existingKeys = connection
    .keys(toBytes(indexedData.getKeyspace() + ":" + indexedData.getIndexName() + ":*"));

TO-BE

Set<byte[]> existingKeys = connection.keys(createIndexKey(indexedData, "*"));

Index Helper

AS-IS

byte[] indexHelperKey = ByteUtils.concatAll(toBytes(keyspace + ":"), binKey, toBytes(":idx"));

TO-BE

byte[] indexHelperKey = createIndexHelperKey(keyspace, binKey);
@junghoon-vans junghoon-vans linked a pull request Dec 1, 2023 that will close this issue
4 tasks
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 1, 2023
@mp911de mp911de changed the title Change index creation to declarative. Refactor IndexWriter implementation Jan 22, 2024
@mp911de mp911de added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants