mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-25 07:37:19 -04:00
Merge main into multi-project
This commit is contained in:
commit
77bf65d9af
283 changed files with 9470 additions and 9358 deletions
5
docs/changelog/122860.yaml
Normal file
5
docs/changelog/122860.yaml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
pr: 122860
|
||||||
|
summary: Improved error message when index field type is invalid
|
||||||
|
area: Mapping
|
||||||
|
type: enhancement
|
||||||
|
issues: []
|
5
docs/changelog/123079.yaml
Normal file
5
docs/changelog/123079.yaml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
pr: 123079
|
||||||
|
summary: Register `IngestGeoIpMetadata` as a NamedXContent
|
||||||
|
area: Ingest Node
|
||||||
|
type: bug
|
||||||
|
issues: []
|
5
docs/changelog/123197.yaml
Normal file
5
docs/changelog/123197.yaml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
pr: 123197
|
||||||
|
summary: Fix early termination in `LuceneSourceOperator`
|
||||||
|
area: ES|QL
|
||||||
|
type: bug
|
||||||
|
issues: []
|
5
docs/changelog/123272.yaml
Normal file
5
docs/changelog/123272.yaml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
pr: 123272
|
||||||
|
summary: Set Connect Timeout to 5s
|
||||||
|
area: Machine Learning
|
||||||
|
type: bug
|
||||||
|
issues: []
|
|
@ -39,8 +39,8 @@ public class EntitlementBootstrap {
|
||||||
Function<Class<?>, String> pluginResolver,
|
Function<Class<?>, String> pluginResolver,
|
||||||
Function<String, String> settingResolver,
|
Function<String, String> settingResolver,
|
||||||
Function<String, Stream<String>> settingGlobResolver,
|
Function<String, Stream<String>> settingGlobResolver,
|
||||||
Function<String, Path> repoDirResolver,
|
|
||||||
Path[] dataDirs,
|
Path[] dataDirs,
|
||||||
|
Path[] sharedRepoDirs,
|
||||||
Path configDir,
|
Path configDir,
|
||||||
Path libDir,
|
Path libDir,
|
||||||
Path logsDir,
|
Path logsDir,
|
||||||
|
@ -51,11 +51,11 @@ public class EntitlementBootstrap {
|
||||||
requireNonNull(pluginResolver);
|
requireNonNull(pluginResolver);
|
||||||
requireNonNull(settingResolver);
|
requireNonNull(settingResolver);
|
||||||
requireNonNull(settingGlobResolver);
|
requireNonNull(settingGlobResolver);
|
||||||
requireNonNull(repoDirResolver);
|
|
||||||
requireNonNull(dataDirs);
|
requireNonNull(dataDirs);
|
||||||
if (dataDirs.length == 0) {
|
if (dataDirs.length == 0) {
|
||||||
throw new IllegalArgumentException("must provide at least one data directory");
|
throw new IllegalArgumentException("must provide at least one data directory");
|
||||||
}
|
}
|
||||||
|
requireNonNull(sharedRepoDirs);
|
||||||
requireNonNull(configDir);
|
requireNonNull(configDir);
|
||||||
requireNonNull(libDir);
|
requireNonNull(libDir);
|
||||||
requireNonNull(logsDir);
|
requireNonNull(logsDir);
|
||||||
|
@ -77,8 +77,8 @@ public class EntitlementBootstrap {
|
||||||
* @param pluginResolver a functor to map a Java Class to the plugin it belongs to (the plugin name).
|
* @param pluginResolver a functor to map a Java Class to the plugin it belongs to (the plugin name).
|
||||||
* @param settingResolver a functor to resolve the value of an Elasticsearch setting.
|
* @param settingResolver a functor to resolve the value of an Elasticsearch setting.
|
||||||
* @param settingGlobResolver a functor to resolve a glob expression for one or more Elasticsearch settings.
|
* @param settingGlobResolver a functor to resolve a glob expression for one or more Elasticsearch settings.
|
||||||
* @param repoDirResolver a functor to map a repository location to its Elasticsearch path.
|
|
||||||
* @param dataDirs data directories for Elasticsearch
|
* @param dataDirs data directories for Elasticsearch
|
||||||
|
* @param sharedRepoDirs shared repository directories for Elasticsearch
|
||||||
* @param configDir the config directory for Elasticsearch
|
* @param configDir the config directory for Elasticsearch
|
||||||
* @param libDir the lib directory for Elasticsearch
|
* @param libDir the lib directory for Elasticsearch
|
||||||
* @param tempDir the temp directory for Elasticsearch
|
* @param tempDir the temp directory for Elasticsearch
|
||||||
|
@ -89,8 +89,8 @@ public class EntitlementBootstrap {
|
||||||
Function<Class<?>, String> pluginResolver,
|
Function<Class<?>, String> pluginResolver,
|
||||||
Function<String, String> settingResolver,
|
Function<String, String> settingResolver,
|
||||||
Function<String, Stream<String>> settingGlobResolver,
|
Function<String, Stream<String>> settingGlobResolver,
|
||||||
Function<String, Path> repoDirResolver,
|
|
||||||
Path[] dataDirs,
|
Path[] dataDirs,
|
||||||
|
Path[] sharedRepoDirs,
|
||||||
Path configDir,
|
Path configDir,
|
||||||
Path libDir,
|
Path libDir,
|
||||||
Path logsDir,
|
Path logsDir,
|
||||||
|
@ -105,8 +105,8 @@ public class EntitlementBootstrap {
|
||||||
pluginResolver,
|
pluginResolver,
|
||||||
settingResolver,
|
settingResolver,
|
||||||
settingGlobResolver,
|
settingGlobResolver,
|
||||||
repoDirResolver,
|
|
||||||
dataDirs,
|
dataDirs,
|
||||||
|
sharedRepoDirs,
|
||||||
configDir,
|
configDir,
|
||||||
libDir,
|
libDir,
|
||||||
logsDir,
|
logsDir,
|
||||||
|
|
|
@ -63,8 +63,11 @@ import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
import java.util.stream.StreamSupport;
|
import java.util.stream.StreamSupport;
|
||||||
|
|
||||||
|
import static org.elasticsearch.entitlement.runtime.policy.entitlements.FilesEntitlement.BaseDir.DATA;
|
||||||
|
import static org.elasticsearch.entitlement.runtime.policy.entitlements.FilesEntitlement.BaseDir.SHARED_REPO;
|
||||||
import static org.elasticsearch.entitlement.runtime.policy.entitlements.FilesEntitlement.Mode.READ;
|
import static org.elasticsearch.entitlement.runtime.policy.entitlements.FilesEntitlement.Mode.READ;
|
||||||
import static org.elasticsearch.entitlement.runtime.policy.entitlements.FilesEntitlement.Mode.READ_WRITE;
|
import static org.elasticsearch.entitlement.runtime.policy.entitlements.FilesEntitlement.Mode.READ_WRITE;
|
||||||
|
import static org.elasticsearch.entitlement.runtime.policy.entitlements.FilesEntitlement.Platform.LINUX;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called by the agent during {@code agentmain} to configure the entitlement system,
|
* Called by the agent during {@code agentmain} to configure the entitlement system,
|
||||||
|
@ -138,6 +141,7 @@ public class EntitlementInitialization {
|
||||||
getUserHome(),
|
getUserHome(),
|
||||||
bootstrapArgs.configDir(),
|
bootstrapArgs.configDir(),
|
||||||
bootstrapArgs.dataDirs(),
|
bootstrapArgs.dataDirs(),
|
||||||
|
bootstrapArgs.sharedRepoDirs(),
|
||||||
bootstrapArgs.tempDir(),
|
bootstrapArgs.tempDir(),
|
||||||
bootstrapArgs.settingResolver(),
|
bootstrapArgs.settingResolver(),
|
||||||
bootstrapArgs.settingGlobResolver()
|
bootstrapArgs.settingGlobResolver()
|
||||||
|
@ -152,8 +156,8 @@ public class EntitlementInitialization {
|
||||||
new CreateClassLoaderEntitlement(),
|
new CreateClassLoaderEntitlement(),
|
||||||
new FilesEntitlement(
|
new FilesEntitlement(
|
||||||
List.of(
|
List.of(
|
||||||
FileData.ofPath(bootstrapArgs.repoDirResolver().apply(""), READ_WRITE),
|
FileData.ofRelativePath(Path.of(""), SHARED_REPO, READ_WRITE),
|
||||||
FileData.ofRelativePath(Path.of(""), FilesEntitlement.BaseDir.DATA, READ_WRITE)
|
FileData.ofRelativePath(Path.of(""), DATA, READ_WRITE)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -175,26 +179,26 @@ public class EntitlementInitialization {
|
||||||
FileData.ofPath(bootstrapArgs.tempDir(), READ_WRITE),
|
FileData.ofPath(bootstrapArgs.tempDir(), READ_WRITE),
|
||||||
FileData.ofPath(bootstrapArgs.configDir(), READ),
|
FileData.ofPath(bootstrapArgs.configDir(), READ),
|
||||||
FileData.ofPath(bootstrapArgs.logsDir(), READ_WRITE),
|
FileData.ofPath(bootstrapArgs.logsDir(), READ_WRITE),
|
||||||
FileData.ofRelativePath(Path.of(""), FilesEntitlement.BaseDir.DATA, READ_WRITE),
|
FileData.ofRelativePath(Path.of(""), DATA, READ_WRITE),
|
||||||
FileData.ofPath(bootstrapArgs.repoDirResolver().apply(""), READ_WRITE),
|
FileData.ofRelativePath(Path.of(""), SHARED_REPO, READ_WRITE),
|
||||||
|
|
||||||
// OS release on Linux
|
// OS release on Linux
|
||||||
FileData.ofPath(Path.of("/etc/os-release"), READ),
|
FileData.ofPath(Path.of("/etc/os-release"), READ).withPlatform(LINUX),
|
||||||
FileData.ofPath(Path.of("/etc/system-release"), READ),
|
FileData.ofPath(Path.of("/etc/system-release"), READ).withPlatform(LINUX),
|
||||||
FileData.ofPath(Path.of("/usr/lib/os-release"), READ),
|
FileData.ofPath(Path.of("/usr/lib/os-release"), READ).withPlatform(LINUX),
|
||||||
// read max virtual memory areas
|
// read max virtual memory areas
|
||||||
FileData.ofPath(Path.of("/proc/sys/vm/max_map_count"), READ),
|
FileData.ofPath(Path.of("/proc/sys/vm/max_map_count"), READ).withPlatform(LINUX),
|
||||||
FileData.ofPath(Path.of("/proc/meminfo"), READ),
|
FileData.ofPath(Path.of("/proc/meminfo"), READ).withPlatform(LINUX),
|
||||||
// load averages on Linux
|
// load averages on Linux
|
||||||
FileData.ofPath(Path.of("/proc/loadavg"), READ),
|
FileData.ofPath(Path.of("/proc/loadavg"), READ).withPlatform(LINUX),
|
||||||
// control group stats on Linux. cgroup v2 stats are in an unpredicable
|
// control group stats on Linux. cgroup v2 stats are in an unpredicable
|
||||||
// location under `/sys/fs/cgroup`, so unfortunately we have to allow
|
// location under `/sys/fs/cgroup`, so unfortunately we have to allow
|
||||||
// read access to the entire directory hierarchy.
|
// read access to the entire directory hierarchy.
|
||||||
FileData.ofPath(Path.of("/proc/self/cgroup"), READ),
|
FileData.ofPath(Path.of("/proc/self/cgroup"), READ).withPlatform(LINUX),
|
||||||
FileData.ofPath(Path.of("/sys/fs/cgroup/"), READ),
|
FileData.ofPath(Path.of("/sys/fs/cgroup/"), READ).withPlatform(LINUX),
|
||||||
// // io stats on Linux
|
// // io stats on Linux
|
||||||
FileData.ofPath(Path.of("/proc/self/mountinfo"), READ),
|
FileData.ofPath(Path.of("/proc/self/mountinfo"), READ).withPlatform(LINUX),
|
||||||
FileData.ofPath(Path.of("/proc/diskstats"), READ)
|
FileData.ofPath(Path.of("/proc/diskstats"), READ).withPlatform(LINUX)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -210,21 +214,21 @@ public class EntitlementInitialization {
|
||||||
List.of(
|
List.of(
|
||||||
FileData.ofPath(bootstrapArgs.configDir(), READ),
|
FileData.ofPath(bootstrapArgs.configDir(), READ),
|
||||||
FileData.ofPath(bootstrapArgs.tempDir(), READ),
|
FileData.ofPath(bootstrapArgs.tempDir(), READ),
|
||||||
FileData.ofRelativePath(Path.of(""), FilesEntitlement.BaseDir.DATA, READ_WRITE)
|
FileData.ofRelativePath(Path.of(""), DATA, READ_WRITE)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
new Scope(
|
new Scope(
|
||||||
"org.apache.lucene.misc",
|
"org.apache.lucene.misc",
|
||||||
List.of(new FilesEntitlement(List.of(FileData.ofRelativePath(Path.of(""), FilesEntitlement.BaseDir.DATA, READ_WRITE))))
|
List.of(new FilesEntitlement(List.of(FileData.ofRelativePath(Path.of(""), DATA, READ_WRITE))))
|
||||||
),
|
),
|
||||||
new Scope("org.apache.logging.log4j.core", List.of(new ManageThreadsEntitlement())),
|
new Scope("org.apache.logging.log4j.core", List.of(new ManageThreadsEntitlement())),
|
||||||
new Scope(
|
new Scope(
|
||||||
"org.elasticsearch.nativeaccess",
|
"org.elasticsearch.nativeaccess",
|
||||||
List.of(
|
List.of(
|
||||||
new LoadNativeLibrariesEntitlement(),
|
new LoadNativeLibrariesEntitlement(),
|
||||||
new FilesEntitlement(List.of(FileData.ofRelativePath(Path.of(""), FilesEntitlement.BaseDir.DATA, READ_WRITE)))
|
new FilesEntitlement(List.of(FileData.ofRelativePath(Path.of(""), DATA, READ_WRITE)))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
|
@ -14,6 +14,7 @@ import org.elasticsearch.entitlement.runtime.policy.entitlements.FilesEntitlemen
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@ -30,6 +31,10 @@ public final class FileAccessTree {
|
||||||
List<String> readPaths = new ArrayList<>();
|
List<String> readPaths = new ArrayList<>();
|
||||||
List<String> writePaths = new ArrayList<>();
|
List<String> writePaths = new ArrayList<>();
|
||||||
for (FilesEntitlement.FileData fileData : filesEntitlement.filesData()) {
|
for (FilesEntitlement.FileData fileData : filesEntitlement.filesData()) {
|
||||||
|
var platform = fileData.platform();
|
||||||
|
if (platform != null && platform.isCurrent() == false) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
var mode = fileData.mode();
|
var mode = fileData.mode();
|
||||||
var paths = fileData.resolvePaths(pathLookup);
|
var paths = fileData.resolvePaths(pathLookup);
|
||||||
paths.forEach(path -> {
|
paths.forEach(path -> {
|
||||||
|
@ -46,8 +51,8 @@ public final class FileAccessTree {
|
||||||
readPaths.add(tempDir);
|
readPaths.add(tempDir);
|
||||||
writePaths.add(tempDir);
|
writePaths.add(tempDir);
|
||||||
|
|
||||||
readPaths.sort(String::compareTo);
|
readPaths.sort(PATH_ORDER);
|
||||||
writePaths.sort(String::compareTo);
|
writePaths.sort(PATH_ORDER);
|
||||||
|
|
||||||
this.readPaths = pruneSortedPaths(readPaths).toArray(new String[0]);
|
this.readPaths = pruneSortedPaths(readPaths).toArray(new String[0]);
|
||||||
this.writePaths = pruneSortedPaths(writePaths).toArray(new String[0]);
|
this.writePaths = pruneSortedPaths(writePaths).toArray(new String[0]);
|
||||||
|
@ -60,7 +65,7 @@ public final class FileAccessTree {
|
||||||
prunedReadPaths.add(currentPath);
|
prunedReadPaths.add(currentPath);
|
||||||
for (int i = 1; i < paths.size(); ++i) {
|
for (int i = 1; i < paths.size(); ++i) {
|
||||||
String nextPath = paths.get(i);
|
String nextPath = paths.get(i);
|
||||||
if (nextPath.startsWith(currentPath) == false) {
|
if (isParent(currentPath, nextPath) == false) {
|
||||||
prunedReadPaths.add(nextPath);
|
prunedReadPaths.add(nextPath);
|
||||||
currentPath = nextPath;
|
currentPath = nextPath;
|
||||||
}
|
}
|
||||||
|
@ -88,21 +93,28 @@ public final class FileAccessTree {
|
||||||
// Note that toAbsolutePath produces paths separated by the default file separator,
|
// Note that toAbsolutePath produces paths separated by the default file separator,
|
||||||
// so on Windows, if the given path uses forward slashes, this consistently
|
// so on Windows, if the given path uses forward slashes, this consistently
|
||||||
// converts it to backslashes.
|
// converts it to backslashes.
|
||||||
return path.toAbsolutePath().normalize().toString();
|
String result = path.toAbsolutePath().normalize().toString();
|
||||||
|
while (result.endsWith(FILE_SEPARATOR)) {
|
||||||
|
result = result.substring(0, result.length() - FILE_SEPARATOR.length());
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean checkPath(String path, String[] paths) {
|
private static boolean checkPath(String path, String[] paths) {
|
||||||
if (paths.length == 0) {
|
if (paths.length == 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int ndx = Arrays.binarySearch(paths, path);
|
int ndx = Arrays.binarySearch(paths, path, PATH_ORDER);
|
||||||
if (ndx < -1) {
|
if (ndx < -1) {
|
||||||
String maybeParent = paths[-ndx - 2];
|
return isParent(paths[-ndx - 2], path);
|
||||||
return path.startsWith(maybeParent) && path.startsWith(FILE_SEPARATOR, maybeParent.length());
|
|
||||||
}
|
}
|
||||||
return ndx >= 0;
|
return ndx >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static boolean isParent(String maybeParent, String path) {
|
||||||
|
return path.startsWith(maybeParent) && path.startsWith(FILE_SEPARATOR, maybeParent.length());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (o == null || getClass() != o.getClass()) return false;
|
if (o == null || getClass() != o.getClass()) return false;
|
||||||
|
@ -114,4 +126,30 @@ public final class FileAccessTree {
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(Arrays.hashCode(readPaths), Arrays.hashCode(writePaths));
|
return Objects.hash(Arrays.hashCode(readPaths), Arrays.hashCode(writePaths));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For our lexicographic sort trick to work correctly, we must have path separators sort before
|
||||||
|
* any other character so that files in a directory appear immediately after that directory.
|
||||||
|
* For example, we require [/a, /a/b, /a.xml] rather than the natural order [/a, /a.xml, /a/b].
|
||||||
|
*/
|
||||||
|
private static final Comparator<String> PATH_ORDER = (s1, s2) -> {
|
||||||
|
Path p1 = Path.of(s1);
|
||||||
|
Path p2 = Path.of(s2);
|
||||||
|
var i1 = p1.iterator();
|
||||||
|
var i2 = p2.iterator();
|
||||||
|
while (i1.hasNext() && i2.hasNext()) {
|
||||||
|
int cmp = i1.next().compareTo(i2.next());
|
||||||
|
if (cmp != 0) {
|
||||||
|
return cmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (i1.hasNext()) {
|
||||||
|
return 1;
|
||||||
|
} else if (i2.hasNext()) {
|
||||||
|
return -1;
|
||||||
|
} else {
|
||||||
|
assert p1.equals(p2);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ public record PathLookup(
|
||||||
Path homeDir,
|
Path homeDir,
|
||||||
Path configDir,
|
Path configDir,
|
||||||
Path[] dataDirs,
|
Path[] dataDirs,
|
||||||
|
Path[] sharedRepoDirs,
|
||||||
Path tempDir,
|
Path tempDir,
|
||||||
Function<String, String> settingResolver,
|
Function<String, String> settingResolver,
|
||||||
Function<String, Stream<String>> settingGlobResolver
|
Function<String, Stream<String>> settingGlobResolver
|
||||||
|
|
|
@ -21,6 +21,8 @@ import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
import static java.lang.Character.isLetter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes a file entitlement with a path and mode.
|
* Describes a file entitlement with a path and mode.
|
||||||
*/
|
*/
|
||||||
|
@ -36,29 +38,104 @@ public record FilesEntitlement(List<FileData> filesData) implements Entitlement
|
||||||
public enum BaseDir {
|
public enum BaseDir {
|
||||||
CONFIG,
|
CONFIG,
|
||||||
DATA,
|
DATA,
|
||||||
|
SHARED_REPO,
|
||||||
HOME
|
HOME
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum Platform {
|
||||||
|
LINUX,
|
||||||
|
MACOS,
|
||||||
|
WINDOWS;
|
||||||
|
|
||||||
|
private static final Platform current = findCurrent();
|
||||||
|
|
||||||
|
private static Platform findCurrent() {
|
||||||
|
String os = System.getProperty("os.name");
|
||||||
|
if (os.startsWith("Linux")) {
|
||||||
|
return LINUX;
|
||||||
|
} else if (os.startsWith("Mac OS")) {
|
||||||
|
return MACOS;
|
||||||
|
} else if (os.startsWith("Windows")) {
|
||||||
|
return WINDOWS;
|
||||||
|
} else {
|
||||||
|
throw new AssertionError("Unsupported platform [" + os + "]");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isCurrent() {
|
||||||
|
return this == current;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public sealed interface FileData {
|
public sealed interface FileData {
|
||||||
|
|
||||||
Stream<Path> resolvePaths(PathLookup pathLookup);
|
Stream<Path> resolvePaths(PathLookup pathLookup);
|
||||||
|
|
||||||
Mode mode();
|
Mode mode();
|
||||||
|
|
||||||
|
Platform platform();
|
||||||
|
|
||||||
|
FileData withPlatform(Platform platform);
|
||||||
|
|
||||||
static FileData ofPath(Path path, Mode mode) {
|
static FileData ofPath(Path path, Mode mode) {
|
||||||
return new AbsolutePathFileData(path, mode);
|
return new AbsolutePathFileData(path, mode, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
static FileData ofRelativePath(Path relativePath, BaseDir baseDir, Mode mode) {
|
static FileData ofRelativePath(Path relativePath, BaseDir baseDir, Mode mode) {
|
||||||
return new RelativePathFileData(relativePath, baseDir, mode);
|
return new RelativePathFileData(relativePath, baseDir, mode, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
static FileData ofPathSetting(String setting, Mode mode) {
|
static FileData ofPathSetting(String setting, Mode mode) {
|
||||||
return new PathSettingFileData(setting, mode);
|
return new PathSettingFileData(setting, mode, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
static FileData ofRelativePathSetting(String setting, BaseDir baseDir, Mode mode) {
|
static FileData ofRelativePathSetting(String setting, BaseDir baseDir, Mode mode) {
|
||||||
return new RelativePathSettingFileData(setting, baseDir, mode);
|
return new RelativePathSettingFileData(setting, baseDir, mode, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests if a path is absolute or relative, taking into consideration both Unix and Windows conventions.
|
||||||
|
* Note that this leads to a conflict, resolved in favor of Unix rules: `/foo` can be either a Unix absolute path, or a Windows
|
||||||
|
* relative path with "wrong" directory separator (using non-canonical slash in Windows).
|
||||||
|
*/
|
||||||
|
static boolean isAbsolutePath(String path) {
|
||||||
|
if (path.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (path.charAt(0) == '/') {
|
||||||
|
// Unix/BSD absolute
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return isWindowsAbsolutePath(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean isSlash(char c) {
|
||||||
|
return (c == '\\') || (c == '/');
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean isWindowsAbsolutePath(String input) {
|
||||||
|
// if a prefix is present, we expected (long) UNC or (long) absolute
|
||||||
|
if (input.startsWith("\\\\?\\")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (input.length() > 1) {
|
||||||
|
char c0 = input.charAt(0);
|
||||||
|
char c1 = input.charAt(1);
|
||||||
|
char c = 0;
|
||||||
|
int next = 2;
|
||||||
|
if (isSlash(c0) && isSlash(c1)) {
|
||||||
|
// Two slashes or more: UNC
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (isLetter(c0) && c1 == ':') {
|
||||||
|
// A drive: absolute
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Otherwise relative
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,14 +152,9 @@ public record FilesEntitlement(List<FileData> filesData) implements Entitlement
|
||||||
case CONFIG:
|
case CONFIG:
|
||||||
return relativePaths.map(relativePath -> pathLookup.configDir().resolve(relativePath));
|
return relativePaths.map(relativePath -> pathLookup.configDir().resolve(relativePath));
|
||||||
case DATA:
|
case DATA:
|
||||||
// multiple data dirs are a pain...we need the combination of relative paths and data dirs
|
return relativePathsCombination(pathLookup.dataDirs(), relativePaths);
|
||||||
List<Path> paths = new ArrayList<>();
|
case SHARED_REPO:
|
||||||
for (var relativePath : relativePaths.toList()) {
|
return relativePathsCombination(pathLookup.sharedRepoDirs(), relativePaths);
|
||||||
for (var dataDir : pathLookup.dataDirs()) {
|
|
||||||
paths.add(dataDir.resolve(relativePath));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return paths.stream();
|
|
||||||
case HOME:
|
case HOME:
|
||||||
return relativePaths.map(relativePath -> pathLookup.homeDir().resolve(relativePath));
|
return relativePaths.map(relativePath -> pathLookup.homeDir().resolve(relativePath));
|
||||||
default:
|
default:
|
||||||
|
@ -91,32 +163,81 @@ public record FilesEntitlement(List<FileData> filesData) implements Entitlement
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private record AbsolutePathFileData(Path path, Mode mode) implements FileData {
|
private static Stream<Path> relativePathsCombination(Path[] baseDirs, Stream<Path> relativePaths) {
|
||||||
|
// multiple base dirs are a pain...we need the combination of the base dirs and relative paths
|
||||||
|
List<Path> paths = new ArrayList<>();
|
||||||
|
for (var relativePath : relativePaths.toList()) {
|
||||||
|
for (var dataDir : baseDirs) {
|
||||||
|
paths.add(dataDir.resolve(relativePath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return paths.stream();
|
||||||
|
}
|
||||||
|
|
||||||
|
private record AbsolutePathFileData(Path path, Mode mode, Platform platform) implements FileData {
|
||||||
@Override
|
@Override
|
||||||
public Stream<Path> resolvePaths(PathLookup pathLookup) {
|
public Stream<Path> resolvePaths(PathLookup pathLookup) {
|
||||||
return Stream.of(path);
|
return Stream.of(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FileData withPlatform(Platform platform) {
|
||||||
|
if (platform == platform()) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
return new AbsolutePathFileData(path, mode, platform);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private record RelativePathFileData(Path relativePath, BaseDir baseDir, Mode mode) implements FileData, RelativeFileData {
|
private record RelativePathFileData(Path relativePath, BaseDir baseDir, Mode mode, Platform platform)
|
||||||
|
implements
|
||||||
|
FileData,
|
||||||
|
RelativeFileData {
|
||||||
@Override
|
@Override
|
||||||
public Stream<Path> resolveRelativePaths(PathLookup pathLookup) {
|
public Stream<Path> resolveRelativePaths(PathLookup pathLookup) {
|
||||||
return Stream.of(relativePath);
|
return Stream.of(relativePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FileData withPlatform(Platform platform) {
|
||||||
|
if (platform == platform()) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
return new RelativePathFileData(relativePath, baseDir, mode, platform);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private record PathSettingFileData(String setting, Mode mode) implements FileData {
|
private record PathSettingFileData(String setting, Mode mode, Platform platform) implements FileData {
|
||||||
@Override
|
@Override
|
||||||
public Stream<Path> resolvePaths(PathLookup pathLookup) {
|
public Stream<Path> resolvePaths(PathLookup pathLookup) {
|
||||||
return resolvePathSettings(pathLookup, setting);
|
return resolvePathSettings(pathLookup, setting);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FileData withPlatform(Platform platform) {
|
||||||
|
if (platform == platform()) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
return new PathSettingFileData(setting, mode, platform);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private record RelativePathSettingFileData(String setting, BaseDir baseDir, Mode mode) implements FileData, RelativeFileData {
|
private record RelativePathSettingFileData(String setting, BaseDir baseDir, Mode mode, Platform platform)
|
||||||
|
implements
|
||||||
|
FileData,
|
||||||
|
RelativeFileData {
|
||||||
@Override
|
@Override
|
||||||
public Stream<Path> resolveRelativePaths(PathLookup pathLookup) {
|
public Stream<Path> resolveRelativePaths(PathLookup pathLookup) {
|
||||||
return resolvePathSettings(pathLookup, setting);
|
return resolvePathSettings(pathLookup, setting);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FileData withPlatform(Platform platform) {
|
||||||
|
if (platform == platform()) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
return new RelativePathSettingFileData(setting, baseDir, mode, platform);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Stream<Path> resolvePathSettings(PathLookup pathLookup, String setting) {
|
private static Stream<Path> resolvePathSettings(PathLookup pathLookup, String setting) {
|
||||||
|
@ -137,11 +258,24 @@ public record FilesEntitlement(List<FileData> filesData) implements Entitlement
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static Platform parsePlatform(String platform) {
|
||||||
|
if (platform.equals("linux")) {
|
||||||
|
return Platform.LINUX;
|
||||||
|
} else if (platform.equals("macos")) {
|
||||||
|
return Platform.MACOS;
|
||||||
|
} else if (platform.equals("windows")) {
|
||||||
|
return Platform.WINDOWS;
|
||||||
|
} else {
|
||||||
|
throw new PolicyValidationException("invalid platform: " + platform + ", valid values: [linux, macos, windows]");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static BaseDir parseBaseDir(String baseDir) {
|
private static BaseDir parseBaseDir(String baseDir) {
|
||||||
return switch (baseDir) {
|
return switch (baseDir) {
|
||||||
case "config" -> BaseDir.CONFIG;
|
case "config" -> BaseDir.CONFIG;
|
||||||
case "data" -> BaseDir.DATA;
|
case "data" -> BaseDir.DATA;
|
||||||
case "home" -> BaseDir.HOME;
|
case "home" -> BaseDir.HOME;
|
||||||
|
// NOTE: shared_repo is _not_ accessible to policy files, only internally
|
||||||
default -> throw new PolicyValidationException(
|
default -> throw new PolicyValidationException(
|
||||||
"invalid relative directory: " + baseDir + ", valid values: [config, data, home]"
|
"invalid relative directory: " + baseDir + ", valid values: [config, data, home]"
|
||||||
);
|
);
|
||||||
|
@ -163,6 +297,7 @@ public record FilesEntitlement(List<FileData> filesData) implements Entitlement
|
||||||
String pathSetting = file.remove("path_setting");
|
String pathSetting = file.remove("path_setting");
|
||||||
String relativePathSetting = file.remove("relative_path_setting");
|
String relativePathSetting = file.remove("relative_path_setting");
|
||||||
String modeAsString = file.remove("mode");
|
String modeAsString = file.remove("mode");
|
||||||
|
String platformAsString = file.remove("platform");
|
||||||
|
|
||||||
if (file.isEmpty() == false) {
|
if (file.isEmpty() == false) {
|
||||||
throw new PolicyValidationException("unknown key(s) [" + file + "] in a listed file for files entitlement");
|
throw new PolicyValidationException("unknown key(s) [" + file + "] in a listed file for files entitlement");
|
||||||
|
@ -179,38 +314,45 @@ public record FilesEntitlement(List<FileData> filesData) implements Entitlement
|
||||||
throw new PolicyValidationException("files entitlement must contain 'mode' for every listed file");
|
throw new PolicyValidationException("files entitlement must contain 'mode' for every listed file");
|
||||||
}
|
}
|
||||||
Mode mode = parseMode(modeAsString);
|
Mode mode = parseMode(modeAsString);
|
||||||
|
Platform platform = null;
|
||||||
|
if (platformAsString != null) {
|
||||||
|
platform = parsePlatform(platformAsString);
|
||||||
|
}
|
||||||
|
|
||||||
BaseDir baseDir = null;
|
BaseDir baseDir = null;
|
||||||
if (relativeTo != null) {
|
if (relativeTo != null) {
|
||||||
baseDir = parseBaseDir(relativeTo);
|
baseDir = parseBaseDir(relativeTo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final FileData fileData;
|
||||||
if (relativePathAsString != null) {
|
if (relativePathAsString != null) {
|
||||||
if (baseDir == null) {
|
if (baseDir == null) {
|
||||||
throw new PolicyValidationException("files entitlement with a 'relative_path' must specify 'relative_to'");
|
throw new PolicyValidationException("files entitlement with a 'relative_path' must specify 'relative_to'");
|
||||||
}
|
}
|
||||||
|
|
||||||
Path relativePath = Path.of(relativePathAsString);
|
Path relativePath = Path.of(relativePathAsString);
|
||||||
if (relativePath.isAbsolute()) {
|
if (FileData.isAbsolutePath(relativePathAsString)) {
|
||||||
throw new PolicyValidationException("'relative_path' [" + relativePathAsString + "] must be relative");
|
throw new PolicyValidationException("'relative_path' [" + relativePathAsString + "] must be relative");
|
||||||
}
|
}
|
||||||
filesData.add(FileData.ofRelativePath(relativePath, baseDir, mode));
|
fileData = FileData.ofRelativePath(relativePath, baseDir, mode);
|
||||||
} else if (pathAsString != null) {
|
} else if (pathAsString != null) {
|
||||||
Path path = Path.of(pathAsString);
|
Path path = Path.of(pathAsString);
|
||||||
if (path.isAbsolute() == false) {
|
if (FileData.isAbsolutePath(pathAsString) == false) {
|
||||||
throw new PolicyValidationException("'path' [" + pathAsString + "] must be absolute");
|
throw new PolicyValidationException("'path' [" + pathAsString + "] must be absolute");
|
||||||
}
|
}
|
||||||
filesData.add(FileData.ofPath(path, mode));
|
fileData = FileData.ofPath(path, mode);
|
||||||
} else if (pathSetting != null) {
|
} else if (pathSetting != null) {
|
||||||
filesData.add(FileData.ofPathSetting(pathSetting, mode));
|
fileData = FileData.ofPathSetting(pathSetting, mode);
|
||||||
} else if (relativePathSetting != null) {
|
} else if (relativePathSetting != null) {
|
||||||
if (baseDir == null) {
|
if (baseDir == null) {
|
||||||
throw new PolicyValidationException("files entitlement with a 'relative_path_setting' must specify 'relative_to'");
|
throw new PolicyValidationException("files entitlement with a 'relative_path_setting' must specify 'relative_to'");
|
||||||
}
|
}
|
||||||
filesData.add(FileData.ofRelativePathSetting(relativePathSetting, baseDir, mode));
|
fileData = FileData.ofRelativePathSetting(relativePathSetting, baseDir, mode);
|
||||||
} else {
|
} else {
|
||||||
throw new AssertionError("File entry validation error");
|
throw new AssertionError("File entry validation error");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
filesData.add(fileData.withPlatform(platform));
|
||||||
}
|
}
|
||||||
return new FilesEntitlement(filesData);
|
return new FilesEntitlement(filesData);
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,7 @@ public class FileAccessTreeTests extends ESTestCase {
|
||||||
Path.of("/home"),
|
Path.of("/home"),
|
||||||
Path.of("/config"),
|
Path.of("/config"),
|
||||||
new Path[] { Path.of("/data1"), Path.of("/data2") },
|
new Path[] { Path.of("/data1"), Path.of("/data2") },
|
||||||
|
new Path[] { Path.of("/shared1"), Path.of("/shared2") },
|
||||||
Path.of("/tmp"),
|
Path.of("/tmp"),
|
||||||
setting -> settings.get(setting),
|
setting -> settings.get(setting),
|
||||||
glob -> settings.getGlobValues(glob)
|
glob -> settings.getGlobValues(glob)
|
||||||
|
@ -117,6 +118,15 @@ public class FileAccessTreeTests extends ESTestCase {
|
||||||
assertThat(tree.canWrite(path("foo/baz")), is(false));
|
assertThat(tree.canWrite(path("foo/baz")), is(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testPathAndFileWithSamePrefix() {
|
||||||
|
var tree = accessTree(entitlement("foo/bar/", "read", "foo/bar.xml", "read"));
|
||||||
|
assertThat(tree.canRead(path("foo")), is(false));
|
||||||
|
assertThat(tree.canRead(path("foo/bar")), is(true));
|
||||||
|
assertThat(tree.canRead(path("foo/bar/baz")), is(true));
|
||||||
|
assertThat(tree.canRead(path("foo/bar.xml")), is(true));
|
||||||
|
assertThat(tree.canRead(path("foo/bar.txt")), is(false));
|
||||||
|
}
|
||||||
|
|
||||||
public void testReadWithRelativePath() {
|
public void testReadWithRelativePath() {
|
||||||
for (var dir : List.of("config", "home")) {
|
for (var dir : List.of("config", "home")) {
|
||||||
var tree = accessTree(entitlement(Map.of("relative_path", "foo", "mode", "read", "relative_to", dir)));
|
var tree = accessTree(entitlement(Map.of("relative_path", "foo", "mode", "read", "relative_to", dir)));
|
||||||
|
@ -171,10 +181,23 @@ public class FileAccessTreeTests extends ESTestCase {
|
||||||
public void testNormalizePath() {
|
public void testNormalizePath() {
|
||||||
var tree = accessTree(entitlement("foo/../bar", "read"));
|
var tree = accessTree(entitlement("foo/../bar", "read"));
|
||||||
assertThat(tree.canRead(path("foo/../bar")), is(true));
|
assertThat(tree.canRead(path("foo/../bar")), is(true));
|
||||||
|
assertThat(tree.canRead(path("foo/../bar/")), is(true));
|
||||||
assertThat(tree.canRead(path("foo")), is(false));
|
assertThat(tree.canRead(path("foo")), is(false));
|
||||||
assertThat(tree.canRead(path("")), is(false));
|
assertThat(tree.canRead(path("")), is(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testNormalizeTrailingSlashes() {
|
||||||
|
var tree = accessTree(entitlement("/trailing/slash/", "read", "/no/trailing/slash", "read"));
|
||||||
|
assertThat(tree.canRead(path("/trailing/slash")), is(true));
|
||||||
|
assertThat(tree.canRead(path("/trailing/slash/")), is(true));
|
||||||
|
assertThat(tree.canRead(path("/trailing/slash.xml")), is(false));
|
||||||
|
assertThat(tree.canRead(path("/trailing/slash/file.xml")), is(true));
|
||||||
|
assertThat(tree.canRead(path("/no/trailing/slash")), is(true));
|
||||||
|
assertThat(tree.canRead(path("/no/trailing/slash/")), is(true));
|
||||||
|
assertThat(tree.canRead(path("/no/trailing/slash.xml")), is(false));
|
||||||
|
assertThat(tree.canRead(path("/no/trailing/slash/file.xml")), is(true));
|
||||||
|
}
|
||||||
|
|
||||||
public void testForwardSlashes() {
|
public void testForwardSlashes() {
|
||||||
String sep = getDefaultFileSystem().getSeparator();
|
String sep = getDefaultFileSystem().getSeparator();
|
||||||
var tree = accessTree(entitlement("a/b", "read", "m" + sep + "n", "read"));
|
var tree = accessTree(entitlement("a/b", "read", "m" + sep + "n", "read"));
|
||||||
|
|
|
@ -69,6 +69,7 @@ public class PolicyManagerTests extends ESTestCase {
|
||||||
TEST_BASE_DIR.resolve("/user/home"),
|
TEST_BASE_DIR.resolve("/user/home"),
|
||||||
TEST_BASE_DIR.resolve("/config"),
|
TEST_BASE_DIR.resolve("/config"),
|
||||||
new Path[] { TEST_BASE_DIR.resolve("/data1/"), TEST_BASE_DIR.resolve("/data2") },
|
new Path[] { TEST_BASE_DIR.resolve("/data1/"), TEST_BASE_DIR.resolve("/data2") },
|
||||||
|
new Path[] { TEST_BASE_DIR.resolve("/shared1"), TEST_BASE_DIR.resolve("/shared2") },
|
||||||
TEST_BASE_DIR.resolve("/temp"),
|
TEST_BASE_DIR.resolve("/temp"),
|
||||||
Settings.EMPTY::get,
|
Settings.EMPTY::get,
|
||||||
Settings.EMPTY::getGlobValues
|
Settings.EMPTY::getGlobValues
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
/*
|
||||||
|
* 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", the "GNU Affero General Public License v3.0 only", and the "Server Side
|
||||||
|
* Public License v 1"; you may not use this file except in compliance with, at
|
||||||
|
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
||||||
|
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.elasticsearch.entitlement.runtime.policy.entitlements;
|
||||||
|
|
||||||
|
import org.elasticsearch.test.ESTestCase;
|
||||||
|
|
||||||
|
import static org.elasticsearch.entitlement.runtime.policy.entitlements.FilesEntitlement.FileData.isAbsolutePath;
|
||||||
|
import static org.hamcrest.Matchers.is;
|
||||||
|
|
||||||
|
public class FileDataTests extends ESTestCase {
|
||||||
|
|
||||||
|
public void testPathIsAbsolute() {
|
||||||
|
var windowsNamedPipe = "\\\\.\\pipe";
|
||||||
|
var windowsDosAbsolutePath = "C:\\temp";
|
||||||
|
var unixAbsolutePath = "/tmp/foo";
|
||||||
|
var unixStyleUncPath = "//C/temp";
|
||||||
|
var uncPath = "\\\\C\\temp";
|
||||||
|
var longPath = "\\\\?\\C:\\temp";
|
||||||
|
|
||||||
|
var relativePath = "foo";
|
||||||
|
var headingSlashRelativePath = "\\foo";
|
||||||
|
|
||||||
|
assertThat(isAbsolutePath(windowsNamedPipe), is(true));
|
||||||
|
assertThat(isAbsolutePath(windowsDosAbsolutePath), is(true));
|
||||||
|
assertThat(isAbsolutePath(unixAbsolutePath), is(true));
|
||||||
|
assertThat(isAbsolutePath(unixStyleUncPath), is(true));
|
||||||
|
assertThat(isAbsolutePath(uncPath), is(true));
|
||||||
|
assertThat(isAbsolutePath(longPath), is(true));
|
||||||
|
|
||||||
|
assertThat(isAbsolutePath(relativePath), is(false));
|
||||||
|
assertThat(isAbsolutePath(headingSlashRelativePath), is(false));
|
||||||
|
assertThat(isAbsolutePath(""), is(false));
|
||||||
|
}
|
||||||
|
}
|
|
@ -40,6 +40,7 @@ public class FilesEntitlementTests extends ESTestCase {
|
||||||
Path.of("home"),
|
Path.of("home"),
|
||||||
Path.of("/config"),
|
Path.of("/config"),
|
||||||
new Path[] { Path.of("/data1"), Path.of("/data2") },
|
new Path[] { Path.of("/data1"), Path.of("/data2") },
|
||||||
|
new Path[] { Path.of("/shared1"), Path.of("/shared2") },
|
||||||
Path.of("/tmp"),
|
Path.of("/tmp"),
|
||||||
setting -> settings.get(setting),
|
setting -> settings.get(setting),
|
||||||
glob -> settings.getGlobValues(glob)
|
glob -> settings.getGlobValues(glob)
|
||||||
|
@ -60,12 +61,36 @@ public class FilesEntitlementTests extends ESTestCase {
|
||||||
assertThat(ex.getMessage(), is("invalid relative directory: bar, valid values: [config, data, home]"));
|
assertThat(ex.getMessage(), is("invalid relative directory: bar, valid values: [config, data, home]"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testFileDataRelativeWithEmptyDirectory() {
|
public void testFileDataRelativeWithAbsoluteDirectoryFails() {
|
||||||
var fileData = FileData.ofRelativePath(Path.of(""), FilesEntitlement.BaseDir.DATA, READ_WRITE);
|
var fileData = FileData.ofRelativePath(Path.of(""), FilesEntitlement.BaseDir.DATA, READ_WRITE);
|
||||||
var dataDirs = fileData.resolvePaths(TEST_PATH_LOOKUP);
|
var dataDirs = fileData.resolvePaths(TEST_PATH_LOOKUP);
|
||||||
assertThat(dataDirs.toList(), contains(Path.of("/data1/"), Path.of("/data2")));
|
assertThat(dataDirs.toList(), contains(Path.of("/data1/"), Path.of("/data2")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testFileDataAbsoluteWithRelativeDirectoryFails() {
|
||||||
|
var ex = expectThrows(
|
||||||
|
PolicyValidationException.class,
|
||||||
|
() -> FilesEntitlement.build(List.of((Map.of("path", "foo", "mode", "read"))))
|
||||||
|
);
|
||||||
|
|
||||||
|
assertThat(ex.getMessage(), is("'path' [foo] must be absolute"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testFileDataRelativeWithEmptyDirectory() {
|
||||||
|
var ex = expectThrows(
|
||||||
|
PolicyValidationException.class,
|
||||||
|
() -> FilesEntitlement.build(List.of((Map.of("relative_path", "/foo", "mode", "read", "relative_to", "config"))))
|
||||||
|
);
|
||||||
|
|
||||||
|
var ex2 = expectThrows(
|
||||||
|
PolicyValidationException.class,
|
||||||
|
() -> FilesEntitlement.build(List.of((Map.of("relative_path", "C:\\foo", "mode", "read", "relative_to", "config"))))
|
||||||
|
);
|
||||||
|
|
||||||
|
assertThat(ex.getMessage(), is("'relative_path' [/foo] must be relative"));
|
||||||
|
assertThat(ex2.getMessage(), is("'relative_path' [C:\\foo] must be relative"));
|
||||||
|
}
|
||||||
|
|
||||||
public void testPathSettingResolve() {
|
public void testPathSettingResolve() {
|
||||||
var entitlement = FilesEntitlement.build(List.of(Map.of("path_setting", "foo.bar", "mode", "read")));
|
var entitlement = FilesEntitlement.build(List.of(Map.of("path_setting", "foo.bar", "mode", "read")));
|
||||||
var filesData = entitlement.filesData();
|
var filesData = entitlement.filesData();
|
||||||
|
|
|
@ -21,7 +21,6 @@ import org.elasticsearch.cluster.ClusterStateUpdateTask;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.DataStream;
|
import org.elasticsearch.cluster.metadata.DataStream;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.Metadata;
|
import org.elasticsearch.cluster.metadata.Metadata;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.Priority;
|
import org.elasticsearch.common.Priority;
|
||||||
|
@ -49,7 +48,6 @@ public class PromoteDataStreamTransportAction extends AcknowledgedTransportMaste
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
SystemIndices systemIndices
|
SystemIndices systemIndices
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
|
|
|
@ -15,7 +15,6 @@ import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.DataStream;
|
import org.elasticsearch.cluster.metadata.DataStream;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.Metadata;
|
import org.elasticsearch.cluster.metadata.Metadata;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||||
|
@ -46,7 +45,6 @@ public class TransportGetDataStreamLifecycleStatsAction extends TransportMasterN
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
DataStreamLifecycleService lifecycleService
|
DataStreamLifecycleService lifecycleService
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
|
|
|
@ -17,7 +17,6 @@ import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.metadata.DataStream;
|
import org.elasticsearch.cluster.metadata.DataStream;
|
||||||
import org.elasticsearch.cluster.metadata.DataStreamLifecycle;
|
import org.elasticsearch.cluster.metadata.DataStreamLifecycle;
|
||||||
import org.elasticsearch.cluster.metadata.IndexMetadata;
|
import org.elasticsearch.cluster.metadata.IndexMetadata;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.Metadata;
|
import org.elasticsearch.cluster.metadata.Metadata;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
|
@ -52,7 +51,6 @@ public class TransportGetDataStreamLifecycleStatsActionTests extends ESTestCase
|
||||||
mock(ClusterService.class),
|
mock(ClusterService.class),
|
||||||
mock(ThreadPool.class),
|
mock(ThreadPool.class),
|
||||||
mock(ActionFilters.class),
|
mock(ActionFilters.class),
|
||||||
mock(IndexNameExpressionResolver.class),
|
|
||||||
dataStreamLifecycleService
|
dataStreamLifecycleService
|
||||||
);
|
);
|
||||||
private Long lastRunDuration;
|
private Long lastRunDuration;
|
||||||
|
|
|
@ -18,7 +18,7 @@ dependencies {
|
||||||
javaRestTestImplementation(testArtifact(project(":qa:full-cluster-restart"), "javaRestTest"))
|
javaRestTestImplementation(testArtifact(project(":qa:full-cluster-restart"), "javaRestTest"))
|
||||||
}
|
}
|
||||||
|
|
||||||
buildParams.bwcVersions.withWireCompatible(v -> v.before("9.0.0")) { bwcVersion, baseName ->
|
buildParams.bwcVersions.withWireCompatible(v -> v.onOrAfter("8.15.0")) { bwcVersion, baseName ->
|
||||||
tasks.register(bwcTaskName(bwcVersion), StandaloneRestIntegTestTask) {
|
tasks.register(bwcTaskName(bwcVersion), StandaloneRestIntegTestTask) {
|
||||||
usesBwcDistribution(bwcVersion)
|
usesBwcDistribution(bwcVersion)
|
||||||
systemProperty("tests.old_cluster_version", bwcVersion)
|
systemProperty("tests.old_cluster_version", bwcVersion)
|
||||||
|
|
|
@ -12,36 +12,25 @@ import fixture.geoip.GeoIpHttpFixture;
|
||||||
|
|
||||||
import com.carrotsearch.randomizedtesting.annotations.Name;
|
import com.carrotsearch.randomizedtesting.annotations.Name;
|
||||||
|
|
||||||
import org.apache.http.util.EntityUtils;
|
|
||||||
import org.elasticsearch.client.Request;
|
import org.elasticsearch.client.Request;
|
||||||
import org.elasticsearch.client.RequestOptions;
|
|
||||||
import org.elasticsearch.client.Response;
|
import org.elasticsearch.client.Response;
|
||||||
import org.elasticsearch.client.WarningsHandler;
|
|
||||||
import org.elasticsearch.common.settings.Settings;
|
|
||||||
import org.elasticsearch.common.util.concurrent.ThreadContext;
|
|
||||||
import org.elasticsearch.core.Nullable;
|
|
||||||
import org.elasticsearch.rest.RestStatus;
|
|
||||||
import org.elasticsearch.test.cluster.ElasticsearchCluster;
|
import org.elasticsearch.test.cluster.ElasticsearchCluster;
|
||||||
import org.elasticsearch.test.cluster.FeatureFlag;
|
import org.elasticsearch.test.cluster.FeatureFlag;
|
||||||
import org.elasticsearch.test.cluster.local.distribution.DistributionType;
|
import org.elasticsearch.test.cluster.local.distribution.DistributionType;
|
||||||
import org.elasticsearch.test.cluster.util.Version;
|
import org.elasticsearch.test.cluster.util.Version;
|
||||||
import org.elasticsearch.test.rest.ObjectPath;
|
|
||||||
import org.elasticsearch.upgrades.FullClusterRestartUpgradeStatus;
|
import org.elasticsearch.upgrades.FullClusterRestartUpgradeStatus;
|
||||||
import org.elasticsearch.upgrades.ParameterizedFullClusterRestartTestCase;
|
import org.elasticsearch.upgrades.ParameterizedFullClusterRestartTestCase;
|
||||||
import org.junit.ClassRule;
|
import org.junit.ClassRule;
|
||||||
import org.junit.rules.RuleChain;
|
import org.junit.rules.RuleChain;
|
||||||
import org.junit.rules.TestRule;
|
import org.junit.rules.TestRule;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Base64;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Set;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import static org.hamcrest.Matchers.equalTo;
|
||||||
|
import static org.hamcrest.Matchers.hasSize;
|
||||||
import static org.hamcrest.Matchers.is;
|
import static org.hamcrest.Matchers.is;
|
||||||
|
|
||||||
public class FullClusterRestartIT extends ParameterizedFullClusterRestartTestCase {
|
public class FullClusterRestartIT extends ParameterizedFullClusterRestartTestCase {
|
||||||
|
@ -50,29 +39,16 @@ public class FullClusterRestartIT extends ParameterizedFullClusterRestartTestCas
|
||||||
|
|
||||||
private static final GeoIpHttpFixture fixture = new GeoIpHttpFixture(useFixture);
|
private static final GeoIpHttpFixture fixture = new GeoIpHttpFixture(useFixture);
|
||||||
|
|
||||||
// e.g. use ./gradlew -Dtests.jvm.argline="-Dgeoip_test_with_security=false" ":modules:ingest-geoip:qa:full-cluster-restart:check"
|
|
||||||
// to set this to false, if you so desire
|
|
||||||
private static final boolean useSecurity = Boolean.parseBoolean(System.getProperty("geoip_test_with_security", "true"));
|
|
||||||
|
|
||||||
private static final ElasticsearchCluster cluster = ElasticsearchCluster.local()
|
private static final ElasticsearchCluster cluster = ElasticsearchCluster.local()
|
||||||
.distribution(DistributionType.DEFAULT)
|
.distribution(DistributionType.DEFAULT)
|
||||||
.version(Version.fromString(OLD_CLUSTER_VERSION))
|
.version(Version.fromString(OLD_CLUSTER_VERSION))
|
||||||
.nodes(2)
|
.nodes(2)
|
||||||
.setting("ingest.geoip.downloader.endpoint", () -> fixture.getAddress(), s -> useFixture)
|
.setting("ingest.geoip.downloader.endpoint", () -> fixture.getAddress(), s -> useFixture)
|
||||||
.setting("xpack.security.enabled", useSecurity ? "true" : "false")
|
.setting("xpack.security.enabled", "false")
|
||||||
|
// .setting("logger.org.elasticsearch.ingest.geoip", "TRACE")
|
||||||
.feature(FeatureFlag.TIME_SERIES_MODE)
|
.feature(FeatureFlag.TIME_SERIES_MODE)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Settings restClientSettings() {
|
|
||||||
Settings settings = super.restClientSettings();
|
|
||||||
if (useSecurity) {
|
|
||||||
String token = "Basic " + Base64.getEncoder().encodeToString("test_user:x-pack-test-password".getBytes(StandardCharsets.UTF_8));
|
|
||||||
settings = Settings.builder().put(settings).put(ThreadContext.PREFIX + ".Authorization", token).build();
|
|
||||||
}
|
|
||||||
return settings;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ClassRule
|
@ClassRule
|
||||||
public static TestRule ruleChain = RuleChain.outerRule(fixture).around(cluster);
|
public static TestRule ruleChain = RuleChain.outerRule(fixture).around(cluster);
|
||||||
|
|
||||||
|
@ -85,196 +61,32 @@ public class FullClusterRestartIT extends ParameterizedFullClusterRestartTestCas
|
||||||
return cluster;
|
return cluster;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testGeoIpSystemFeaturesMigration() throws Exception {
|
|
||||||
final List<String> maybeSecurityIndex = useSecurity ? List.of(".security-7") : List.of();
|
|
||||||
final List<String> maybeSecurityIndexReindexed = useSecurity ? List.of(".security-7-reindexed-for-10") : List.of();
|
|
||||||
|
|
||||||
if (isRunningAgainstOldCluster()) {
|
|
||||||
Request enableDownloader = new Request("PUT", "/_cluster/settings");
|
|
||||||
enableDownloader.setJsonEntity("""
|
|
||||||
{"persistent": {"ingest.geoip.downloader.enabled": true}}
|
|
||||||
""");
|
|
||||||
assertOK(client().performRequest(enableDownloader));
|
|
||||||
|
|
||||||
Request putPipeline = new Request("PUT", "/_ingest/pipeline/geoip");
|
|
||||||
putPipeline.setJsonEntity("""
|
|
||||||
{
|
|
||||||
"description": "Add geoip info",
|
|
||||||
"processors": [{
|
|
||||||
"geoip": {
|
|
||||||
"field": "ip",
|
|
||||||
"target_field": "geo",
|
|
||||||
"database_file": "GeoLite2-Country.mmdb"
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
""");
|
|
||||||
assertOK(client().performRequest(putPipeline));
|
|
||||||
|
|
||||||
// wait for the geo databases to all be loaded
|
|
||||||
assertBusy(() -> testDatabasesLoaded(), 30, TimeUnit.SECONDS);
|
|
||||||
|
|
||||||
// the geoip index should be created
|
|
||||||
assertBusy(() -> testCatIndices(List.of(".geoip_databases"), maybeSecurityIndex));
|
|
||||||
assertBusy(() -> testIndexGeoDoc());
|
|
||||||
|
|
||||||
// before the upgrade, Kibana should work
|
|
||||||
assertBusy(() -> testGetStarAsKibana(List.of("my-index-00001"), maybeSecurityIndex));
|
|
||||||
|
|
||||||
// as should a normal get *
|
|
||||||
assertBusy(() -> testGetStar(List.of("my-index-00001"), maybeSecurityIndex));
|
|
||||||
|
|
||||||
// and getting data streams
|
|
||||||
assertBusy(() -> testGetDatastreams());
|
|
||||||
} else {
|
|
||||||
// after the upgrade, but before the migration, Kibana should work
|
|
||||||
assertBusy(() -> testGetStarAsKibana(List.of("my-index-00001"), maybeSecurityIndex));
|
|
||||||
|
|
||||||
// as should a normal get *
|
|
||||||
assertBusy(() -> testGetStar(List.of("my-index-00001"), maybeSecurityIndex));
|
|
||||||
|
|
||||||
// and getting data streams
|
|
||||||
assertBusy(() -> testGetDatastreams());
|
|
||||||
|
|
||||||
// migrate the system features and give the cluster a moment to settle
|
|
||||||
Request migrateSystemFeatures = new Request("POST", "/_migration/system_features");
|
|
||||||
assertOK(client().performRequest(migrateSystemFeatures));
|
|
||||||
ensureHealth(request -> request.addParameter("wait_for_status", "yellow"));
|
|
||||||
|
|
||||||
assertBusy(() -> testCatIndices(List.of(".geoip_databases-reindexed-for-10", "my-index-00001"), maybeSecurityIndexReindexed));
|
|
||||||
assertBusy(() -> testIndexGeoDoc());
|
|
||||||
|
|
||||||
// after the migration, Kibana should work
|
|
||||||
assertBusy(() -> testGetStarAsKibana(List.of("my-index-00001"), maybeSecurityIndexReindexed));
|
|
||||||
|
|
||||||
// as should a normal get *
|
|
||||||
assertBusy(() -> testGetStar(List.of("my-index-00001"), maybeSecurityIndexReindexed));
|
|
||||||
|
|
||||||
// and getting data streams
|
|
||||||
assertBusy(() -> testGetDatastreams());
|
|
||||||
|
|
||||||
Request disableDownloader = new Request("PUT", "/_cluster/settings");
|
|
||||||
disableDownloader.setJsonEntity("""
|
|
||||||
{"persistent": {"ingest.geoip.downloader.enabled": false}}
|
|
||||||
""");
|
|
||||||
assertOK(client().performRequest(disableDownloader));
|
|
||||||
|
|
||||||
// the geoip index should be deleted
|
|
||||||
assertBusy(() -> testCatIndices(List.of("my-index-00001"), maybeSecurityIndexReindexed));
|
|
||||||
|
|
||||||
Request enableDownloader = new Request("PUT", "/_cluster/settings");
|
|
||||||
enableDownloader.setJsonEntity("""
|
|
||||||
{"persistent": {"ingest.geoip.downloader.enabled": true}}
|
|
||||||
""");
|
|
||||||
assertOK(client().performRequest(enableDownloader));
|
|
||||||
|
|
||||||
// wait for the geo databases to all be loaded
|
|
||||||
assertBusy(() -> testDatabasesLoaded(), 30, TimeUnit.SECONDS);
|
|
||||||
|
|
||||||
// the geoip index should be recreated
|
|
||||||
assertBusy(() -> testCatIndices(List.of(".geoip_databases", "my-index-00001"), maybeSecurityIndexReindexed));
|
|
||||||
assertBusy(() -> testIndexGeoDoc());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
private void testDatabasesLoaded() throws IOException {
|
public void testGeoIpDatabaseConfigurations() throws Exception {
|
||||||
Request getTaskState = new Request("GET", "/_cluster/state");
|
if (isRunningAgainstOldCluster()) {
|
||||||
ObjectPath state = ObjectPath.createFromResponse(assertOK(client().performRequest(getTaskState)));
|
Request putConfiguration = new Request("PUT", "_ingest/ip_location/database/my-database-1");
|
||||||
|
putConfiguration.setJsonEntity("""
|
||||||
List<?> tasks = state.evaluate("metadata.persistent_tasks.tasks");
|
{
|
||||||
// Short-circuit to avoid using steams if the list is empty
|
"name": "GeoIP2-Domain",
|
||||||
if (tasks.isEmpty()) {
|
"maxmind": {
|
||||||
fail();
|
"account_id": "1234567"
|
||||||
}
|
|
||||||
Map<String, Object> databases = (Map<String, Object>) tasks.stream().map(task -> {
|
|
||||||
try {
|
|
||||||
return ObjectPath.evaluate(task, "task.geoip-downloader.state.databases");
|
|
||||||
} catch (IOException e) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}).filter(Objects::nonNull).findFirst().orElse(null);
|
|
||||||
|
|
||||||
assertNotNull(databases);
|
|
||||||
|
|
||||||
for (String name : List.of("GeoLite2-ASN.mmdb", "GeoLite2-City.mmdb", "GeoLite2-Country.mmdb")) {
|
|
||||||
Object database = databases.get(name);
|
|
||||||
assertNotNull(database);
|
|
||||||
assertNotNull(ObjectPath.evaluate(database, "md5"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void testCatIndices(List<String> indexNames, @Nullable List<String> additionalIndexNames) throws IOException {
|
|
||||||
Request catIndices = new Request("GET", "_cat/indices/*?s=index&h=index&expand_wildcards=all");
|
|
||||||
// the cat APIs can sometimes 404, erroneously
|
|
||||||
// see https://github.com/elastic/elasticsearch/issues/104371
|
|
||||||
setIgnoredErrorResponseCodes(catIndices, RestStatus.NOT_FOUND);
|
|
||||||
String response = EntityUtils.toString(assertOK(client().performRequest(catIndices)).getEntity());
|
|
||||||
List<String> indices = List.of(response.trim().split("\\s+"));
|
|
||||||
|
|
||||||
if (additionalIndexNames != null && additionalIndexNames.isEmpty() == false) {
|
|
||||||
indexNames = new ArrayList<>(indexNames); // recopy into a mutable list
|
|
||||||
indexNames.addAll(additionalIndexNames);
|
|
||||||
}
|
|
||||||
|
|
||||||
assertThat(new HashSet<>(indices), is(new HashSet<>(indexNames)));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void testIndexGeoDoc() throws IOException {
|
|
||||||
Request putDoc = new Request("PUT", "/my-index-00001/_doc/my_id?pipeline=geoip");
|
|
||||||
putDoc.setJsonEntity("""
|
|
||||||
{"ip": "89.160.20.128"}
|
|
||||||
""");
|
""");
|
||||||
assertOK(client().performRequest(putDoc));
|
assertOK(client().performRequest(putConfiguration));
|
||||||
|
|
||||||
Request getDoc = new Request("GET", "/my-index-00001/_doc/my_id");
|
|
||||||
ObjectPath doc = ObjectPath.createFromResponse(assertOK(client().performRequest(getDoc)));
|
|
||||||
assertNull(doc.evaluate("_source.tags"));
|
|
||||||
assertEquals("Sweden", doc.evaluate("_source.geo.country_name"));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void testGetStar(List<String> indexNames, @Nullable List<String> additionalIndexNames) throws IOException {
|
|
||||||
Request getStar = new Request("GET", "*?expand_wildcards=all");
|
|
||||||
getStar.setOptions(
|
|
||||||
RequestOptions.DEFAULT.toBuilder().setWarningsHandler(WarningsHandler.PERMISSIVE) // we don't care about warnings, just errors
|
|
||||||
);
|
|
||||||
Response response = assertOK(client().performRequest(getStar));
|
|
||||||
|
|
||||||
if (additionalIndexNames != null && additionalIndexNames.isEmpty() == false) {
|
|
||||||
indexNames = new ArrayList<>(indexNames); // recopy into a mutable list
|
|
||||||
indexNames.addAll(additionalIndexNames);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assertBusy(() -> {
|
||||||
|
Request getConfiguration = new Request("GET", "_ingest/ip_location/database/my-database-1");
|
||||||
|
Response response = assertOK(client().performRequest(getConfiguration));
|
||||||
Map<String, Object> map = responseAsMap(response);
|
Map<String, Object> map = responseAsMap(response);
|
||||||
assertThat(map.keySet(), is(new HashSet<>(indexNames)));
|
assertThat(map.keySet(), equalTo(Set.of("databases")));
|
||||||
}
|
List<Map<String, Object>> databases = (List<Map<String, Object>>) map.get("databases");
|
||||||
|
assertThat(databases, hasSize(1));
|
||||||
private void testGetStarAsKibana(List<String> indexNames, @Nullable List<String> additionalIndexNames) throws IOException {
|
Map<String, Object> database = databases.get(0);
|
||||||
Request getStar = new Request("GET", "*?expand_wildcards=all");
|
assertThat(database.get("id"), is("my-database-1"));
|
||||||
getStar.setOptions(
|
assertThat(database.get("version"), is(1));
|
||||||
RequestOptions.DEFAULT.toBuilder()
|
assertThat(database.get("database"), equalTo(Map.of("name", "GeoIP2-Domain", "maxmind", Map.of("account_id", "1234567"))));
|
||||||
.addHeader("X-elastic-product-origin", "kibana")
|
}, 30, TimeUnit.SECONDS);
|
||||||
.setWarningsHandler(WarningsHandler.PERMISSIVE) // we don't care about warnings, just errors
|
|
||||||
);
|
|
||||||
Response response = assertOK(client().performRequest(getStar));
|
|
||||||
|
|
||||||
if (additionalIndexNames != null && additionalIndexNames.isEmpty() == false) {
|
|
||||||
indexNames = new ArrayList<>(indexNames); // recopy into a mutable list
|
|
||||||
indexNames.addAll(additionalIndexNames);
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, Object> map = responseAsMap(response);
|
|
||||||
assertThat(map.keySet(), is(new HashSet<>(indexNames)));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void testGetDatastreams() throws IOException {
|
|
||||||
Request getStar = new Request("GET", "_data_stream");
|
|
||||||
getStar.setOptions(
|
|
||||||
RequestOptions.DEFAULT.toBuilder().setWarningsHandler(WarningsHandler.PERMISSIVE) // we don't care about warnings, just errors
|
|
||||||
);
|
|
||||||
Response response = client().performRequest(getStar);
|
|
||||||
assertOK(response);
|
|
||||||
|
|
||||||
// note: we don't actually care about the response, just that there was one and that it didn't error out on us
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
26
modules/ingest-geoip/qa/geoip-reindexed/build.gradle
Normal file
26
modules/ingest-geoip/qa/geoip-reindexed/build.gradle
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
/*
|
||||||
|
* 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", the "GNU Affero General Public License v3.0 only", and the "Server Side
|
||||||
|
* Public License v 1"; you may not use this file except in compliance with, at
|
||||||
|
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
||||||
|
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||||
|
*/
|
||||||
|
|
||||||
|
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
|
||||||
|
|
||||||
|
apply plugin: 'elasticsearch.internal-java-rest-test'
|
||||||
|
apply plugin: 'elasticsearch.bwc-test'
|
||||||
|
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
javaRestTestImplementation project(':test:fixtures:geoip-fixture')
|
||||||
|
javaRestTestImplementation(testArtifact(project(":qa:full-cluster-restart"), "javaRestTest"))
|
||||||
|
}
|
||||||
|
|
||||||
|
buildParams.bwcVersions.withWireCompatible(v -> v.before("9.0.0")) { bwcVersion, baseName ->
|
||||||
|
tasks.register(bwcTaskName(bwcVersion), StandaloneRestIntegTestTask) {
|
||||||
|
usesBwcDistribution(bwcVersion)
|
||||||
|
systemProperty("tests.old_cluster_version", bwcVersion)
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,280 @@
|
||||||
|
/*
|
||||||
|
* 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", the "GNU Affero General Public License v3.0 only", and the "Server Side
|
||||||
|
* Public License v 1"; you may not use this file except in compliance with, at
|
||||||
|
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
||||||
|
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||||
|
*/
|
||||||
|
package org.elasticsearch.ingest.geoip;
|
||||||
|
|
||||||
|
import fixture.geoip.GeoIpHttpFixture;
|
||||||
|
|
||||||
|
import com.carrotsearch.randomizedtesting.annotations.Name;
|
||||||
|
|
||||||
|
import org.apache.http.util.EntityUtils;
|
||||||
|
import org.elasticsearch.client.Request;
|
||||||
|
import org.elasticsearch.client.RequestOptions;
|
||||||
|
import org.elasticsearch.client.Response;
|
||||||
|
import org.elasticsearch.client.WarningsHandler;
|
||||||
|
import org.elasticsearch.common.settings.Settings;
|
||||||
|
import org.elasticsearch.common.util.concurrent.ThreadContext;
|
||||||
|
import org.elasticsearch.core.Nullable;
|
||||||
|
import org.elasticsearch.rest.RestStatus;
|
||||||
|
import org.elasticsearch.test.cluster.ElasticsearchCluster;
|
||||||
|
import org.elasticsearch.test.cluster.FeatureFlag;
|
||||||
|
import org.elasticsearch.test.cluster.local.distribution.DistributionType;
|
||||||
|
import org.elasticsearch.test.cluster.util.Version;
|
||||||
|
import org.elasticsearch.test.rest.ObjectPath;
|
||||||
|
import org.elasticsearch.upgrades.FullClusterRestartUpgradeStatus;
|
||||||
|
import org.elasticsearch.upgrades.ParameterizedFullClusterRestartTestCase;
|
||||||
|
import org.junit.ClassRule;
|
||||||
|
import org.junit.rules.RuleChain;
|
||||||
|
import org.junit.rules.TestRule;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Base64;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import static org.hamcrest.Matchers.is;
|
||||||
|
|
||||||
|
public class GeoIpReindexedIT extends ParameterizedFullClusterRestartTestCase {
|
||||||
|
|
||||||
|
private static final boolean useFixture = Boolean.getBoolean("geoip_use_service") == false;
|
||||||
|
|
||||||
|
private static final GeoIpHttpFixture fixture = new GeoIpHttpFixture(useFixture);
|
||||||
|
|
||||||
|
// e.g. use ./gradlew -Dtests.jvm.argline="-Dgeoip_test_with_security=false" ":modules:ingest-geoip:qa:full-cluster-restart:check"
|
||||||
|
// to set this to false, if you so desire
|
||||||
|
private static final boolean useSecurity = Boolean.parseBoolean(System.getProperty("geoip_test_with_security", "true"));
|
||||||
|
|
||||||
|
private static final ElasticsearchCluster cluster = ElasticsearchCluster.local()
|
||||||
|
.distribution(DistributionType.DEFAULT)
|
||||||
|
.version(Version.fromString(OLD_CLUSTER_VERSION))
|
||||||
|
.nodes(2)
|
||||||
|
.setting("ingest.geoip.downloader.endpoint", () -> fixture.getAddress(), s -> useFixture)
|
||||||
|
.setting("xpack.security.enabled", useSecurity ? "true" : "false")
|
||||||
|
.feature(FeatureFlag.TIME_SERIES_MODE)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Settings restClientSettings() {
|
||||||
|
Settings settings = super.restClientSettings();
|
||||||
|
if (useSecurity) {
|
||||||
|
String token = "Basic " + Base64.getEncoder().encodeToString("test_user:x-pack-test-password".getBytes(StandardCharsets.UTF_8));
|
||||||
|
settings = Settings.builder().put(settings).put(ThreadContext.PREFIX + ".Authorization", token).build();
|
||||||
|
}
|
||||||
|
return settings;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ClassRule
|
||||||
|
public static TestRule ruleChain = RuleChain.outerRule(fixture).around(cluster);
|
||||||
|
|
||||||
|
public GeoIpReindexedIT(@Name("cluster") FullClusterRestartUpgradeStatus upgradeStatus) {
|
||||||
|
super(upgradeStatus);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ElasticsearchCluster getUpgradeCluster() {
|
||||||
|
return cluster;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testGeoIpSystemFeaturesMigration() throws Exception {
|
||||||
|
final List<String> maybeSecurityIndex = useSecurity ? List.of(".security-7") : List.of();
|
||||||
|
final List<String> maybeSecurityIndexReindexed = useSecurity ? List.of(".security-7-reindexed-for-10") : List.of();
|
||||||
|
|
||||||
|
if (isRunningAgainstOldCluster()) {
|
||||||
|
Request enableDownloader = new Request("PUT", "/_cluster/settings");
|
||||||
|
enableDownloader.setJsonEntity("""
|
||||||
|
{"persistent": {"ingest.geoip.downloader.enabled": true}}
|
||||||
|
""");
|
||||||
|
assertOK(client().performRequest(enableDownloader));
|
||||||
|
|
||||||
|
Request putPipeline = new Request("PUT", "/_ingest/pipeline/geoip");
|
||||||
|
putPipeline.setJsonEntity("""
|
||||||
|
{
|
||||||
|
"description": "Add geoip info",
|
||||||
|
"processors": [{
|
||||||
|
"geoip": {
|
||||||
|
"field": "ip",
|
||||||
|
"target_field": "geo",
|
||||||
|
"database_file": "GeoLite2-Country.mmdb"
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
""");
|
||||||
|
assertOK(client().performRequest(putPipeline));
|
||||||
|
|
||||||
|
// wait for the geo databases to all be loaded
|
||||||
|
assertBusy(() -> testDatabasesLoaded(), 30, TimeUnit.SECONDS);
|
||||||
|
|
||||||
|
// the geoip index should be created
|
||||||
|
assertBusy(() -> testCatIndices(List.of(".geoip_databases"), maybeSecurityIndex));
|
||||||
|
assertBusy(() -> testIndexGeoDoc());
|
||||||
|
|
||||||
|
// before the upgrade, Kibana should work
|
||||||
|
assertBusy(() -> testGetStarAsKibana(List.of("my-index-00001"), maybeSecurityIndex));
|
||||||
|
|
||||||
|
// as should a normal get *
|
||||||
|
assertBusy(() -> testGetStar(List.of("my-index-00001"), maybeSecurityIndex));
|
||||||
|
|
||||||
|
// and getting data streams
|
||||||
|
assertBusy(() -> testGetDatastreams());
|
||||||
|
} else {
|
||||||
|
// after the upgrade, but before the migration, Kibana should work
|
||||||
|
assertBusy(() -> testGetStarAsKibana(List.of("my-index-00001"), maybeSecurityIndex));
|
||||||
|
|
||||||
|
// as should a normal get *
|
||||||
|
assertBusy(() -> testGetStar(List.of("my-index-00001"), maybeSecurityIndex));
|
||||||
|
|
||||||
|
// and getting data streams
|
||||||
|
assertBusy(() -> testGetDatastreams());
|
||||||
|
|
||||||
|
// migrate the system features and give the cluster a moment to settle
|
||||||
|
Request migrateSystemFeatures = new Request("POST", "/_migration/system_features");
|
||||||
|
assertOK(client().performRequest(migrateSystemFeatures));
|
||||||
|
ensureHealth(request -> request.addParameter("wait_for_status", "yellow"));
|
||||||
|
|
||||||
|
assertBusy(() -> testCatIndices(List.of(".geoip_databases-reindexed-for-10", "my-index-00001"), maybeSecurityIndexReindexed));
|
||||||
|
assertBusy(() -> testIndexGeoDoc());
|
||||||
|
|
||||||
|
// after the migration, Kibana should work
|
||||||
|
assertBusy(() -> testGetStarAsKibana(List.of("my-index-00001"), maybeSecurityIndexReindexed));
|
||||||
|
|
||||||
|
// as should a normal get *
|
||||||
|
assertBusy(() -> testGetStar(List.of("my-index-00001"), maybeSecurityIndexReindexed));
|
||||||
|
|
||||||
|
// and getting data streams
|
||||||
|
assertBusy(() -> testGetDatastreams());
|
||||||
|
|
||||||
|
Request disableDownloader = new Request("PUT", "/_cluster/settings");
|
||||||
|
disableDownloader.setJsonEntity("""
|
||||||
|
{"persistent": {"ingest.geoip.downloader.enabled": false}}
|
||||||
|
""");
|
||||||
|
assertOK(client().performRequest(disableDownloader));
|
||||||
|
|
||||||
|
// the geoip index should be deleted
|
||||||
|
assertBusy(() -> testCatIndices(List.of("my-index-00001"), maybeSecurityIndexReindexed));
|
||||||
|
|
||||||
|
Request enableDownloader = new Request("PUT", "/_cluster/settings");
|
||||||
|
enableDownloader.setJsonEntity("""
|
||||||
|
{"persistent": {"ingest.geoip.downloader.enabled": true}}
|
||||||
|
""");
|
||||||
|
assertOK(client().performRequest(enableDownloader));
|
||||||
|
|
||||||
|
// wait for the geo databases to all be loaded
|
||||||
|
assertBusy(() -> testDatabasesLoaded(), 30, TimeUnit.SECONDS);
|
||||||
|
|
||||||
|
// the geoip index should be recreated
|
||||||
|
assertBusy(() -> testCatIndices(List.of(".geoip_databases", "my-index-00001"), maybeSecurityIndexReindexed));
|
||||||
|
assertBusy(() -> testIndexGeoDoc());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
private void testDatabasesLoaded() throws IOException {
|
||||||
|
Request getTaskState = new Request("GET", "/_cluster/state");
|
||||||
|
ObjectPath state = ObjectPath.createFromResponse(assertOK(client().performRequest(getTaskState)));
|
||||||
|
|
||||||
|
List<?> tasks = state.evaluate("metadata.persistent_tasks.tasks");
|
||||||
|
// Short-circuit to avoid using steams if the list is empty
|
||||||
|
if (tasks.isEmpty()) {
|
||||||
|
fail();
|
||||||
|
}
|
||||||
|
Map<String, Object> databases = (Map<String, Object>) tasks.stream().map(task -> {
|
||||||
|
try {
|
||||||
|
return ObjectPath.evaluate(task, "task.geoip-downloader.state.databases");
|
||||||
|
} catch (IOException e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}).filter(Objects::nonNull).findFirst().orElse(null);
|
||||||
|
|
||||||
|
assertNotNull(databases);
|
||||||
|
|
||||||
|
for (String name : List.of("GeoLite2-ASN.mmdb", "GeoLite2-City.mmdb", "GeoLite2-Country.mmdb")) {
|
||||||
|
Object database = databases.get(name);
|
||||||
|
assertNotNull(database);
|
||||||
|
assertNotNull(ObjectPath.evaluate(database, "md5"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testCatIndices(List<String> indexNames, @Nullable List<String> additionalIndexNames) throws IOException {
|
||||||
|
Request catIndices = new Request("GET", "_cat/indices/*?s=index&h=index&expand_wildcards=all");
|
||||||
|
// the cat APIs can sometimes 404, erroneously
|
||||||
|
// see https://github.com/elastic/elasticsearch/issues/104371
|
||||||
|
setIgnoredErrorResponseCodes(catIndices, RestStatus.NOT_FOUND);
|
||||||
|
String response = EntityUtils.toString(assertOK(client().performRequest(catIndices)).getEntity());
|
||||||
|
List<String> indices = List.of(response.trim().split("\\s+"));
|
||||||
|
|
||||||
|
if (additionalIndexNames != null && additionalIndexNames.isEmpty() == false) {
|
||||||
|
indexNames = new ArrayList<>(indexNames); // recopy into a mutable list
|
||||||
|
indexNames.addAll(additionalIndexNames);
|
||||||
|
}
|
||||||
|
|
||||||
|
assertThat(new HashSet<>(indices), is(new HashSet<>(indexNames)));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testIndexGeoDoc() throws IOException {
|
||||||
|
Request putDoc = new Request("PUT", "/my-index-00001/_doc/my_id?pipeline=geoip");
|
||||||
|
putDoc.setJsonEntity("""
|
||||||
|
{"ip": "89.160.20.128"}
|
||||||
|
""");
|
||||||
|
assertOK(client().performRequest(putDoc));
|
||||||
|
|
||||||
|
Request getDoc = new Request("GET", "/my-index-00001/_doc/my_id");
|
||||||
|
ObjectPath doc = ObjectPath.createFromResponse(assertOK(client().performRequest(getDoc)));
|
||||||
|
assertNull(doc.evaluate("_source.tags"));
|
||||||
|
assertEquals("Sweden", doc.evaluate("_source.geo.country_name"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testGetStar(List<String> indexNames, @Nullable List<String> additionalIndexNames) throws IOException {
|
||||||
|
Request getStar = new Request("GET", "*?expand_wildcards=all");
|
||||||
|
getStar.setOptions(
|
||||||
|
RequestOptions.DEFAULT.toBuilder().setWarningsHandler(WarningsHandler.PERMISSIVE) // we don't care about warnings, just errors
|
||||||
|
);
|
||||||
|
Response response = assertOK(client().performRequest(getStar));
|
||||||
|
|
||||||
|
if (additionalIndexNames != null && additionalIndexNames.isEmpty() == false) {
|
||||||
|
indexNames = new ArrayList<>(indexNames); // recopy into a mutable list
|
||||||
|
indexNames.addAll(additionalIndexNames);
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, Object> map = responseAsMap(response);
|
||||||
|
assertThat(map.keySet(), is(new HashSet<>(indexNames)));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testGetStarAsKibana(List<String> indexNames, @Nullable List<String> additionalIndexNames) throws IOException {
|
||||||
|
Request getStar = new Request("GET", "*?expand_wildcards=all");
|
||||||
|
getStar.setOptions(
|
||||||
|
RequestOptions.DEFAULT.toBuilder()
|
||||||
|
.addHeader("X-elastic-product-origin", "kibana")
|
||||||
|
.setWarningsHandler(WarningsHandler.PERMISSIVE) // we don't care about warnings, just errors
|
||||||
|
);
|
||||||
|
Response response = assertOK(client().performRequest(getStar));
|
||||||
|
|
||||||
|
if (additionalIndexNames != null && additionalIndexNames.isEmpty() == false) {
|
||||||
|
indexNames = new ArrayList<>(indexNames); // recopy into a mutable list
|
||||||
|
indexNames.addAll(additionalIndexNames);
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, Object> map = responseAsMap(response);
|
||||||
|
assertThat(map.keySet(), is(new HashSet<>(indexNames)));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testGetDatastreams() throws IOException {
|
||||||
|
Request getStar = new Request("GET", "_data_stream");
|
||||||
|
getStar.setOptions(
|
||||||
|
RequestOptions.DEFAULT.toBuilder().setWarningsHandler(WarningsHandler.PERMISSIVE) // we don't care about warnings, just errors
|
||||||
|
);
|
||||||
|
Response response = client().performRequest(getStar);
|
||||||
|
assertOK(response);
|
||||||
|
|
||||||
|
// note: we don't actually care about the response, just that there was one and that it didn't error out on us
|
||||||
|
}
|
||||||
|
}
|
|
@ -45,7 +45,7 @@ public final class IngestGeoIpMetadata implements Metadata.ProjectCustom {
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
private static final ConstructingObjectParser<IngestGeoIpMetadata, Void> PARSER = new ConstructingObjectParser<>(
|
private static final ConstructingObjectParser<IngestGeoIpMetadata, Void> PARSER = new ConstructingObjectParser<>(
|
||||||
"ingest_geoip_metadata",
|
TYPE,
|
||||||
a -> new IngestGeoIpMetadata(
|
a -> new IngestGeoIpMetadata(
|
||||||
((List<DatabaseConfigurationMetadata>) a[0]).stream().collect(Collectors.toMap((m) -> m.database().id(), Function.identity()))
|
((List<DatabaseConfigurationMetadata>) a[0]).stream().collect(Collectors.toMap((m) -> m.database().id(), Function.identity()))
|
||||||
)
|
)
|
||||||
|
|
|
@ -214,6 +214,11 @@ public class IngestGeoIpPlugin extends Plugin
|
||||||
@Override
|
@Override
|
||||||
public List<NamedXContentRegistry.Entry> getNamedXContent() {
|
public List<NamedXContentRegistry.Entry> getNamedXContent() {
|
||||||
return List.of(
|
return List.of(
|
||||||
|
new NamedXContentRegistry.Entry(
|
||||||
|
Metadata.ProjectCustom.class,
|
||||||
|
new ParseField(IngestGeoIpMetadata.TYPE),
|
||||||
|
IngestGeoIpMetadata::fromXContent
|
||||||
|
),
|
||||||
new NamedXContentRegistry.Entry(PersistentTaskParams.class, new ParseField(GEOIP_DOWNLOADER), GeoIpTaskParams::fromXContent),
|
new NamedXContentRegistry.Entry(PersistentTaskParams.class, new ParseField(GEOIP_DOWNLOADER), GeoIpTaskParams::fromXContent),
|
||||||
new NamedXContentRegistry.Entry(PersistentTaskState.class, new ParseField(GEOIP_DOWNLOADER), GeoIpTaskState::fromXContent),
|
new NamedXContentRegistry.Entry(PersistentTaskState.class, new ParseField(GEOIP_DOWNLOADER), GeoIpTaskState::fromXContent),
|
||||||
new NamedXContentRegistry.Entry(
|
new NamedXContentRegistry.Entry(
|
||||||
|
|
|
@ -21,7 +21,6 @@ import org.elasticsearch.cluster.ClusterStateTaskListener;
|
||||||
import org.elasticsearch.cluster.SimpleBatchedExecutor;
|
import org.elasticsearch.cluster.SimpleBatchedExecutor;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.Metadata;
|
import org.elasticsearch.cluster.metadata.Metadata;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.cluster.service.MasterServiceTaskQueue;
|
import org.elasticsearch.cluster.service.MasterServiceTaskQueue;
|
||||||
|
@ -63,8 +62,7 @@ public class TransportDeleteDatabaseConfigurationAction extends TransportMasterN
|
||||||
TransportService transportService,
|
TransportService transportService,
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
DeleteDatabaseConfigurationAction.NAME,
|
DeleteDatabaseConfigurationAction.NAME,
|
||||||
|
|
|
@ -20,7 +20,6 @@ import org.elasticsearch.cluster.ClusterStateTaskListener;
|
||||||
import org.elasticsearch.cluster.SimpleBatchedExecutor;
|
import org.elasticsearch.cluster.SimpleBatchedExecutor;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.Metadata;
|
import org.elasticsearch.cluster.metadata.Metadata;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.cluster.service.MasterServiceTaskQueue;
|
import org.elasticsearch.cluster.service.MasterServiceTaskQueue;
|
||||||
|
@ -65,8 +64,7 @@ public class TransportPutDatabaseConfigurationAction extends TransportMasterNode
|
||||||
TransportService transportService,
|
TransportService transportService,
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
PutDatabaseConfigurationAction.NAME,
|
PutDatabaseConfigurationAction.NAME,
|
||||||
|
|
|
@ -214,3 +214,62 @@
|
||||||
index.mode: lookup
|
index.mode: lookup
|
||||||
index.number_of_shards: 2
|
index.number_of_shards: 2
|
||||||
|
|
||||||
|
---
|
||||||
|
"Create index with invalid field type":
|
||||||
|
- requires:
|
||||||
|
cluster_features: [ "mapper.unknown_field_mapping_update_error_message" ]
|
||||||
|
reason: "Update error message for unknown field type"
|
||||||
|
|
||||||
|
- do:
|
||||||
|
catch: bad_request
|
||||||
|
indices.create:
|
||||||
|
index: test_index
|
||||||
|
body:
|
||||||
|
mappings:
|
||||||
|
properties:
|
||||||
|
content:
|
||||||
|
type: invalid
|
||||||
|
|
||||||
|
- match: { error.type: "mapper_parsing_exception" }
|
||||||
|
- match: { error.reason: "Failed to parse mapping: The mapper type [invalid] declared on field [content] does not exist. It might have been created within a future version or requires a plugin to be installed. Check the documentation." }
|
||||||
|
|
||||||
|
---
|
||||||
|
"Create index with invalid runtime field type":
|
||||||
|
- requires:
|
||||||
|
cluster_features: [ "mapper.unknown_field_mapping_update_error_message" ]
|
||||||
|
reason: "Update error message for unknown field type"
|
||||||
|
|
||||||
|
- do:
|
||||||
|
catch: bad_request
|
||||||
|
indices.create:
|
||||||
|
index: test_index
|
||||||
|
body:
|
||||||
|
mappings:
|
||||||
|
runtime:
|
||||||
|
content:
|
||||||
|
type: invalid
|
||||||
|
|
||||||
|
- match: { error.type: "mapper_parsing_exception" }
|
||||||
|
- match: { error.reason: "Failed to parse mapping: The mapper type [invalid] declared on runtime field [content] does not exist. It might have been created within a future version or requires a plugin to be installed. Check the documentation." }
|
||||||
|
|
||||||
|
---
|
||||||
|
"Create index with invalid multi-field type":
|
||||||
|
- requires:
|
||||||
|
cluster_features: [ "mapper.unknown_field_mapping_update_error_message" ]
|
||||||
|
reason: "Update error message for unknown field type"
|
||||||
|
|
||||||
|
- do:
|
||||||
|
catch: bad_request
|
||||||
|
indices.create:
|
||||||
|
index: test_index
|
||||||
|
body:
|
||||||
|
mappings:
|
||||||
|
properties:
|
||||||
|
city:
|
||||||
|
type: text
|
||||||
|
fields:
|
||||||
|
raw:
|
||||||
|
type: invalid
|
||||||
|
|
||||||
|
- match: { error.type: "mapper_parsing_exception" }
|
||||||
|
- match: { error.reason: "Failed to parse mapping: The mapper type [invalid] declared on field [raw] does not exist. It might have been created within a future version or requires a plugin to be installed. Check the documentation." }
|
||||||
|
|
|
@ -20,7 +20,6 @@ import org.elasticsearch.cluster.ClusterInfoService;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.ProjectId;
|
import org.elasticsearch.cluster.metadata.ProjectId;
|
||||||
import org.elasticsearch.cluster.metadata.ProjectMetadata;
|
import org.elasticsearch.cluster.metadata.ProjectMetadata;
|
||||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||||
|
@ -67,7 +66,6 @@ public class TransportClusterAllocationExplainAction extends TransportMasterNode
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
ClusterInfoService clusterInfoService,
|
ClusterInfoService clusterInfoService,
|
||||||
SnapshotsInfoService snapshotsInfoService,
|
SnapshotsInfoService snapshotsInfoService,
|
||||||
AllocationDeciders allocationDeciders,
|
AllocationDeciders allocationDeciders,
|
||||||
|
|
|
@ -20,7 +20,6 @@ import org.elasticsearch.cluster.ClusterStateTaskExecutor;
|
||||||
import org.elasticsearch.cluster.ClusterStateTaskListener;
|
import org.elasticsearch.cluster.ClusterStateTaskListener;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||||
import org.elasticsearch.cluster.routing.allocation.allocator.AllocationActionMultiListener;
|
import org.elasticsearch.cluster.routing.allocation.allocator.AllocationActionMultiListener;
|
||||||
import org.elasticsearch.cluster.routing.allocation.allocator.DesiredBalanceShardsAllocator;
|
import org.elasticsearch.cluster.routing.allocation.allocator.DesiredBalanceShardsAllocator;
|
||||||
|
@ -46,7 +45,6 @@ public class TransportDeleteDesiredBalanceAction extends TransportMasterNodeActi
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
AllocationService allocationService,
|
AllocationService allocationService,
|
||||||
ShardsAllocator shardsAllocator
|
ShardsAllocator shardsAllocator
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -24,7 +24,6 @@ import org.elasticsearch.action.support.master.TransportMasterNodeReadAction;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.routing.allocation.AllocationStatsService;
|
import org.elasticsearch.cluster.routing.allocation.AllocationStatsService;
|
||||||
import org.elasticsearch.cluster.routing.allocation.DiskThresholdSettings;
|
import org.elasticsearch.cluster.routing.allocation.DiskThresholdSettings;
|
||||||
import org.elasticsearch.cluster.routing.allocation.NodeAllocationStats;
|
import org.elasticsearch.cluster.routing.allocation.NodeAllocationStats;
|
||||||
|
@ -59,7 +58,6 @@ public class TransportGetAllocationStatsAction extends TransportMasterNodeReadAc
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
AllocationStatsService allocationStatsService
|
AllocationStatsService allocationStatsService
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
|
|
|
@ -18,7 +18,6 @@ import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexMetadata;
|
import org.elasticsearch.cluster.metadata.IndexMetadata;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.routing.IndexRoutingTable;
|
import org.elasticsearch.cluster.routing.IndexRoutingTable;
|
||||||
import org.elasticsearch.cluster.routing.IndexShardRoutingTable;
|
import org.elasticsearch.cluster.routing.IndexShardRoutingTable;
|
||||||
import org.elasticsearch.cluster.routing.ShardRouting;
|
import org.elasticsearch.cluster.routing.ShardRouting;
|
||||||
|
@ -56,7 +55,6 @@ public class TransportGetDesiredBalanceAction extends TransportMasterNodeReadAct
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
ShardsAllocator shardsAllocator,
|
ShardsAllocator shardsAllocator,
|
||||||
ClusterInfoService clusterInfoService,
|
ClusterInfoService clusterInfoService,
|
||||||
WriteLoadForecaster writeLoadForecaster
|
WriteLoadForecaster writeLoadForecaster
|
||||||
|
|
|
@ -26,7 +26,6 @@ import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.coordination.CoordinationMetadata;
|
import org.elasticsearch.cluster.coordination.CoordinationMetadata;
|
||||||
import org.elasticsearch.cluster.coordination.CoordinationMetadata.VotingConfigExclusion;
|
import org.elasticsearch.cluster.coordination.CoordinationMetadata.VotingConfigExclusion;
|
||||||
import org.elasticsearch.cluster.coordination.Reconfigurator;
|
import org.elasticsearch.cluster.coordination.Reconfigurator;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.Metadata;
|
import org.elasticsearch.cluster.metadata.Metadata;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.Priority;
|
import org.elasticsearch.common.Priority;
|
||||||
|
@ -72,7 +71,6 @@ public class TransportAddVotingConfigExclusionsAction extends TransportMasterNod
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
Reconfigurator reconfigurator
|
Reconfigurator reconfigurator
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
|
|
|
@ -26,7 +26,6 @@ import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.coordination.CoordinationMetadata;
|
import org.elasticsearch.cluster.coordination.CoordinationMetadata;
|
||||||
import org.elasticsearch.cluster.coordination.CoordinationMetadata.VotingConfigExclusion;
|
import org.elasticsearch.cluster.coordination.CoordinationMetadata.VotingConfigExclusion;
|
||||||
import org.elasticsearch.cluster.coordination.Reconfigurator;
|
import org.elasticsearch.cluster.coordination.Reconfigurator;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.Metadata;
|
import org.elasticsearch.cluster.metadata.Metadata;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.Priority;
|
import org.elasticsearch.common.Priority;
|
||||||
|
@ -54,7 +53,6 @@ public class TransportClearVotingConfigExclusionsAction extends TransportMasterN
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
Reconfigurator reconfigurator
|
Reconfigurator reconfigurator
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
|
|
|
@ -21,7 +21,6 @@ import org.elasticsearch.cluster.SimpleBatchedExecutor;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.DesiredNodesMetadata;
|
import org.elasticsearch.cluster.metadata.DesiredNodesMetadata;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.cluster.service.MasterServiceTaskQueue;
|
import org.elasticsearch.cluster.service.MasterServiceTaskQueue;
|
||||||
import org.elasticsearch.common.Priority;
|
import org.elasticsearch.common.Priority;
|
||||||
|
@ -46,8 +45,7 @@ public class TransportDeleteDesiredNodesAction extends TransportMasterNodeAction
|
||||||
TransportService transportService,
|
TransportService transportService,
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
TYPE.name(),
|
TYPE.name(),
|
||||||
|
|
|
@ -17,7 +17,6 @@ import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.DesiredNodes;
|
import org.elasticsearch.cluster.metadata.DesiredNodes;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||||
import org.elasticsearch.injection.guice.Inject;
|
import org.elasticsearch.injection.guice.Inject;
|
||||||
|
@ -33,8 +32,7 @@ public class TransportGetDesiredNodesAction extends TransportMasterNodeReadActio
|
||||||
TransportService transportService,
|
TransportService transportService,
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
GetDesiredNodesAction.NAME,
|
GetDesiredNodesAction.NAME,
|
||||||
|
|
|
@ -16,7 +16,6 @@ import org.elasticsearch.action.support.master.TransportMasterNodeAction;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||||
import org.elasticsearch.core.UpdateForV10;
|
import org.elasticsearch.core.UpdateForV10;
|
||||||
|
@ -67,7 +66,6 @@ public class TransportGetFeatureUpgradeStatusAction extends TransportMasterNodeA
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
SystemIndices systemIndices
|
SystemIndices systemIndices
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
|
|
|
@ -18,7 +18,6 @@ import org.elasticsearch.action.support.master.TransportMasterNodeAction;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||||
import org.elasticsearch.core.TimeValue;
|
import org.elasticsearch.core.TimeValue;
|
||||||
|
@ -53,7 +52,6 @@ public class TransportPostFeatureUpgradeAction extends TransportMasterNodeAction
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
SystemIndices systemIndices,
|
SystemIndices systemIndices,
|
||||||
PersistentTasksService persistentTasksService
|
PersistentTasksService persistentTasksService
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -19,7 +19,6 @@ import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.health.ClusterHealthStatus;
|
import org.elasticsearch.cluster.health.ClusterHealthStatus;
|
||||||
import org.elasticsearch.cluster.health.ClusterStateHealth;
|
import org.elasticsearch.cluster.health.ClusterStateHealth;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.Metadata;
|
import org.elasticsearch.cluster.metadata.Metadata;
|
||||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||||
|
@ -64,7 +63,6 @@ public class TransportPrevalidateNodeRemovalAction extends TransportMasterNodeRe
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
NodeClient client,
|
NodeClient client,
|
||||||
ProjectResolver projectResolver
|
ProjectResolver projectResolver
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -21,7 +21,6 @@ import org.elasticsearch.cluster.SnapshotDeletionsInProgress;
|
||||||
import org.elasticsearch.cluster.SnapshotsInProgress;
|
import org.elasticsearch.cluster.SnapshotsInProgress;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.blobstore.DeleteResult;
|
import org.elasticsearch.common.blobstore.DeleteResult;
|
||||||
|
@ -72,8 +71,7 @@ public final class TransportCleanupRepositoryAction extends TransportMasterNodeA
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
RepositoriesService repositoriesService,
|
RepositoriesService repositoriesService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
TYPE.name(),
|
TYPE.name(),
|
||||||
|
|
|
@ -18,7 +18,6 @@ import org.elasticsearch.action.support.master.AcknowledgedTransportMasterNodeAc
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||||
import org.elasticsearch.injection.guice.Inject;
|
import org.elasticsearch.injection.guice.Inject;
|
||||||
|
@ -44,8 +43,7 @@ public class TransportDeleteRepositoryAction extends AcknowledgedTransportMaster
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
RepositoriesService repositoriesService,
|
RepositoriesService repositoriesService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
TYPE.name(),
|
TYPE.name(),
|
||||||
|
|
|
@ -15,7 +15,6 @@ import org.elasticsearch.action.support.master.TransportMasterNodeReadAction;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.RepositoriesMetadata;
|
import org.elasticsearch.cluster.metadata.RepositoriesMetadata;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||||
|
@ -36,8 +35,7 @@ public class TransportGetRepositoriesAction extends TransportMasterNodeReadActio
|
||||||
TransportService transportService,
|
TransportService transportService,
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
GetRepositoriesAction.NAME,
|
GetRepositoriesAction.NAME,
|
||||||
|
|
|
@ -18,7 +18,6 @@ import org.elasticsearch.action.support.master.AcknowledgedTransportMasterNodeAc
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||||
import org.elasticsearch.injection.guice.Inject;
|
import org.elasticsearch.injection.guice.Inject;
|
||||||
|
@ -44,8 +43,7 @@ public class TransportPutRepositoryAction extends AcknowledgedTransportMasterNod
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
RepositoriesService repositoriesService,
|
RepositoriesService repositoriesService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
TYPE.name(),
|
TYPE.name(),
|
||||||
|
|
|
@ -15,7 +15,6 @@ import org.elasticsearch.action.support.master.TransportMasterNodeAction;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||||
|
@ -38,8 +37,7 @@ public class TransportVerifyRepositoryAction extends TransportMasterNodeAction<V
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
RepositoriesService repositoriesService,
|
RepositoriesService repositoriesService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
VerifyRepositoryAction.NAME,
|
VerifyRepositoryAction.NAME,
|
||||||
|
|
|
@ -25,7 +25,6 @@ import org.elasticsearch.cluster.ClusterStateAckListener;
|
||||||
import org.elasticsearch.cluster.ClusterStateUpdateTask;
|
import org.elasticsearch.cluster.ClusterStateUpdateTask;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.ProjectId;
|
import org.elasticsearch.cluster.metadata.ProjectId;
|
||||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||||
import org.elasticsearch.cluster.project.ProjectResolver;
|
import org.elasticsearch.cluster.project.ProjectResolver;
|
||||||
|
@ -69,7 +68,6 @@ public class TransportClusterRerouteAction extends TransportMasterNodeAction<Clu
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
AllocationService allocationService,
|
AllocationService allocationService,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
ProjectResolver projectResolver
|
ProjectResolver projectResolver
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
|
|
|
@ -21,7 +21,6 @@ import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.ClusterStateUpdateTask;
|
import org.elasticsearch.cluster.ClusterStateUpdateTask;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.Metadata;
|
import org.elasticsearch.cluster.metadata.Metadata;
|
||||||
import org.elasticsearch.cluster.routing.RerouteService;
|
import org.elasticsearch.cluster.routing.RerouteService;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
|
@ -60,7 +59,6 @@ public class TransportClusterUpdateSettingsAction extends TransportMasterNodeAct
|
||||||
RerouteService rerouteService,
|
RerouteService rerouteService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
ClusterSettings clusterSettings
|
ClusterSettings clusterSettings
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
|
|
|
@ -17,7 +17,6 @@ import org.elasticsearch.action.support.master.AcknowledgedTransportMasterNodeAc
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||||
import org.elasticsearch.injection.guice.Inject;
|
import org.elasticsearch.injection.guice.Inject;
|
||||||
|
@ -40,8 +39,7 @@ public final class TransportCloneSnapshotAction extends AcknowledgedTransportMas
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
SnapshotsService snapshotsService,
|
SnapshotsService snapshotsService,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
TYPE.name(),
|
TYPE.name(),
|
||||||
|
|
|
@ -16,7 +16,6 @@ import org.elasticsearch.action.support.master.TransportMasterNodeAction;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||||
import org.elasticsearch.injection.guice.Inject;
|
import org.elasticsearch.injection.guice.Inject;
|
||||||
|
@ -39,8 +38,7 @@ public class TransportCreateSnapshotAction extends TransportMasterNodeAction<Cre
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
SnapshotsService snapshotsService,
|
SnapshotsService snapshotsService,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
TYPE.name(),
|
TYPE.name(),
|
||||||
|
|
|
@ -18,7 +18,6 @@ import org.elasticsearch.action.support.master.AcknowledgedTransportMasterNodeAc
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||||
import org.elasticsearch.injection.guice.Inject;
|
import org.elasticsearch.injection.guice.Inject;
|
||||||
|
@ -40,8 +39,7 @@ public class TransportDeleteSnapshotAction extends AcknowledgedTransportMasterNo
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
SnapshotsService snapshotsService,
|
SnapshotsService snapshotsService,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
TYPE.name(),
|
TYPE.name(),
|
||||||
|
|
|
@ -15,7 +15,6 @@ import org.elasticsearch.action.support.master.TransportMasterNodeAction;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||||
import org.elasticsearch.indices.SystemIndices;
|
import org.elasticsearch.indices.SystemIndices;
|
||||||
|
@ -36,7 +35,6 @@ public class TransportSnapshottableFeaturesAction extends TransportMasterNodeAct
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
SystemIndices systemIndices
|
SystemIndices systemIndices
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
|
|
|
@ -19,7 +19,6 @@ import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.SnapshotsInProgress;
|
import org.elasticsearch.cluster.SnapshotsInProgress;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.RepositoryMetadata;
|
import org.elasticsearch.cluster.metadata.RepositoryMetadata;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.Strings;
|
import org.elasticsearch.common.Strings;
|
||||||
|
@ -113,8 +112,7 @@ public class TransportGetSnapshotsAction extends TransportMasterNodeAction<GetSn
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
RepositoriesService repositoriesService,
|
RepositoriesService repositoriesService,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
TYPE.name(),
|
TYPE.name(),
|
||||||
|
|
|
@ -16,7 +16,6 @@ import org.elasticsearch.action.support.master.TransportMasterNodeAction;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.RepositoriesMetadata;
|
import org.elasticsearch.cluster.metadata.RepositoriesMetadata;
|
||||||
import org.elasticsearch.cluster.metadata.RepositoryMetadata;
|
import org.elasticsearch.cluster.metadata.RepositoryMetadata;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
|
@ -50,8 +49,7 @@ public class TransportGetShardSnapshotAction extends TransportMasterNodeAction<G
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
RepositoriesService repositoriesService,
|
RepositoriesService repositoriesService,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
TYPE.name(),
|
TYPE.name(),
|
||||||
|
|
|
@ -16,7 +16,6 @@ import org.elasticsearch.action.support.master.TransportMasterNodeAction;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.injection.guice.Inject;
|
import org.elasticsearch.injection.guice.Inject;
|
||||||
import org.elasticsearch.snapshots.RestoreService;
|
import org.elasticsearch.snapshots.RestoreService;
|
||||||
|
@ -37,8 +36,7 @@ public class TransportRestoreSnapshotAction extends TransportMasterNodeAction<Re
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
RestoreService restoreService,
|
RestoreService restoreService,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
TYPE.name(),
|
TYPE.name(),
|
||||||
|
|
|
@ -22,7 +22,6 @@ import org.elasticsearch.cluster.SnapshotsInProgress;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexMetadata;
|
import org.elasticsearch.cluster.metadata.IndexMetadata;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.Strings;
|
import org.elasticsearch.common.Strings;
|
||||||
import org.elasticsearch.common.util.CollectionUtils;
|
import org.elasticsearch.common.util.CollectionUtils;
|
||||||
|
@ -81,8 +80,7 @@ public class TransportSnapshotsStatusAction extends TransportMasterNodeAction<Sn
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
RepositoriesService repositoriesService,
|
RepositoriesService repositoriesService,
|
||||||
NodeClient client,
|
NodeClient client,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
TYPE.name(),
|
TYPE.name(),
|
||||||
|
|
|
@ -17,7 +17,6 @@ import org.elasticsearch.action.support.master.AcknowledgedTransportMasterNodeAc
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||||
import org.elasticsearch.injection.guice.Inject;
|
import org.elasticsearch.injection.guice.Inject;
|
||||||
|
@ -35,8 +34,7 @@ public class TransportDeleteStoredScriptAction extends AcknowledgedTransportMast
|
||||||
TransportService transportService,
|
TransportService transportService,
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
TYPE.name(),
|
TYPE.name(),
|
||||||
|
|
|
@ -15,7 +15,6 @@ import org.elasticsearch.action.support.master.TransportMasterNodeReadAction;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||||
import org.elasticsearch.injection.guice.Inject;
|
import org.elasticsearch.injection.guice.Inject;
|
||||||
|
@ -31,8 +30,7 @@ public class TransportGetStoredScriptAction extends TransportMasterNodeReadActio
|
||||||
TransportService transportService,
|
TransportService transportService,
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
GetStoredScriptAction.NAME,
|
GetStoredScriptAction.NAME,
|
||||||
|
|
|
@ -17,7 +17,6 @@ import org.elasticsearch.action.support.master.AcknowledgedTransportMasterNodeAc
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||||
import org.elasticsearch.injection.guice.Inject;
|
import org.elasticsearch.injection.guice.Inject;
|
||||||
|
@ -37,7 +36,6 @@ public class TransportPutStoredScriptAction extends AcknowledgedTransportMasterN
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
ScriptService scriptService
|
ScriptService scriptService
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
|
|
|
@ -17,7 +17,6 @@ import org.elasticsearch.action.support.ActionFilters;
|
||||||
import org.elasticsearch.action.support.master.TransportMasterNodeReadAction;
|
import org.elasticsearch.action.support.master.TransportMasterNodeReadAction;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.cluster.service.PendingClusterTask;
|
import org.elasticsearch.cluster.service.PendingClusterTask;
|
||||||
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||||
|
@ -40,8 +39,7 @@ public class TransportPendingClusterTasksAction extends TransportMasterNodeReadA
|
||||||
TransportService transportService,
|
TransportService transportService,
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
TYPE.name(),
|
TYPE.name(),
|
||||||
|
|
|
@ -92,7 +92,6 @@ public final class AutoCreateAction extends ActionType<CreateIndexResponse> {
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
MetadataCreateIndexService createIndexService,
|
MetadataCreateIndexService createIndexService,
|
||||||
MetadataCreateDataStreamService metadataCreateDataStreamService,
|
MetadataCreateDataStreamService metadataCreateDataStreamService,
|
||||||
AutoCreateIndex autoCreateIndex,
|
AutoCreateIndex autoCreateIndex,
|
||||||
|
|
|
@ -29,7 +29,6 @@ import org.elasticsearch.cluster.ClusterStateUpdateTask;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.metadata.IndexGraveyard;
|
import org.elasticsearch.cluster.metadata.IndexGraveyard;
|
||||||
import org.elasticsearch.cluster.metadata.IndexMetadata;
|
import org.elasticsearch.cluster.metadata.IndexMetadata;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.Metadata;
|
import org.elasticsearch.cluster.metadata.Metadata;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
|
@ -62,7 +61,6 @@ public class TransportDeleteDanglingIndexAction extends AcknowledgedTransportMas
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
Settings settings,
|
Settings settings,
|
||||||
NodeClient nodeClient
|
NodeClient nodeClient
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -59,21 +59,10 @@ public class TransportResizeAction extends TransportMasterNodeAction<ResizeReque
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
MetadataCreateIndexService createIndexService,
|
MetadataCreateIndexService createIndexService,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
ProjectResolver projectResolver,
|
ProjectResolver projectResolver,
|
||||||
Client client
|
Client client
|
||||||
) {
|
) {
|
||||||
this(
|
this(ResizeAction.NAME, transportService, clusterService, threadPool, createIndexService, actionFilters, projectResolver, client);
|
||||||
ResizeAction.NAME,
|
|
||||||
transportService,
|
|
||||||
clusterService,
|
|
||||||
threadPool,
|
|
||||||
createIndexService,
|
|
||||||
actionFilters,
|
|
||||||
indexNameExpressionResolver,
|
|
||||||
projectResolver,
|
|
||||||
client
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected TransportResizeAction(
|
protected TransportResizeAction(
|
||||||
|
@ -83,7 +72,6 @@ public class TransportResizeAction extends TransportMasterNodeAction<ResizeReque
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
MetadataCreateIndexService createIndexService,
|
MetadataCreateIndexService createIndexService,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
ProjectResolver projectResolver,
|
ProjectResolver projectResolver,
|
||||||
Client client
|
Client client
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -20,7 +20,6 @@ import org.elasticsearch.action.support.master.MasterNodeRequest;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.MetadataIndexTemplateService;
|
import org.elasticsearch.cluster.metadata.MetadataIndexTemplateService;
|
||||||
import org.elasticsearch.cluster.project.ProjectResolver;
|
import org.elasticsearch.cluster.project.ProjectResolver;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
|
@ -57,7 +56,6 @@ public class TransportDeleteComponentTemplateAction extends AcknowledgedTranspor
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
MetadataIndexTemplateService indexTemplateService,
|
MetadataIndexTemplateService indexTemplateService,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
ProjectResolver projectResolver
|
ProjectResolver projectResolver
|
||||||
) {
|
) {
|
||||||
super(TYPE.name(), transportService, clusterService, threadPool, actionFilters, Request::new, EsExecutors.DIRECT_EXECUTOR_SERVICE);
|
super(TYPE.name(), transportService, clusterService, threadPool, actionFilters, Request::new, EsExecutors.DIRECT_EXECUTOR_SERVICE);
|
||||||
|
|
|
@ -20,7 +20,6 @@ import org.elasticsearch.action.support.master.MasterNodeRequest;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.MetadataIndexTemplateService;
|
import org.elasticsearch.cluster.metadata.MetadataIndexTemplateService;
|
||||||
import org.elasticsearch.cluster.project.ProjectResolver;
|
import org.elasticsearch.cluster.project.ProjectResolver;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
|
@ -56,7 +55,6 @@ public class TransportDeleteComposableIndexTemplateAction extends AcknowledgedTr
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
MetadataIndexTemplateService indexTemplateService,
|
MetadataIndexTemplateService indexTemplateService,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
ProjectResolver projectResolver
|
ProjectResolver projectResolver
|
||||||
) {
|
) {
|
||||||
super(TYPE.name(), transportService, clusterService, threadPool, actionFilters, Request::new, EsExecutors.DIRECT_EXECUTOR_SERVICE);
|
super(TYPE.name(), transportService, clusterService, threadPool, actionFilters, Request::new, EsExecutors.DIRECT_EXECUTOR_SERVICE);
|
||||||
|
|
|
@ -18,7 +18,6 @@ import org.elasticsearch.action.support.master.AcknowledgedTransportMasterNodeAc
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.MetadataIndexTemplateService;
|
import org.elasticsearch.cluster.metadata.MetadataIndexTemplateService;
|
||||||
import org.elasticsearch.cluster.project.ProjectResolver;
|
import org.elasticsearch.cluster.project.ProjectResolver;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
|
@ -46,8 +45,7 @@ public class TransportDeleteIndexTemplateAction extends AcknowledgedTransportMas
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
MetadataIndexTemplateService indexTemplateService,
|
MetadataIndexTemplateService indexTemplateService,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
ProjectResolver projectResolver,
|
ProjectResolver projectResolver
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
TYPE.name(),
|
TYPE.name(),
|
||||||
|
|
|
@ -19,7 +19,6 @@ import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.ComponentTemplate;
|
import org.elasticsearch.cluster.metadata.ComponentTemplate;
|
||||||
import org.elasticsearch.cluster.metadata.IndexMetadata;
|
import org.elasticsearch.cluster.metadata.IndexMetadata;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.MetadataIndexTemplateService;
|
import org.elasticsearch.cluster.metadata.MetadataIndexTemplateService;
|
||||||
import org.elasticsearch.cluster.metadata.Template;
|
import org.elasticsearch.cluster.metadata.Template;
|
||||||
import org.elasticsearch.cluster.project.ProjectResolver;
|
import org.elasticsearch.cluster.project.ProjectResolver;
|
||||||
|
@ -49,7 +48,6 @@ public class TransportPutComponentTemplateAction extends AcknowledgedTransportMa
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
MetadataIndexTemplateService indexTemplateService,
|
MetadataIndexTemplateService indexTemplateService,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
IndexScopedSettings indexScopedSettings,
|
IndexScopedSettings indexScopedSettings,
|
||||||
ProjectResolver projectResolver
|
ProjectResolver projectResolver
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -24,7 +24,6 @@ import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.ComposableIndexTemplate;
|
import org.elasticsearch.cluster.metadata.ComposableIndexTemplate;
|
||||||
import org.elasticsearch.cluster.metadata.IndexMetadata;
|
import org.elasticsearch.cluster.metadata.IndexMetadata;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.MetadataIndexTemplateService;
|
import org.elasticsearch.cluster.metadata.MetadataIndexTemplateService;
|
||||||
import org.elasticsearch.cluster.metadata.ProjectId;
|
import org.elasticsearch.cluster.metadata.ProjectId;
|
||||||
import org.elasticsearch.cluster.metadata.ReservedStateMetadata;
|
import org.elasticsearch.cluster.metadata.ReservedStateMetadata;
|
||||||
|
@ -67,7 +66,6 @@ public class TransportPutComposableIndexTemplateAction extends AcknowledgedTrans
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
MetadataIndexTemplateService indexTemplateService,
|
MetadataIndexTemplateService indexTemplateService,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
ProjectResolver projectResolver
|
ProjectResolver projectResolver
|
||||||
) {
|
) {
|
||||||
super(TYPE.name(), transportService, clusterService, threadPool, actionFilters, Request::new, EsExecutors.DIRECT_EXECUTOR_SERVICE);
|
super(TYPE.name(), transportService, clusterService, threadPool, actionFilters, Request::new, EsExecutors.DIRECT_EXECUTOR_SERVICE);
|
||||||
|
|
|
@ -19,7 +19,6 @@ import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexMetadata;
|
import org.elasticsearch.cluster.metadata.IndexMetadata;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.MetadataIndexTemplateService;
|
import org.elasticsearch.cluster.metadata.MetadataIndexTemplateService;
|
||||||
import org.elasticsearch.cluster.project.ProjectResolver;
|
import org.elasticsearch.cluster.project.ProjectResolver;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
|
@ -54,7 +53,6 @@ public class TransportPutIndexTemplateAction extends AcknowledgedTransportMaster
|
||||||
MetadataIndexTemplateService indexTemplateService,
|
MetadataIndexTemplateService indexTemplateService,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
ProjectResolver projectResolver,
|
ProjectResolver projectResolver,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
IndexScopedSettings indexScopedSettings
|
IndexScopedSettings indexScopedSettings
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
|
|
|
@ -17,7 +17,6 @@ import org.elasticsearch.action.support.master.AcknowledgedTransportMasterNodeAc
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.project.ProjectResolver;
|
import org.elasticsearch.cluster.project.ProjectResolver;
|
||||||
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||||
import org.elasticsearch.ingest.IngestService;
|
import org.elasticsearch.ingest.IngestService;
|
||||||
|
@ -41,8 +40,7 @@ public class DeletePipelineTransportAction extends AcknowledgedTransportMasterNo
|
||||||
IngestService ingestService,
|
IngestService ingestService,
|
||||||
TransportService transportService,
|
TransportService transportService,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
ProjectResolver projectResolver,
|
ProjectResolver projectResolver
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
TYPE.name(),
|
TYPE.name(),
|
||||||
|
|
|
@ -247,8 +247,8 @@ class Elasticsearch {
|
||||||
pluginsResolver::resolveClassToPluginName,
|
pluginsResolver::resolveClassToPluginName,
|
||||||
nodeEnv.settings()::get,
|
nodeEnv.settings()::get,
|
||||||
nodeEnv.settings()::getGlobValues,
|
nodeEnv.settings()::getGlobValues,
|
||||||
nodeEnv::resolveRepoDir,
|
|
||||||
nodeEnv.dataDirs(),
|
nodeEnv.dataDirs(),
|
||||||
|
nodeEnv.repoDirs(),
|
||||||
nodeEnv.configDir(),
|
nodeEnv.configDir(),
|
||||||
nodeEnv.libDir(),
|
nodeEnv.libDir(),
|
||||||
nodeEnv.logsDir(),
|
nodeEnv.logsDir(),
|
||||||
|
|
|
@ -335,7 +335,7 @@ public class Environment {
|
||||||
*/
|
*/
|
||||||
public static void assertEquivalent(Environment actual, Environment expected) {
|
public static void assertEquivalent(Environment actual, Environment expected) {
|
||||||
assertEquals(actual.dataDirs(), expected.dataDirs(), "dataDirs");
|
assertEquals(actual.dataDirs(), expected.dataDirs(), "dataDirs");
|
||||||
assertEquals(actual.repoDirs(), expected.repoDirs(), "repoDirs");
|
assertEquals(actual.repoDirs(), expected.repoDirs(), "sharedRepoDirs");
|
||||||
assertEquals(actual.configDir(), expected.configDir(), "configDir");
|
assertEquals(actual.configDir(), expected.configDir(), "configDir");
|
||||||
assertEquals(actual.pluginsDir(), expected.pluginsDir(), "pluginsDir");
|
assertEquals(actual.pluginsDir(), expected.pluginsDir(), "pluginsDir");
|
||||||
assertEquals(actual.binDir(), expected.binDir(), "binDir");
|
assertEquals(actual.binDir(), expected.binDir(), "binDir");
|
||||||
|
|
|
@ -33,6 +33,9 @@ public class MapperFeatures implements FeatureSpecification {
|
||||||
public static final NodeFeature SORT_FIELDS_CHECK_FOR_NESTED_OBJECT_FIX = new NodeFeature("mapper.nested.sorting_fields_check_fix");
|
public static final NodeFeature SORT_FIELDS_CHECK_FOR_NESTED_OBJECT_FIX = new NodeFeature("mapper.nested.sorting_fields_check_fix");
|
||||||
public static final NodeFeature DYNAMIC_HANDLING_IN_COPY_TO = new NodeFeature("mapper.copy_to.dynamic_handling");
|
public static final NodeFeature DYNAMIC_HANDLING_IN_COPY_TO = new NodeFeature("mapper.copy_to.dynamic_handling");
|
||||||
public static final NodeFeature DOC_VALUES_SKIPPER = new NodeFeature("mapper.doc_values_skipper");
|
public static final NodeFeature DOC_VALUES_SKIPPER = new NodeFeature("mapper.doc_values_skipper");
|
||||||
|
static final NodeFeature UKNOWN_FIELD_MAPPING_UPDATE_ERROR_MESSAGE = new NodeFeature(
|
||||||
|
"mapper.unknown_field_mapping_update_error_message"
|
||||||
|
);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<NodeFeature> getTestFeatures() {
|
public Set<NodeFeature> getTestFeatures() {
|
||||||
|
@ -54,6 +57,7 @@ public class MapperFeatures implements FeatureSpecification {
|
||||||
TSDB_NESTED_FIELD_SUPPORT,
|
TSDB_NESTED_FIELD_SUPPORT,
|
||||||
SourceFieldMapper.SYNTHETIC_RECOVERY_SOURCE,
|
SourceFieldMapper.SYNTHETIC_RECOVERY_SOURCE,
|
||||||
ObjectMapper.SUBOBJECTS_FALSE_MAPPING_UPDATE_FIX,
|
ObjectMapper.SUBOBJECTS_FALSE_MAPPING_UPDATE_FIX,
|
||||||
|
UKNOWN_FIELD_MAPPING_UPDATE_ERROR_MESSAGE,
|
||||||
DOC_VALUES_SKIPPER
|
DOC_VALUES_SKIPPER
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -396,7 +396,15 @@ public class ObjectMapper extends Mapper {
|
||||||
}
|
}
|
||||||
Mapper.TypeParser typeParser = parserContext.typeParser(type);
|
Mapper.TypeParser typeParser = parserContext.typeParser(type);
|
||||||
if (typeParser == null) {
|
if (typeParser == null) {
|
||||||
throw new MapperParsingException("No handler for type [" + type + "] declared on field [" + fieldName + "]");
|
throw new MapperParsingException(
|
||||||
|
"The mapper type ["
|
||||||
|
+ type
|
||||||
|
+ "] declared on field ["
|
||||||
|
+ fieldName
|
||||||
|
+ "] does not exist."
|
||||||
|
+ " It might have been created within a future version or requires a plugin to be installed."
|
||||||
|
+ " Check the documentation."
|
||||||
|
);
|
||||||
}
|
}
|
||||||
Mapper.Builder fieldBuilder;
|
Mapper.Builder fieldBuilder;
|
||||||
if (objBuilder.subobjects.isPresent() && objBuilder.subobjects.get() != Subobjects.ENABLED) {
|
if (objBuilder.subobjects.isPresent() && objBuilder.subobjects.get() != Subobjects.ENABLED) {
|
||||||
|
|
|
@ -179,7 +179,15 @@ public interface RuntimeField extends ToXContentFragment {
|
||||||
}
|
}
|
||||||
Parser typeParser = parserContext.runtimeFieldParser(type);
|
Parser typeParser = parserContext.runtimeFieldParser(type);
|
||||||
if (typeParser == null) {
|
if (typeParser == null) {
|
||||||
throw new MapperParsingException("No handler for type [" + type + "] declared on runtime field [" + fieldName + "]");
|
throw new MapperParsingException(
|
||||||
|
"The mapper type ["
|
||||||
|
+ type
|
||||||
|
+ "] declared on runtime field ["
|
||||||
|
+ fieldName
|
||||||
|
+ "] does not exist."
|
||||||
|
+ " It might have been created within a future version or requires a plugin to be installed."
|
||||||
|
+ " Check the documentation."
|
||||||
|
);
|
||||||
}
|
}
|
||||||
runtimeFields.put(fieldName, builder.apply(typeParser.parse(fieldName, propNode, parserContext)));
|
runtimeFields.put(fieldName, builder.apply(typeParser.parse(fieldName, propNode, parserContext)));
|
||||||
propNode.remove("type");
|
propNode.remove("type");
|
||||||
|
|
|
@ -161,7 +161,15 @@ public class TypeParsers {
|
||||||
|
|
||||||
Mapper.TypeParser typeParser = parserContext.typeParser(type);
|
Mapper.TypeParser typeParser = parserContext.typeParser(type);
|
||||||
if (typeParser == null) {
|
if (typeParser == null) {
|
||||||
throw new MapperParsingException("no handler for type [" + type + "] declared on field [" + multiFieldName + "]");
|
throw new MapperParsingException(
|
||||||
|
"The mapper type ["
|
||||||
|
+ type
|
||||||
|
+ "] declared on field ["
|
||||||
|
+ multiFieldName
|
||||||
|
+ "] does not exist."
|
||||||
|
+ " It might have been created within a future version or requires a plugin to be installed."
|
||||||
|
+ " Check the documentation."
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (typeParser instanceof FieldMapper.TypeParser == false) {
|
if (typeParser instanceof FieldMapper.TypeParser == false) {
|
||||||
throw new MapperParsingException("Type [" + type + "] cannot be used in multi field");
|
throw new MapperParsingException("Type [" + type + "] cannot be used in multi field");
|
||||||
|
|
|
@ -17,7 +17,6 @@ import org.elasticsearch.action.support.master.TransportMasterNodeAction;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
|
@ -116,8 +115,7 @@ public class CompletionPersistentTaskAction {
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
PersistentTasksClusterService persistentTasksClusterService,
|
PersistentTasksClusterService persistentTasksClusterService
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
INSTANCE.name(),
|
INSTANCE.name(),
|
||||||
|
|
|
@ -17,7 +17,6 @@ import org.elasticsearch.action.support.master.TransportMasterNodeAction;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
|
@ -85,8 +84,7 @@ public class RemovePersistentTaskAction {
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
PersistentTasksClusterService persistentTasksClusterService,
|
PersistentTasksClusterService persistentTasksClusterService
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
INSTANCE.name(),
|
INSTANCE.name(),
|
||||||
|
|
|
@ -17,7 +17,6 @@ import org.elasticsearch.action.support.master.TransportMasterNodeAction;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
|
@ -128,8 +127,7 @@ public class StartPersistentTaskAction {
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
PersistentTasksClusterService persistentTasksClusterService,
|
PersistentTasksClusterService persistentTasksClusterService,
|
||||||
PersistentTasksExecutorRegistry persistentTasksExecutorRegistry,
|
PersistentTasksExecutorRegistry persistentTasksExecutorRegistry,
|
||||||
PersistentTasksService persistentTasksService,
|
PersistentTasksService persistentTasksService
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
INSTANCE.name(),
|
INSTANCE.name(),
|
||||||
|
|
|
@ -17,7 +17,6 @@ import org.elasticsearch.action.support.master.TransportMasterNodeAction;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
|
@ -115,8 +114,7 @@ public class UpdatePersistentTaskStatusAction {
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
PersistentTasksClusterService persistentTasksClusterService,
|
PersistentTasksClusterService persistentTasksClusterService
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
INSTANCE.name(),
|
INSTANCE.name(),
|
||||||
|
|
|
@ -231,13 +231,7 @@ public final class SnapshotsService extends AbstractLifecycleComponent implement
|
||||||
this.transportService = transportService;
|
this.transportService = transportService;
|
||||||
|
|
||||||
// The constructor of UpdateSnapshotStatusAction will register itself to the TransportService.
|
// The constructor of UpdateSnapshotStatusAction will register itself to the TransportService.
|
||||||
this.updateSnapshotStatusHandler = new UpdateSnapshotStatusAction(
|
this.updateSnapshotStatusHandler = new UpdateSnapshotStatusAction(transportService, clusterService, threadPool, actionFilters);
|
||||||
transportService,
|
|
||||||
clusterService,
|
|
||||||
threadPool,
|
|
||||||
actionFilters,
|
|
||||||
indexNameExpressionResolver
|
|
||||||
);
|
|
||||||
if (DiscoveryNode.isMasterNode(settings)) {
|
if (DiscoveryNode.isMasterNode(settings)) {
|
||||||
// addLowPriorityApplier to make sure that Repository will be created before snapshot
|
// addLowPriorityApplier to make sure that Repository will be created before snapshot
|
||||||
clusterService.addLowPriorityApplier(this);
|
clusterService.addLowPriorityApplier(this);
|
||||||
|
@ -3662,8 +3656,7 @@ public final class SnapshotsService extends AbstractLifecycleComponent implement
|
||||||
TransportService transportService,
|
TransportService transportService,
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
UPDATE_SNAPSHOT_STATUS_ACTION_NAME,
|
UPDATE_SNAPSHOT_STATUS_ACTION_NAME,
|
||||||
|
|
|
@ -54,7 +54,6 @@ public class TransportClusterAllocationExplainActionTests extends ESTestCase {
|
||||||
clusterService,
|
clusterService,
|
||||||
threadPool,
|
threadPool,
|
||||||
new ActionFilters(Set.of()),
|
new ActionFilters(Set.of()),
|
||||||
null,
|
|
||||||
() -> ClusterInfo.EMPTY,
|
() -> ClusterInfo.EMPTY,
|
||||||
EmptySnapshotsInfoService.INSTANCE,
|
EmptySnapshotsInfoService.INSTANCE,
|
||||||
new AllocationDeciders(List.of()),
|
new AllocationDeciders(List.of()),
|
||||||
|
|
|
@ -20,7 +20,6 @@ import org.elasticsearch.cluster.ESAllocationTestCase;
|
||||||
import org.elasticsearch.cluster.EmptyClusterInfoService;
|
import org.elasticsearch.cluster.EmptyClusterInfoService;
|
||||||
import org.elasticsearch.cluster.TestShardRoutingRoleStrategies;
|
import org.elasticsearch.cluster.TestShardRoutingRoleStrategies;
|
||||||
import org.elasticsearch.cluster.metadata.IndexMetadata;
|
import org.elasticsearch.cluster.metadata.IndexMetadata;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.Metadata;
|
import org.elasticsearch.cluster.metadata.Metadata;
|
||||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||||
import org.elasticsearch.cluster.routing.RoutingTable;
|
import org.elasticsearch.cluster.routing.RoutingTable;
|
||||||
|
@ -74,7 +73,6 @@ public class TransportDeleteDesiredBalanceActionTests extends ESAllocationTestCa
|
||||||
mock(ClusterService.class),
|
mock(ClusterService.class),
|
||||||
threadPool,
|
threadPool,
|
||||||
mock(ActionFilters.class),
|
mock(ActionFilters.class),
|
||||||
mock(IndexNameExpressionResolver.class),
|
|
||||||
mock(AllocationService.class),
|
mock(AllocationService.class),
|
||||||
mock(ShardsAllocator.class)
|
mock(ShardsAllocator.class)
|
||||||
).masterOperation(mock(Task.class), new DesiredBalanceRequest(TEST_REQUEST_TIMEOUT), ClusterState.EMPTY_STATE, listener);
|
).masterOperation(mock(Task.class), new DesiredBalanceRequest(TEST_REQUEST_TIMEOUT), ClusterState.EMPTY_STATE, listener);
|
||||||
|
@ -149,7 +147,6 @@ public class TransportDeleteDesiredBalanceActionTests extends ESAllocationTestCa
|
||||||
clusterService,
|
clusterService,
|
||||||
threadPool,
|
threadPool,
|
||||||
mock(ActionFilters.class),
|
mock(ActionFilters.class),
|
||||||
mock(IndexNameExpressionResolver.class),
|
|
||||||
allocationService,
|
allocationService,
|
||||||
allocator
|
allocator
|
||||||
);
|
);
|
||||||
|
|
|
@ -73,7 +73,6 @@ public class TransportGetAllocationStatsActionTests extends ESTestCase {
|
||||||
clusterService,
|
clusterService,
|
||||||
threadPool,
|
threadPool,
|
||||||
new ActionFilters(Set.of()),
|
new ActionFilters(Set.of()),
|
||||||
null,
|
|
||||||
allocationStatsService
|
allocationStatsService
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,6 @@ import org.elasticsearch.cluster.ClusterName;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.ESAllocationTestCase;
|
import org.elasticsearch.cluster.ESAllocationTestCase;
|
||||||
import org.elasticsearch.cluster.metadata.IndexMetadata;
|
import org.elasticsearch.cluster.metadata.IndexMetadata;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.Metadata;
|
import org.elasticsearch.cluster.metadata.Metadata;
|
||||||
import org.elasticsearch.cluster.node.DiscoveryNodeRole;
|
import org.elasticsearch.cluster.node.DiscoveryNodeRole;
|
||||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||||
|
@ -80,7 +79,6 @@ public class TransportGetDesiredBalanceActionTests extends ESAllocationTestCase
|
||||||
mock(ClusterService.class),
|
mock(ClusterService.class),
|
||||||
threadPool,
|
threadPool,
|
||||||
mock(ActionFilters.class),
|
mock(ActionFilters.class),
|
||||||
mock(IndexNameExpressionResolver.class),
|
|
||||||
desiredBalanceShardsAllocator,
|
desiredBalanceShardsAllocator,
|
||||||
clusterInfoService,
|
clusterInfoService,
|
||||||
TEST_WRITE_LOAD_FORECASTER
|
TEST_WRITE_LOAD_FORECASTER
|
||||||
|
@ -112,7 +110,6 @@ public class TransportGetDesiredBalanceActionTests extends ESAllocationTestCase
|
||||||
mock(ClusterService.class),
|
mock(ClusterService.class),
|
||||||
threadPool,
|
threadPool,
|
||||||
mock(ActionFilters.class),
|
mock(ActionFilters.class),
|
||||||
mock(IndexNameExpressionResolver.class),
|
|
||||||
mock(ShardsAllocator.class),
|
mock(ShardsAllocator.class),
|
||||||
mock(ClusterInfoService.class),
|
mock(ClusterInfoService.class),
|
||||||
mock(WriteLoadForecaster.class)
|
mock(WriteLoadForecaster.class)
|
||||||
|
|
|
@ -34,7 +34,6 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.settings.ClusterSettings;
|
import org.elasticsearch.common.settings.ClusterSettings;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.core.TimeValue;
|
import org.elasticsearch.core.TimeValue;
|
||||||
import org.elasticsearch.indices.TestIndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.test.ESTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.elasticsearch.test.transport.MockTransport;
|
import org.elasticsearch.test.transport.MockTransport;
|
||||||
import org.elasticsearch.threadpool.TestThreadPool;
|
import org.elasticsearch.threadpool.TestThreadPool;
|
||||||
|
@ -133,7 +132,6 @@ public class TransportAddVotingConfigExclusionsActionTests extends ESTestCase {
|
||||||
clusterService,
|
clusterService,
|
||||||
threadPool,
|
threadPool,
|
||||||
new ActionFilters(emptySet()),
|
new ActionFilters(emptySet()),
|
||||||
TestIndexNameExpressionResolver.newInstance(threadPool.getThreadContext()),
|
|
||||||
reconfigurator
|
reconfigurator
|
||||||
); // registers action
|
); // registers action
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,6 @@ import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.core.TimeValue;
|
import org.elasticsearch.core.TimeValue;
|
||||||
import org.elasticsearch.indices.TestIndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.test.ESTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.elasticsearch.test.transport.MockTransport;
|
import org.elasticsearch.test.transport.MockTransport;
|
||||||
import org.elasticsearch.threadpool.TestThreadPool;
|
import org.elasticsearch.threadpool.TestThreadPool;
|
||||||
|
@ -94,7 +93,6 @@ public class TransportClearVotingConfigExclusionsActionTests extends ESTestCase
|
||||||
clusterService,
|
clusterService,
|
||||||
threadPool,
|
threadPool,
|
||||||
new ActionFilters(emptySet()),
|
new ActionFilters(emptySet()),
|
||||||
TestIndexNameExpressionResolver.newInstance(threadPool.getThreadContext()),
|
|
||||||
reconfigurator
|
reconfigurator
|
||||||
); // registers action
|
); // registers action
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@ import org.elasticsearch.action.support.ActionFilters;
|
||||||
import org.elasticsearch.cluster.ClusterName;
|
import org.elasticsearch.cluster.ClusterName;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.ClusterStateUpdateTask;
|
import org.elasticsearch.cluster.ClusterStateUpdateTask;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.Metadata;
|
import org.elasticsearch.cluster.metadata.Metadata;
|
||||||
import org.elasticsearch.cluster.metadata.ProjectId;
|
import org.elasticsearch.cluster.metadata.ProjectId;
|
||||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||||
|
@ -66,7 +65,6 @@ public class TransportClusterRerouteActionTests extends ESTestCase {
|
||||||
threadPool,
|
threadPool,
|
||||||
mock(AllocationService.class),
|
mock(AllocationService.class),
|
||||||
mock(ActionFilters.class),
|
mock(ActionFilters.class),
|
||||||
mock(IndexNameExpressionResolver.class),
|
|
||||||
DefaultProjectResolver.INSTANCE
|
DefaultProjectResolver.INSTANCE
|
||||||
);
|
);
|
||||||
Mockito.clearInvocations(transportService);
|
Mockito.clearInvocations(transportService);
|
||||||
|
@ -83,7 +81,6 @@ public class TransportClusterRerouteActionTests extends ESTestCase {
|
||||||
mock(ThreadPool.class),
|
mock(ThreadPool.class),
|
||||||
mock(AllocationService.class),
|
mock(AllocationService.class),
|
||||||
mock(ActionFilters.class),
|
mock(ActionFilters.class),
|
||||||
mock(IndexNameExpressionResolver.class),
|
|
||||||
TestProjectResolvers.allProjects()
|
TestProjectResolvers.allProjects()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -105,7 +102,6 @@ public class TransportClusterRerouteActionTests extends ESTestCase {
|
||||||
mock(ThreadPool.class),
|
mock(ThreadPool.class),
|
||||||
mock(AllocationService.class),
|
mock(AllocationService.class),
|
||||||
mock(ActionFilters.class),
|
mock(ActionFilters.class),
|
||||||
mock(IndexNameExpressionResolver.class),
|
|
||||||
TestProjectResolvers.singleProject(randomProjectIdOrDefault())
|
TestProjectResolvers.singleProject(randomProjectIdOrDefault())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
package org.elasticsearch.action.admin.cluster.settings;
|
package org.elasticsearch.action.admin.cluster.settings;
|
||||||
|
|
||||||
import org.elasticsearch.action.support.ActionFilters;
|
import org.elasticsearch.action.support.ActionFilters;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.routing.RerouteService;
|
import org.elasticsearch.cluster.routing.RerouteService;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.bytes.BytesReference;
|
import org.elasticsearch.common.bytes.BytesReference;
|
||||||
|
@ -97,7 +96,6 @@ public class ClusterUpdateSettingsRequestTests extends ESTestCase {
|
||||||
mock(RerouteService.class),
|
mock(RerouteService.class),
|
||||||
threadPool,
|
threadPool,
|
||||||
mock(ActionFilters.class),
|
mock(ActionFilters.class),
|
||||||
mock(IndexNameExpressionResolver.class),
|
|
||||||
clusterSettings
|
clusterSettings
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@ import org.elasticsearch.action.support.ActionFilters;
|
||||||
import org.elasticsearch.cluster.ClusterName;
|
import org.elasticsearch.cluster.ClusterName;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.metadata.IndexMetadata;
|
import org.elasticsearch.cluster.metadata.IndexMetadata;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.Metadata;
|
import org.elasticsearch.cluster.metadata.Metadata;
|
||||||
import org.elasticsearch.cluster.metadata.MetadataCreateIndexService;
|
import org.elasticsearch.cluster.metadata.MetadataCreateIndexService;
|
||||||
import org.elasticsearch.cluster.metadata.ProjectId;
|
import org.elasticsearch.cluster.metadata.ProjectId;
|
||||||
|
@ -33,7 +32,6 @@ import org.elasticsearch.common.util.concurrent.ThreadContext;
|
||||||
import org.elasticsearch.core.TimeValue;
|
import org.elasticsearch.core.TimeValue;
|
||||||
import org.elasticsearch.indices.SystemIndexDescriptor;
|
import org.elasticsearch.indices.SystemIndexDescriptor;
|
||||||
import org.elasticsearch.indices.SystemIndices;
|
import org.elasticsearch.indices.SystemIndices;
|
||||||
import org.elasticsearch.indices.TestIndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.tasks.Task;
|
import org.elasticsearch.tasks.Task;
|
||||||
import org.elasticsearch.test.ESTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.elasticsearch.test.MockUtils;
|
import org.elasticsearch.test.MockUtils;
|
||||||
|
@ -130,10 +128,6 @@ public class TransportCreateIndexActionTests extends ESTestCase {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
threadContext = new ThreadContext(Settings.EMPTY);
|
threadContext = new ThreadContext(Settings.EMPTY);
|
||||||
final var projectResolver = TestProjectResolvers.usingRequestHeader(threadContext);
|
final var projectResolver = TestProjectResolvers.usingRequestHeader(threadContext);
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver = TestIndexNameExpressionResolver.newInstance(
|
|
||||||
SYSTEM_INDICES,
|
|
||||||
projectResolver
|
|
||||||
);
|
|
||||||
this.metadataCreateIndexService = mock(MetadataCreateIndexService.class);
|
this.metadataCreateIndexService = mock(MetadataCreateIndexService.class);
|
||||||
|
|
||||||
final ThreadPool threadPool = mock(ThreadPool.class);
|
final ThreadPool threadPool = mock(ThreadPool.class);
|
||||||
|
|
|
@ -694,7 +694,6 @@ public class ReservedComposableIndexTemplateActionTests extends ESTestCase {
|
||||||
threadPool,
|
threadPool,
|
||||||
null,
|
null,
|
||||||
mock(ActionFilters.class),
|
mock(ActionFilters.class),
|
||||||
null,
|
|
||||||
TestProjectResolvers.singleProjectOnly()
|
TestProjectResolvers.singleProjectOnly()
|
||||||
);
|
);
|
||||||
assertEquals(ReservedComposableIndexTemplateAction.NAME, putIndexAction.reservedStateHandlerName().get());
|
assertEquals(ReservedComposableIndexTemplateAction.NAME, putIndexAction.reservedStateHandlerName().get());
|
||||||
|
@ -708,7 +707,6 @@ public class ReservedComposableIndexTemplateActionTests extends ESTestCase {
|
||||||
threadPool,
|
threadPool,
|
||||||
null,
|
null,
|
||||||
mock(ActionFilters.class),
|
mock(ActionFilters.class),
|
||||||
null,
|
|
||||||
TestProjectResolvers.singleProjectOnly()
|
TestProjectResolvers.singleProjectOnly()
|
||||||
);
|
);
|
||||||
assertEquals(ReservedComposableIndexTemplateAction.NAME, delIndexAction.reservedStateHandlerName().get());
|
assertEquals(ReservedComposableIndexTemplateAction.NAME, delIndexAction.reservedStateHandlerName().get());
|
||||||
|
@ -723,7 +721,6 @@ public class ReservedComposableIndexTemplateActionTests extends ESTestCase {
|
||||||
threadPool,
|
threadPool,
|
||||||
null,
|
null,
|
||||||
mock(ActionFilters.class),
|
mock(ActionFilters.class),
|
||||||
null,
|
|
||||||
indexScopedSettings,
|
indexScopedSettings,
|
||||||
TestProjectResolvers.singleProjectOnly()
|
TestProjectResolvers.singleProjectOnly()
|
||||||
);
|
);
|
||||||
|
@ -739,7 +736,6 @@ public class ReservedComposableIndexTemplateActionTests extends ESTestCase {
|
||||||
threadPool,
|
threadPool,
|
||||||
null,
|
null,
|
||||||
mock(ActionFilters.class),
|
mock(ActionFilters.class),
|
||||||
null,
|
|
||||||
TestProjectResolvers.singleProjectOnly()
|
TestProjectResolvers.singleProjectOnly()
|
||||||
);
|
);
|
||||||
assertEquals(ReservedComposableIndexTemplateAction.NAME, delComponentAction.reservedStateHandlerName().get());
|
assertEquals(ReservedComposableIndexTemplateAction.NAME, delComponentAction.reservedStateHandlerName().get());
|
||||||
|
@ -963,7 +959,6 @@ public class ReservedComposableIndexTemplateActionTests extends ESTestCase {
|
||||||
threadPool,
|
threadPool,
|
||||||
null,
|
null,
|
||||||
mock(ActionFilters.class),
|
mock(ActionFilters.class),
|
||||||
null,
|
|
||||||
TestProjectResolvers.singleProjectOnly()
|
TestProjectResolvers.singleProjectOnly()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -313,13 +313,21 @@ public class RootObjectMapperTests extends MapperServiceTestCase {
|
||||||
public void testRuntimeSectionNonRuntimeType() throws IOException {
|
public void testRuntimeSectionNonRuntimeType() throws IOException {
|
||||||
XContentBuilder mapping = runtimeFieldMapping(builder -> builder.field("type", "unknown"));
|
XContentBuilder mapping = runtimeFieldMapping(builder -> builder.field("type", "unknown"));
|
||||||
MapperParsingException e = expectThrows(MapperParsingException.class, () -> createMapperService(mapping));
|
MapperParsingException e = expectThrows(MapperParsingException.class, () -> createMapperService(mapping));
|
||||||
assertEquals("Failed to parse mapping: No handler for type [unknown] declared on runtime field [field]", e.getMessage());
|
assertEquals(
|
||||||
|
"Failed to parse mapping: The mapper type [unknown] declared on runtime field [field] does not exist."
|
||||||
|
+ " It might have been created within a future version or requires a plugin to be installed. Check the documentation.",
|
||||||
|
e.getMessage()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testRuntimeSectionHandlerNotFound() throws IOException {
|
public void testRuntimeSectionHandlerNotFound() throws IOException {
|
||||||
XContentBuilder mapping = runtimeFieldMapping(builder -> builder.field("type", "unknown"));
|
XContentBuilder mapping = runtimeFieldMapping(builder -> builder.field("type", "unknown"));
|
||||||
MapperParsingException e = expectThrows(MapperParsingException.class, () -> createMapperService(mapping));
|
MapperParsingException e = expectThrows(MapperParsingException.class, () -> createMapperService(mapping));
|
||||||
assertEquals("Failed to parse mapping: No handler for type [unknown] declared on runtime field [field]", e.getMessage());
|
assertEquals(
|
||||||
|
"Failed to parse mapping: The mapper type [unknown] declared on runtime field [field] does not exist."
|
||||||
|
+ " It might have been created within a future version or requires a plugin to be installed. Check the documentation.",
|
||||||
|
e.getMessage()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testRuntimeSectionMissingType() throws IOException {
|
public void testRuntimeSectionMissingType() throws IOException {
|
||||||
|
|
|
@ -351,7 +351,6 @@ public class ClusterStateChanges {
|
||||||
threadPool,
|
threadPool,
|
||||||
allocationService,
|
allocationService,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
indexNameExpressionResolver,
|
|
||||||
TestProjectResolvers.DEFAULT_PROJECT_ONLY
|
TestProjectResolvers.DEFAULT_PROJECT_ONLY
|
||||||
);
|
);
|
||||||
transportCreateIndexAction = new TransportCreateIndexAction(
|
transportCreateIndexAction = new TransportCreateIndexAction(
|
||||||
|
|
|
@ -2501,14 +2501,7 @@ public class SnapshotResiliencyTests extends ESTestCase {
|
||||||
);
|
);
|
||||||
actions.put(
|
actions.put(
|
||||||
TransportRestoreSnapshotAction.TYPE,
|
TransportRestoreSnapshotAction.TYPE,
|
||||||
new TransportRestoreSnapshotAction(
|
new TransportRestoreSnapshotAction(transportService, clusterService, threadPool, restoreService, actionFilters)
|
||||||
transportService,
|
|
||||||
clusterService,
|
|
||||||
threadPool,
|
|
||||||
restoreService,
|
|
||||||
actionFilters,
|
|
||||||
indexNameExpressionResolver
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
actions.put(
|
actions.put(
|
||||||
TransportDeleteIndexAction.TYPE,
|
TransportDeleteIndexAction.TYPE,
|
||||||
|
@ -2525,47 +2518,19 @@ public class SnapshotResiliencyTests extends ESTestCase {
|
||||||
);
|
);
|
||||||
actions.put(
|
actions.put(
|
||||||
TransportPutRepositoryAction.TYPE,
|
TransportPutRepositoryAction.TYPE,
|
||||||
new TransportPutRepositoryAction(
|
new TransportPutRepositoryAction(transportService, clusterService, repositoriesService, threadPool, actionFilters)
|
||||||
transportService,
|
|
||||||
clusterService,
|
|
||||||
repositoriesService,
|
|
||||||
threadPool,
|
|
||||||
actionFilters,
|
|
||||||
indexNameExpressionResolver
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
actions.put(
|
actions.put(
|
||||||
TransportCleanupRepositoryAction.TYPE,
|
TransportCleanupRepositoryAction.TYPE,
|
||||||
new TransportCleanupRepositoryAction(
|
new TransportCleanupRepositoryAction(transportService, clusterService, repositoriesService, threadPool, actionFilters)
|
||||||
transportService,
|
|
||||||
clusterService,
|
|
||||||
repositoriesService,
|
|
||||||
threadPool,
|
|
||||||
actionFilters,
|
|
||||||
indexNameExpressionResolver
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
actions.put(
|
actions.put(
|
||||||
TransportCreateSnapshotAction.TYPE,
|
TransportCreateSnapshotAction.TYPE,
|
||||||
new TransportCreateSnapshotAction(
|
new TransportCreateSnapshotAction(transportService, clusterService, threadPool, snapshotsService, actionFilters)
|
||||||
transportService,
|
|
||||||
clusterService,
|
|
||||||
threadPool,
|
|
||||||
snapshotsService,
|
|
||||||
actionFilters,
|
|
||||||
indexNameExpressionResolver
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
actions.put(
|
actions.put(
|
||||||
TransportCloneSnapshotAction.TYPE,
|
TransportCloneSnapshotAction.TYPE,
|
||||||
new TransportCloneSnapshotAction(
|
new TransportCloneSnapshotAction(transportService, clusterService, threadPool, snapshotsService, actionFilters)
|
||||||
transportService,
|
|
||||||
clusterService,
|
|
||||||
threadPool,
|
|
||||||
snapshotsService,
|
|
||||||
actionFilters,
|
|
||||||
indexNameExpressionResolver
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
actions.put(
|
actions.put(
|
||||||
TransportClusterRerouteAction.TYPE,
|
TransportClusterRerouteAction.TYPE,
|
||||||
|
@ -2575,7 +2540,6 @@ public class SnapshotResiliencyTests extends ESTestCase {
|
||||||
threadPool,
|
threadPool,
|
||||||
allocationService,
|
allocationService,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
indexNameExpressionResolver,
|
|
||||||
TestProjectResolvers.singleProjectOnly()
|
TestProjectResolvers.singleProjectOnly()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -2616,14 +2580,7 @@ public class SnapshotResiliencyTests extends ESTestCase {
|
||||||
);
|
);
|
||||||
actions.put(
|
actions.put(
|
||||||
TransportDeleteSnapshotAction.TYPE,
|
TransportDeleteSnapshotAction.TYPE,
|
||||||
new TransportDeleteSnapshotAction(
|
new TransportDeleteSnapshotAction(transportService, clusterService, threadPool, snapshotsService, actionFilters)
|
||||||
transportService,
|
|
||||||
clusterService,
|
|
||||||
threadPool,
|
|
||||||
snapshotsService,
|
|
||||||
actionFilters,
|
|
||||||
indexNameExpressionResolver
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
client.initialize(
|
client.initialize(
|
||||||
actions,
|
actions,
|
||||||
|
|
|
@ -10,7 +10,6 @@ import org.elasticsearch.action.ActionListener;
|
||||||
import org.elasticsearch.action.support.ActionFilters;
|
import org.elasticsearch.action.support.ActionFilters;
|
||||||
import org.elasticsearch.client.internal.Client;
|
import org.elasticsearch.client.internal.Client;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.injection.guice.Inject;
|
import org.elasticsearch.injection.guice.Inject;
|
||||||
import org.elasticsearch.protocol.xpack.XPackUsageRequest;
|
import org.elasticsearch.protocol.xpack.XPackUsageRequest;
|
||||||
|
@ -32,7 +31,6 @@ public class AnalyticsUsageTransportAction extends XPackUsageFeatureTransportAct
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
Client client
|
Client client
|
||||||
) {
|
) {
|
||||||
super(XPackUsageFeatureAction.ANALYTICS.name(), transportService, clusterService, threadPool, actionFilters);
|
super(XPackUsageFeatureAction.ANALYTICS.name(), transportService, clusterService, threadPool, actionFilters);
|
||||||
|
|
|
@ -70,7 +70,6 @@ public class AnalyticsInfoTransportActionTests extends ESTestCase {
|
||||||
clusterService,
|
clusterService,
|
||||||
threadPool,
|
threadPool,
|
||||||
mock(ActionFilters.class),
|
mock(ActionFilters.class),
|
||||||
null,
|
|
||||||
client
|
client
|
||||||
);
|
);
|
||||||
PlainActionFuture<XPackUsageFeatureResponse> future = new PlainActionFuture<>();
|
PlainActionFuture<XPackUsageFeatureResponse> future = new PlainActionFuture<>();
|
||||||
|
@ -98,7 +97,6 @@ public class AnalyticsInfoTransportActionTests extends ESTestCase {
|
||||||
clusterService,
|
clusterService,
|
||||||
threadPool,
|
threadPool,
|
||||||
mock(ActionFilters.class),
|
mock(ActionFilters.class),
|
||||||
null,
|
|
||||||
client
|
client
|
||||||
);
|
);
|
||||||
PlainActionFuture<XPackUsageFeatureResponse> future = new PlainActionFuture<>();
|
PlainActionFuture<XPackUsageFeatureResponse> future = new PlainActionFuture<>();
|
||||||
|
|
|
@ -19,7 +19,6 @@ import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.ClusterStateUpdateTask;
|
import org.elasticsearch.cluster.ClusterStateUpdateTask;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.Metadata;
|
import org.elasticsearch.cluster.metadata.Metadata;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.regex.Regex;
|
import org.elasticsearch.common.regex.Regex;
|
||||||
|
@ -46,8 +45,7 @@ public class TransportDeleteAutoscalingPolicyAction extends AcknowledgedTranspor
|
||||||
final TransportService transportService,
|
final TransportService transportService,
|
||||||
final ClusterService clusterService,
|
final ClusterService clusterService,
|
||||||
final ThreadPool threadPool,
|
final ThreadPool threadPool,
|
||||||
final ActionFilters actionFilters,
|
final ActionFilters actionFilters
|
||||||
final IndexNameExpressionResolver indexNameExpressionResolver
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
DeleteAutoscalingPolicyAction.NAME,
|
DeleteAutoscalingPolicyAction.NAME,
|
||||||
|
|
|
@ -15,7 +15,6 @@ import org.elasticsearch.action.support.master.TransportMasterNodeAction;
|
||||||
import org.elasticsearch.cluster.ClusterInfoService;
|
import org.elasticsearch.cluster.ClusterInfoService;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||||
import org.elasticsearch.injection.guice.Inject;
|
import org.elasticsearch.injection.guice.Inject;
|
||||||
|
@ -53,7 +52,6 @@ public class TransportGetAutoscalingCapacityAction extends TransportMasterNodeAc
|
||||||
final ClusterService clusterService,
|
final ClusterService clusterService,
|
||||||
final ThreadPool threadPool,
|
final ThreadPool threadPool,
|
||||||
final ActionFilters actionFilters,
|
final ActionFilters actionFilters,
|
||||||
final IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
final AutoscalingCalculateCapacityService.Holder capacityServiceHolder,
|
final AutoscalingCalculateCapacityService.Holder capacityServiceHolder,
|
||||||
final ClusterInfoService clusterInfoService,
|
final ClusterInfoService clusterInfoService,
|
||||||
final SnapshotsInfoService snapshotsInfoService,
|
final SnapshotsInfoService snapshotsInfoService,
|
||||||
|
|
|
@ -14,7 +14,6 @@ import org.elasticsearch.action.support.master.TransportMasterNodeAction;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||||
import org.elasticsearch.injection.guice.Inject;
|
import org.elasticsearch.injection.guice.Inject;
|
||||||
|
@ -40,7 +39,6 @@ public class TransportGetAutoscalingPolicyAction extends TransportMasterNodeActi
|
||||||
final ClusterService clusterService,
|
final ClusterService clusterService,
|
||||||
final ThreadPool threadPool,
|
final ThreadPool threadPool,
|
||||||
final ActionFilters actionFilters,
|
final ActionFilters actionFilters,
|
||||||
final IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
final AutoscalingLicenseChecker autoscalingLicenseChecker
|
final AutoscalingLicenseChecker autoscalingLicenseChecker
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
|
|
|
@ -18,7 +18,6 @@ import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.ClusterStateUpdateTask;
|
import org.elasticsearch.cluster.ClusterStateUpdateTask;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.Metadata;
|
import org.elasticsearch.cluster.metadata.Metadata;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||||
|
@ -53,19 +52,10 @@ public class TransportPutAutoscalingPolicyAction extends AcknowledgedTransportMa
|
||||||
final ClusterService clusterService,
|
final ClusterService clusterService,
|
||||||
final ThreadPool threadPool,
|
final ThreadPool threadPool,
|
||||||
final ActionFilters actionFilters,
|
final ActionFilters actionFilters,
|
||||||
final IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
final AutoscalingCalculateCapacityService.Holder policyValidatorHolder,
|
final AutoscalingCalculateCapacityService.Holder policyValidatorHolder,
|
||||||
final AutoscalingLicenseChecker autoscalingLicenseChecker
|
final AutoscalingLicenseChecker autoscalingLicenseChecker
|
||||||
) {
|
) {
|
||||||
this(
|
this(transportService, clusterService, threadPool, actionFilters, policyValidatorHolder.get(), autoscalingLicenseChecker);
|
||||||
transportService,
|
|
||||||
clusterService,
|
|
||||||
threadPool,
|
|
||||||
actionFilters,
|
|
||||||
indexNameExpressionResolver,
|
|
||||||
policyValidatorHolder.get(),
|
|
||||||
autoscalingLicenseChecker
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TransportPutAutoscalingPolicyAction(
|
TransportPutAutoscalingPolicyAction(
|
||||||
|
@ -73,7 +63,6 @@ public class TransportPutAutoscalingPolicyAction extends AcknowledgedTransportMa
|
||||||
final ClusterService clusterService,
|
final ClusterService clusterService,
|
||||||
final ThreadPool threadPool,
|
final ThreadPool threadPool,
|
||||||
final ActionFilters actionFilters,
|
final ActionFilters actionFilters,
|
||||||
final IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
final PolicyValidator policyValidator,
|
final PolicyValidator policyValidator,
|
||||||
final AutoscalingLicenseChecker autoscalingLicenseChecker
|
final AutoscalingLicenseChecker autoscalingLicenseChecker
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -15,7 +15,6 @@ import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlocks;
|
import org.elasticsearch.cluster.block.ClusterBlocks;
|
||||||
import org.elasticsearch.cluster.coordination.NoMasterBlockService;
|
import org.elasticsearch.cluster.coordination.NoMasterBlockService;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.Metadata;
|
import org.elasticsearch.cluster.metadata.Metadata;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.regex.Regex;
|
import org.elasticsearch.common.regex.Regex;
|
||||||
|
@ -46,8 +45,7 @@ public class TransportDeleteAutoscalingPolicyActionTests extends AutoscalingTest
|
||||||
transportService,
|
transportService,
|
||||||
mock(ClusterService.class),
|
mock(ClusterService.class),
|
||||||
threadPool,
|
threadPool,
|
||||||
mock(ActionFilters.class),
|
mock(ActionFilters.class)
|
||||||
mock(IndexNameExpressionResolver.class)
|
|
||||||
);
|
);
|
||||||
final ClusterBlocks blocks = ClusterBlocks.builder()
|
final ClusterBlocks blocks = ClusterBlocks.builder()
|
||||||
.addGlobalBlock(
|
.addGlobalBlock(
|
||||||
|
@ -73,8 +71,7 @@ public class TransportDeleteAutoscalingPolicyActionTests extends AutoscalingTest
|
||||||
transportService,
|
transportService,
|
||||||
mock(ClusterService.class),
|
mock(ClusterService.class),
|
||||||
threadPool,
|
threadPool,
|
||||||
mock(ActionFilters.class),
|
mock(ActionFilters.class)
|
||||||
mock(IndexNameExpressionResolver.class)
|
|
||||||
);
|
);
|
||||||
final ClusterBlocks blocks = ClusterBlocks.builder().build();
|
final ClusterBlocks blocks = ClusterBlocks.builder().build();
|
||||||
final ClusterState state = ClusterState.builder(new ClusterName(randomAlphaOfLength(8))).blocks(blocks).build();
|
final ClusterState state = ClusterState.builder(new ClusterName(randomAlphaOfLength(8))).blocks(blocks).build();
|
||||||
|
|
|
@ -15,7 +15,6 @@ import org.elasticsearch.cluster.block.ClusterBlock;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlocks;
|
import org.elasticsearch.cluster.block.ClusterBlocks;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.Metadata;
|
import org.elasticsearch.cluster.metadata.Metadata;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.rest.RestStatus;
|
import org.elasticsearch.rest.RestStatus;
|
||||||
|
@ -45,7 +44,6 @@ public class TransportGetAutoscalingPolicyActionTests extends AutoscalingTestCas
|
||||||
mock(ClusterService.class),
|
mock(ClusterService.class),
|
||||||
threadPool,
|
threadPool,
|
||||||
mock(ActionFilters.class),
|
mock(ActionFilters.class),
|
||||||
mock(IndexNameExpressionResolver.class),
|
|
||||||
new AutoscalingLicenseChecker(() -> true)
|
new AutoscalingLicenseChecker(() -> true)
|
||||||
);
|
);
|
||||||
final ClusterBlocks blocks = ClusterBlocks.builder()
|
final ClusterBlocks blocks = ClusterBlocks.builder()
|
||||||
|
@ -77,7 +75,6 @@ public class TransportGetAutoscalingPolicyActionTests extends AutoscalingTestCas
|
||||||
mock(ClusterService.class),
|
mock(ClusterService.class),
|
||||||
threadPool,
|
threadPool,
|
||||||
mock(ActionFilters.class),
|
mock(ActionFilters.class),
|
||||||
mock(IndexNameExpressionResolver.class),
|
|
||||||
new AutoscalingLicenseChecker(() -> true)
|
new AutoscalingLicenseChecker(() -> true)
|
||||||
);
|
);
|
||||||
final ClusterBlocks blocks = ClusterBlocks.builder().build();
|
final ClusterBlocks blocks = ClusterBlocks.builder().build();
|
||||||
|
|
|
@ -14,7 +14,6 @@ import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlocks;
|
import org.elasticsearch.cluster.block.ClusterBlocks;
|
||||||
import org.elasticsearch.cluster.coordination.NoMasterBlockService;
|
import org.elasticsearch.cluster.coordination.NoMasterBlockService;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.Metadata;
|
import org.elasticsearch.cluster.metadata.Metadata;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.test.MockUtils;
|
import org.elasticsearch.test.MockUtils;
|
||||||
|
@ -49,7 +48,6 @@ public class TransportPutAutoscalingPolicyActionTests extends AutoscalingTestCas
|
||||||
mock(ClusterService.class),
|
mock(ClusterService.class),
|
||||||
threadPool,
|
threadPool,
|
||||||
mock(ActionFilters.class),
|
mock(ActionFilters.class),
|
||||||
mock(IndexNameExpressionResolver.class),
|
|
||||||
NO_VALIDATION,
|
NO_VALIDATION,
|
||||||
new AutoscalingLicenseChecker(() -> true)
|
new AutoscalingLicenseChecker(() -> true)
|
||||||
);
|
);
|
||||||
|
@ -75,7 +73,6 @@ public class TransportPutAutoscalingPolicyActionTests extends AutoscalingTestCas
|
||||||
mock(ClusterService.class),
|
mock(ClusterService.class),
|
||||||
threadPool,
|
threadPool,
|
||||||
mock(ActionFilters.class),
|
mock(ActionFilters.class),
|
||||||
mock(IndexNameExpressionResolver.class),
|
|
||||||
NO_VALIDATION,
|
NO_VALIDATION,
|
||||||
new AutoscalingLicenseChecker(() -> true)
|
new AutoscalingLicenseChecker(() -> true)
|
||||||
);
|
);
|
||||||
|
|
|
@ -10,7 +10,6 @@ import org.elasticsearch.action.ActionListener;
|
||||||
import org.elasticsearch.action.support.ActionFilters;
|
import org.elasticsearch.action.support.ActionFilters;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.metadata.IndexMetadata;
|
import org.elasticsearch.cluster.metadata.IndexMetadata;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.Metadata;
|
import org.elasticsearch.cluster.metadata.Metadata;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
|
@ -40,7 +39,6 @@ public class CCRUsageTransportAction extends XPackUsageFeatureTransportAction {
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
Settings settings,
|
Settings settings,
|
||||||
XPackLicenseState licenseState
|
XPackLicenseState licenseState
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -16,7 +16,6 @@ import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.ClusterStateUpdateTask;
|
import org.elasticsearch.cluster.ClusterStateUpdateTask;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||||
import org.elasticsearch.core.SuppressForbidden;
|
import org.elasticsearch.core.SuppressForbidden;
|
||||||
|
@ -38,8 +37,7 @@ public class TransportActivateAutoFollowPatternAction extends AcknowledgedTransp
|
||||||
TransportService transportService,
|
TransportService transportService,
|
||||||
ClusterService clusterService,
|
ClusterService clusterService,
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters
|
||||||
IndexNameExpressionResolver resolver
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
ActivateAutoFollowPatternAction.NAME,
|
ActivateAutoFollowPatternAction.NAME,
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue