0.19.9 no longer supports /_all/_status, closes #2205.

This commit is contained in:
Shay Banon 2012-08-25 14:18:48 +03:00
parent dfa67bf071
commit da61ddee3c
1 changed files with 8 additions and 18 deletions

View File

@ -346,18 +346,14 @@ public class MetaData implements Iterable<IndexMetaData> {
}
public Map<String, Set<String>> resolveSearchRouting(@Nullable String routing, String[] aliasesOrIndices) {
if (aliasesOrIndices == null || aliasesOrIndices.length == 0) {
if (isAllIndices(aliasesOrIndices)) {
return resolveSearchRoutingAllIndices(routing);
}
aliasesOrIndices = convertFromWildcards(aliasesOrIndices, true, true);
if (aliasesOrIndices.length == 1) {
if (aliasesOrIndices[0].equals("_all")) {
return resolveSearchRoutingAllIndices(routing);
} else {
return resolveSearchRoutingSingleValue(routing, aliasesOrIndices[0]);
}
return resolveSearchRoutingSingleValue(routing, aliasesOrIndices[0]);
}
Map<String, Set<String>> routings = null;
@ -511,19 +507,13 @@ public class MetaData implements Iterable<IndexMetaData> {
* Translates the provided indices (possibly aliased) into actual indices.
*/
public String[] concreteIndices(String[] aliasesOrIndices, boolean ignoreMissing, boolean allOnlyOpen) throws IndexMissingException {
if (aliasesOrIndices == null || aliasesOrIndices.length == 0) {
if (isAllIndices(aliasesOrIndices)) {
return allOnlyOpen ? concreteAllOpenIndices() : concreteAllIndices();
}
aliasesOrIndices = convertFromWildcards(aliasesOrIndices, allOnlyOpen, ignoreMissing);
// optimize for single element index (common case)
if (aliasesOrIndices.length == 1) {
String aliasOrIndex = aliasesOrIndices[0];
if (aliasOrIndex.length() == 0) {
return allOnlyOpen ? concreteAllOpenIndices() : concreteAllIndices();
}
if (aliasOrIndex.equals("_all")) {
return allOnlyOpen ? concreteAllOpenIndices() : concreteAllIndices();
}
// if a direct index name, just return the array provided
if (this.indices.containsKey(aliasOrIndex)) {
return aliasesOrIndices;
@ -710,16 +700,12 @@ public class MetaData implements Iterable<IndexMetaData> {
* the index itself - null is returned. Returns <tt>null</tt> if no filtering is required.</p>
*/
public String[] filteringAliases(String index, String... indices) {
if (indices == null || indices.length == 0) {
if (isAllIndices(indices)) {
return null;
}
// optimize for the most common single index/alias scenario
if (indices.length == 1) {
String alias = indices[0];
// This list contains "_all" - no filtering needed
if (alias.equals("_all")) {
return null;
}
ImmutableMap<String, Boolean> aliasToFilteringRequiredMap = indexToAliasFilteringRequiredMap.get(index);
if (aliasToFilteringRequiredMap == null) {
// Shouldn't happen
@ -760,6 +746,10 @@ public class MetaData implements Iterable<IndexMetaData> {
return filteringAliases.toArray(new String[filteringAliases.size()]);
}
private boolean isAllIndices(String[] aliasesOrIndices) {
return (aliasesOrIndices == null || aliasesOrIndices.length == 0 || (aliasesOrIndices.length == 1 && "_all".equals(aliasesOrIndices[0])));
}
@Override
public UnmodifiableIterator<IndexMetaData> iterator() {