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

Generate APIs to build field mask as a Map directly. #557

Merged
merged 3 commits into from
Mar 17, 2021

Conversation

karthikbalasub
Copy link
Contributor

Updated client APIs to accept the field mask as value for projection parameters.

CHANGELOG.md Outdated Show resolved Hide resolved
@@ -47,14 +44,14 @@
* The semantics of applying a MaskTree to a DataMap are documented in {@link com.linkedin.data.transform.DataComplexProcessor}
*/

public class MaskTree
public class MaskTree extends FieldMask
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think we should come up a better name? MaskMap or something? I feel MaskTree are not necessarily superset of FieldMask by its name. I felt that it is only after we connect it to the request builder or data template that we bring the concept of "field".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

MaskMap was my first choice :) and renamed it to FieldMask as this is actually storing mask for the field tree.
I see your point that this can represent any generic mask. I can rename it back.

generator/build.gradle Show resolved Hide resolved
@@ -23,6 +23,7 @@
public static final String WILDCARD = "$*";
public static final String START = "$start";
public static final String COUNT = "$count";
public static final int NUMBER_OF_ARRAY_ATTRIBUTES = 2; // start and count.
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for my last comment. It might be better:

public static final Set<String> ARRAY_ATTRIBUTES = new HashSet<>(Arrays.asList(START, COUNT));

And then use ARRAY_ATTRIBUTES.size() in the code

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.

None yet

2 participants