Skip to content

Commit

Permalink
Spotless
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Nied <[email protected]>
  • Loading branch information
peternied committed Feb 12, 2024
1 parent 4327237 commit 5beefbb
Showing 1 changed file with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,23 +101,22 @@ public void getView(final GetViewAction.Request request, final ActionListener<Ge
}

public void listViewNames(final ActionListener<ListViewNamesAction.Response> listener) {
final List<String> viewNames = new ArrayList<>(Optional.ofNullable(clusterService)
.map(ClusterService::state)
.map(ClusterState::metadata)
.map(Metadata::views)
.map(Map::keySet)
.orElseThrow());
final List<String> viewNames = new ArrayList<>(
Optional.ofNullable(clusterService)
.map(ClusterService::state)
.map(ClusterState::metadata)
.map(Metadata::views)
.map(Map::keySet)
.orElseThrow()
);

listener.onResponse(new ListViewNamesAction.Response(viewNames));
}

public void searchView(final SearchViewAction.Request request, final ActionListener<SearchResponse> listener) {
final View view = getViewOrThrowException(request.getView());

final String[] indices = view.getTargets()
.stream()
.map(View.Target::getIndexPattern)
.toArray(String[]::new);
final String[] indices = view.getTargets().stream().map(View.Target::getIndexPattern).toArray(String[]::new);
request.indices(indices);

client.executeLocally(SearchAction.INSTANCE, request, listener);
Expand Down

0 comments on commit 5beefbb

Please sign in to comment.