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

List all PITs service layer changes #4016

Merged
merged 17 commits into from
Aug 3, 2022

Conversation

bharath-techie
Copy link
Contributor

@bharath-techie bharath-techie commented Jul 26, 2022

Description

Changes to list all active point in time searches to the user. This contains only the service layer changes and rest layer changes will come in later.

Request:
localhost:9200/_search/point_in_time/all

Response:

    "pits": [
        {
            "pitId": "o463QQEPbXktaW5kZXgtMDAwMDAxFjFrNGx0U1owUk5TVU9yYzlLN3VtbXcAFndiVnlzZEJPVFpHVEl6M0VvYldoU2cAAAAAAAAAAAEWczlEZVhDeUVUcXlzcXZ2RDVhNjd0QQEWMWs0bHRTWjBSTlNVT3JjOUs3dW1tdwAA",
            "creationTime": 1657724278549,
            "keepAlive": 6000000
        },
        {
            "pitId": "o463QQEPbXktaW5kZXgtMDAwMDAxFjFrNGx0U1owUk5TVU9yYzlLN3VtbXcAFndiVnlzZEJPVFpHVEl6M0VvYldoU2cAAAAAAAAAAAIWczlEZVhDeUVUcXlzcXZ2RDVhNjd0QQEWMWs0bHRTWjBSTlNVT3JjOUs3dW1tdwAA",
            "creationTime": 1657724568298,
            "keepAlive": 82800000
        }
    ]
}

'Include all' flag as part of request will also show node results and failures on top of the above response, which will be handled in rest layer.

Issues Resolved

#1147

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • 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: Bharathwaj G <bharath78910@gmail.com>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@bharath-techie bharath-techie marked this pull request as ready for review July 27, 2022 04:48
@bharath-techie bharath-techie requested review from a team and reta as code owners July 27, 2022 04:48
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@bharath-techie
Copy link
Contributor Author

@andrross @reta please take a look at this PR

Signed-off-by: Bharathwaj G <bharath78910@gmail.com>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

public class GetAllPitNodeRequest extends BaseNodeRequest {
GetAllPitNodesRequest request;

@Inject
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Inject seems to be not needed here, right?

* Inner node get all pits request
*/
public class GetAllPitNodeRequest extends BaseNodeRequest {
GetAllPitNodesRequest request;
Copy link
Collaborator

Choose a reason for hiding this comment

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

How request is used? I have not found any references to it ...

*/
private List<ListPitInfo> pitsInfo;

@Inject
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same, I believe @Inject serves no purpose here, does it?

private List<ListPitInfo> pitsInfo;

@Inject
public GetAllPitNodeResponse(StreamInput in, List<ListPitInfo> pitsInfo) throws IOException {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Btw, is this constructor even needed?

/**
* List of unique PITs across all nodes
*/
List<ListPitInfo> pitsInfo = new ArrayList<>();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't be private?

}

public List<ListPitInfo> getPITIDs() {
return new ArrayList<>(pitsInfo);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Collections.unmodifiableList(pitsInfo)?

DiscoveryNode node = cursor.value;
nodes.add(node);
}
DiscoveryNode[] disNodesArr = new DiscoveryNode[nodes.size()];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Minor, a bit more compact notation:

DiscoveryNode[] disNodesArr = nodes.toArray(new DiscoveryNode[nodes.size()]);

Signed-off-by: Bharathwaj G <bharath78910@gmail.com>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Aug 2, 2022

Gradle Check (Jenkins) Run Completed with:

Signed-off-by: Bharathwaj G <bharath78910@gmail.com>
*/
private final Set<ListPitInfo> pitInfos = new HashSet<>();

@Inject
Copy link
Collaborator

Choose a reason for hiding this comment

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

I thought we cleaned all unnecessary @Inject, left overs?

@github-actions
Copy link
Contributor

github-actions bot commented Aug 2, 2022

Gradle Check (Jenkins) Run Completed with:

Signed-off-by: Bharathwaj G <bharath78910@gmail.com>
@github-actions
Copy link
Contributor

github-actions bot commented Aug 2, 2022

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Aug 2, 2022

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Aug 2, 2022

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Aug 2, 2022

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2022

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2022

Gradle Check (Jenkins) Run Completed with:

Copy link
Collaborator

@Bukhtawar Bukhtawar left a comment

Choose a reason for hiding this comment

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

Let's clearly document the current limitations with delete and List PIT for now.

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.

6 participants