Skip to content

Refactor IndexWriter implementation #2794

Closed
@junghoon-vans

Description

@junghoon-vans

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);

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions