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

Schema Management APIs for Enhanced Debugging in JanusGraph #4754

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

ntisseyre
Copy link
Contributor

This PR introduces new schema management APIs to JanusGraph to enhance debugging capabilities, especially for issues where information is derived from logs. These APIs provide utilities to map between vertex IDs and their hex string representation, retrieve index key hex strings, and obtain index information using hex strings.

The added methods are:

getVertexId(String hexString)

Purpose: Converts a hex string back to its corresponding vertex ID.
Parameters:
hexString: A hexadecimal string representing the vertex ID.
Returns:
Vertex ID as an object.

getIndexKey(String indexName, Map<String, Object> fieldValues)

Purpose: Generates a hex string representing a schema index's index key bytes for given index name and vertex properties values.
Parameters:
indexName: The name of the schema index.
fieldValues: A map of index fields and their corresponding values.
Returns:
A hex string representing the index key.

getIndexInfo(String hexString)

Purpose: Decodes a hex string to retrieve composite index information.
Parameters:
hexString: A hexadecimal string representing the index key.
Returns:
CompositeIndexType: The composite index details.

Key Benefits

Improved Debugging: Facilitates troubleshooting by enabling a direct relationship between logs and schema elements.
Enhanced Index Management: Allows index information to be decoded for better schema debugging and analysis.

Usage Example

  1. Given a hex string from a log file, use getVertexId() to identify the associated vertex.
  2. Decode the hex string with getIndexInfo() to retrieve comprehensive details about the composite index.

@ntisseyre ntisseyre changed the title Initial commit Schema Management APIs for Enhanced Debugging in JanusGraph Jan 23, 2025
Copy link
Member

@porunov porunov left a comment

Choose a reason for hiding this comment

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

Thank you @ntisseyre ! I just added small two nitpicks which are not necessary needed to be resolved right now, but we can handle them in the follow up PRs if you want (as you prefer).
I noticed your commit message is Initial commit. Just ensure to change the commit message when it's ready to be merged.
Otherwise - LGTM.

Signed-off-by: ntisseyre <ntisseyre@apple.com>
@ntisseyre
Copy link
Contributor Author

Thank you @ntisseyre ! I just added small two nitpicks which are not necessary needed to be resolved right now, but we can handle them in the follow up PRs if you want (as you prefer). I noticed your commit message is Initial commit. Just ensure to change the commit message when it's ready to be merged. Otherwise - LGTM.

Thanks for the review @porunov ! I have fixed the commit message

Copy link
Member

@porunov porunov left a comment

Choose a reason for hiding this comment

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

Thank you! LGTM.

@porunov porunov added this to the 1.2.0 milestone Jan 23, 2025
@ntisseyre ntisseyre merged commit 613996f into JanusGraph:master Jan 23, 2025
107 checks passed
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.

2 participants