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

Use proto serialization #2779

Closed

Conversation

parasjain1
Copy link
Contributor

@parasjain1 parasjain1 commented May 18, 2023

Description

  • Category - Enhancement
  • JDK serialization is slow. Using protostuff for (de)serialization in security plugin

Issues Resolved

Resolves #2780

Testing

  • Unit tests
  • End to end testing for version upgrade scenario

Check List

  • New functionality includes testing
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Paras Jain <parasjaz@amazon.com>
*
* SerializableWrapper here will hold our actual serializable object, and we'll always (de)serialize
* SerializableWrapper object. Protostuff will internally construct and maintain schemas for underlying
* classes.
Copy link
Member

Choose a reason for hiding this comment

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

nice

@@ -126,6 +128,8 @@ public <T extends TransportResponse> void sendRequestDecorate(AsyncSender sender
final String origCCSTransientFls = getThreadContext().getTransient(ConfigConstants.OPENDISTRO_SECURITY_FLS_FIELDS_CCS);
final String origCCSTransientMf = getThreadContext().getTransient(ConfigConstants.OPENDISTRO_SECURITY_MASKED_FIELD_CCS);

final boolean useJDKSerialization = connection.getVersion().before(Version.V_2_7_0);
Copy link
Member

Choose a reason for hiding this comment

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

👏

@@ -296,6 +303,10 @@ else if(!Strings.isNullOrEmpty(injectedUserHeader)) {
}
}
}

private void serializeHeadersUsingProtoForVersionUpgrade() {
Copy link
Member

Choose a reason for hiding this comment

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

We can move this function to HeaderHelpers to re-use

@peternied
Copy link
Member

Looks like this pull request has stalled for a little bit @parasjain1 thoughts on picking this back up?

For the content of the pull request itself, you say this is faster, how are you quantifying this?

@parasjain1
Copy link
Contributor Author

Closing this in favour of - #2802

@parasjain1 parasjain1 closed this Jun 8, 2023
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.

[Performance] Use a faster serialization protocol within security plugin
3 participants