Skip to content

Conversation

sapienza88
Copy link
Contributor

@sapienza88 sapienza88 commented Jun 28, 2025

This PR introduces a set of utility methods designed to efficiently read information pertaining to graph vertex chunks. These utilities will streamline the process of accessing and interpreting how vertices are grouped and stored, which is crucial for optimizing graph processing and analysis tasks.

Specifically, this PR provides:

Methods to query and retrieve metadata about vertex chunks.

Functions to read the boundaries and contents of individual vertex chunks.

Utilities to facilitate the navigation and processing of vertex data in a chunked manner.

This enhancement will benefit features requiring granular access to graph vertex data, such as distributed graph algorithms, incremental graph updates, and optimized data loading.

@sapienza88 sapienza88 changed the title Chunk Info Reader (Java) + feat(Java): Chunk Info Reader Jun 28, 2025
@sapienza88 sapienza88 changed the title feat(Java): Chunk Info Reader [#714] feat(Java): Chunk Info Reader Jun 28, 2025
Copy link
Contributor

@yangxk1 yangxk1 left a comment

Choose a reason for hiding this comment

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

If m lines of data is split into n files:

  • First n-1 files have chunkSize (get from VertexInfo/EdgeInfo getChunkSize()) entries each
  • Last file has the remainder: m - (n-1)*chunkSize

So we don’t need to read file record count.

return false;
}

public String getPropertyGroupChunkPath(PropertyGroup propertyGroup, long chunkIndex) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why move from VertexInfo.java to here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it seems to be more useful in this class

Copy link
Contributor

Choose a reason for hiding this comment

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

Putting related functions in the same file helps organize the code better, increases cohesion, reduces coupling, and makes future maintenance easier.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it is already refactored

// TODO check equality test for type
String type = propertyGroup.getFileType().toString();
numberOfParts = vertexInfo.getChunkSize()
chunkBasePath = vertexInfo.getPropertyGroupPrefix() + "/part";
Copy link
Contributor

Choose a reason for hiding this comment

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

Is "part" or "chunk"? Please confirm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Apologies — the docs are a bit outdated. I’ll update them as soon as possible.
In the meantime, you can check the latest data format in this repo: https://github.com/apache/incubator-graphar-testing

@sapienza88
Copy link
Contributor Author

If m lines of data is split into n files:

  • First n-1 files have chunkSize (get from VertexInfo/EdgeInfo getChunkSize()) entries each
  • Last file has the remainder: m - (n-1)*chunkSize

So we don’t need to read file record count.

How to know about "m"? the count of the data file associated with the vertex?

@yangxk1
Copy link
Contributor

yangxk1 commented Jul 1, 2025

If m lines of data is split into n files:

  • First n-1 files have chunkSize (get from VertexInfo/EdgeInfo getChunkSize()) entries each
  • Last file has the remainder: m - (n-1)*chunkSize

So we don’t need to read file record count.

How to know about "m"? the count of the data file associated with the vertex?

It can be read from vertex_count.

@sapienza88
Copy link
Contributor Author

@yangxk1 pls provide review and merge

@sapienza88
Copy link
Contributor Author

@yangxk1 pls allow CI to re-trigger automatically when a new code is commited by me so that I don't have to wait for you to do it manually. Thanks.

@yangxk1
Copy link
Contributor

yangxk1 commented Jul 31, 2025

@yangxk1 pls allow CI to re-trigger automatically when a new code is commited by me so that I don't have to wait for you to do it manually. Thanks.

To ensure security, workflow execution for first-time contributors requires approval from a project committer.

You can change the branches setting in java-info.yml to trigger the workflow in your own fork, or running the script commands in java-info.yml directly in your local environment.
Just remember to revert any changes to the .yml file before submitting your final PR.

@sapienza88
Copy link
Contributor Author

sapienza88 commented Aug 11, 2025

@yangxk1 thanks for merging the PR on the version parsing, pls also do the same for this PR to let us merge this. PS: Allow edits by maintainers is enabled.

@yangxk1
Copy link
Contributor

yangxk1 commented Aug 11, 2025

@yangxk1 thanks for updating the PR on the version parsing, pls also do the same for this PR to let us merge this. PS: Allow edits by maintainers is enabled.

This PR does not use protobuf, so it is not that urgent. I will still help you as soon as possible.

@sapienza88
Copy link
Contributor Author

@yangxk1 pls approve and merge this or let me know the changes required to merge before the next release so it can be included in the next release.

@yangxk1
Copy link
Contributor

yangxk1 commented Aug 18, 2025

Hi @unical1988 ,I think you should open an issue to discuss the necessity of this pr.

@sapienza88
Copy link
Contributor Author

@yangxk1 i already describe here whats the pr intended for, couldnt be clearer

@yangxk1
Copy link
Contributor

yangxk1 commented Aug 18, 2025

You need to think about these:

If m lines of data is split into n files:

  • First n-1 files have chunkSize (get from VertexInfo/EdgeInfo getChunkSize()) entries each
  • Last file has the remainder: m - (n-1)*chunkSize

So we don’t need to read file record count.

Open an Issue focus on discussion rather than description. This is also the specification of the CONTRIBUTING document.

@sapienza88
Copy link
Contributor Author

sapienza88 commented Aug 18, 2025

@yangxk1 i can and will add tests anything else has been discussed here, pls note that this is implemented in C++

@sapienza88
Copy link
Contributor Author

@yangxk1 i can and will add tests anything else has been discussed here, pls note that this is implemented in C++

@yangxk1 do you agree that this function doesn't require opening an issue ? why do you think it is not correct?

@yangxk1
Copy link
Contributor

yangxk1 commented Sep 22, 2025

  1. We have not discussed whether this function is necessary.
  2. We don’t know whether it is implemented in java-info or java-io or other some modules.

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.

2 participants