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

Add support for data provider capabilities in server and InAndOut analysis #138

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bhufmann
Copy link
Contributor

@bhufmann bhufmann commented Dec 13, 2024

  • trace-server: serialize IDataProviderCapabilities in descriptors
  • Set Capabilities in relevant descriptors of InAndOutDataProviderFactory

Requires eclipse-tracecompass/org.eclipse.tracecompass#198 to be integrated.

see also eclipse-cdt-cloud/theia-trace-extension#1158

Signed-off-by: Bernd Hufmann [email protected]

gen.writeObjectFieldStart("capabilities"); //$NON-NLS-1$
gen.writeBooleanField("canCreate", cap.canCreate()); //$NON-NLS-1$
gen.writeBooleanField("canDelete", cap.canDelete()); //$NON-NLS-1$
gen.writeEndObject();
Copy link
Contributor

Choose a reason for hiding this comment

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

Would this be the same as using writeObjectField on the capabilities?
The difference could be that we are fixing the capabilities to serialize even if new ones are added to the class.

Copy link
Contributor Author

@bhufmann bhufmann Jan 7, 2025

Choose a reason for hiding this comment

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

The method getCapabilities returns an instance of IDataProviderCapabilities, but it doesn't guarantee that it is DataProviderCapabilities object which has 2 boolean fields canDelete and canCreate. It could be just an anonymous class that returns hardcoded values for methods canDelete and canCreate. For that case, the serialization would cause an exception. To rely on writeObjectField we would have to have jackson annotated classes. Not sure if it would work if the annotation is on the interface methods.

Besides, we have not added the jackson dependency to Trace Compass core for that, because our stand was that the TSP client to trace server interface is not the same than the trace server to Trace Compass core interface, where the latter is the Trace Compass interface, that is also used in classic Trace Compass. If we had started without the legacy code and the TSP as main interface, then we probably would have done it differently.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note, it would be possible to re-visit how internal data structures are serialized in over the TSP using jackson annotation. But that should be a separate task for all TSP data structures.

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