Skip to content

Make workerinfo stored as json#17959

Merged
alluxio-bot merged 12 commits intoAlluxio:mainfrom
lucyge2022:json-workerinfo
Aug 18, 2023
Merged

Make workerinfo stored as json#17959
alluxio-bot merged 12 commits intoAlluxio:mainfrom
lucyge2022:json-workerinfo

Conversation

@lucyge2022
Copy link
Copy Markdown
Contributor

What changes are proposed in this pull request?

Store workerinfo as json format on etcd for EtcdMembershipManager.

Why are the changes needed?

For cross-language worker membership retrieval.

Does this PR introduce any user facing changes?

No.

public void deserialize(DataInputStream dis) throws IOException {
mServiceEntityName = dis.readUTF();
mRevision = dis.readLong();
public static String toJson(DefaultServiceEntity entity) {
Copy link
Copy Markdown
Contributor

@Kai-Zhang Kai-Zhang Aug 10, 2023

Choose a reason for hiding this comment

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

maybe leave the implement to decide the serialization type? license uses the service entity and it won't use json for now. maybe we can provide interfaces like this?

public static byte[] serialize(DefaultServiceEntity entity) throws IOException {...} public static DefaultServiceEntity deserialize(byte[] buf) throws IOException {...}
* @param clusterIdentifier
*/
public ServiceDiscoveryRecipe(AlluxioEtcdClient client, String clusterIdentifier) {
ServiceDiscoveryRecipe(AlluxioEtcdClient client, String clusterIdentifier) {
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.

license engine may need to construct its own ServiceDiscoveryRecipe. is there any context on this change?

Copy link
Copy Markdown
Contributor

@LuQQiu LuQQiu left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for supporting json worker info!

@lucyge2022 lucyge2022 added the type-ease-of-use This issue is about of how to improve the ease of use of Alluxio product label Aug 18, 2023
@lucyge2022
Copy link
Copy Markdown
Contributor Author

alluxio-bot, merge this please.

@alluxio-bot alluxio-bot merged commit be56934 into Alluxio:main Aug 18, 2023
alluxio-bot pushed a commit that referenced this pull request Aug 22, 2023
### What changes are proposed in this pull request? - Change the serialize/deserialize interface for future use(#17959) - Expose the TTL and timeout of the lease used in `ServiceDiscoveryRecipe` - Expose the path prefix of the `ServiceDiscoveryRecipe` for future use ### Why are the changes needed? etcd will be used in the near future for more areas than worker service discovery. so expose more information for future use. ### Does this PR introduce any user facing changes? nope	pr-link: #18010	change-id: cid-7cc0b9f5cfaee860e587941c37867797b7fe7bdb
@dbw9580
Copy link
Copy Markdown
Contributor

dbw9580 commented Oct 7, 2023

any particular consideration for choosing Gson over Jackson?

@lucyge2022
Copy link
Copy Markdown
Contributor Author

any particular consideration for choosing Gson over Jackson?

actually no, i saw Gson was used in codebase and has much simpler syntax.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-ease-of-use This issue is about of how to improve the ease of use of Alluxio product

5 participants