forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using the credentials of the user who calls reindex data stream
- Loading branch information
Showing
5 changed files
with
99 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...n/migrate/src/main/java/org/elasticsearch/xpack/migrate/task/ReindexDataStreamClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
package org.elasticsearch.xpack.migrate.task; | ||
|
||
import org.elasticsearch.action.ActionListener; | ||
import org.elasticsearch.action.ActionRequest; | ||
import org.elasticsearch.action.ActionResponse; | ||
import org.elasticsearch.action.ActionType; | ||
import org.elasticsearch.client.internal.Client; | ||
import org.elasticsearch.client.internal.support.AbstractClient; | ||
import org.elasticsearch.xpack.core.ClientHelper; | ||
|
||
import java.util.Map; | ||
|
||
public class ReindexDataStreamClient extends AbstractClient { | ||
|
||
private final Client client; | ||
private final Map<String, String> headers; | ||
|
||
public ReindexDataStreamClient(Client client, Map<String, String> headers) { | ||
super(client.settings(), client.threadPool()); | ||
this.client = client; | ||
this.headers = headers; | ||
} | ||
|
||
@Override | ||
protected <Request extends ActionRequest, Response extends ActionResponse> void doExecute( | ||
ActionType<Response> action, | ||
Request request, | ||
ActionListener<Response> listener | ||
) { | ||
ClientHelper.executeWithHeadersAsync(headers, null, client, action, request, listener); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters