Skip to content

Commit

Permalink
Snapshot/Restore: remove obsolete expand_wildcards_open and expand_wi…
Browse files Browse the repository at this point in the history
…ldcards_close options

In elastic#6097 we made snapshot/restore index option consistent with other API. Now we can remove old style options from master.

Closes elastic#10743
  • Loading branch information
imotov committed Apr 23, 2015
1 parent 0513815 commit 60721b2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
7 changes: 7 additions & 0 deletions docs/reference/migration/migrate_2_0.asciidoc
Expand Up @@ -389,3 +389,10 @@ favour or `bool`.

The `execution` option of the `terms` filter is now deprecated and ignored if
provided.

=== Snapshot and Restore

The obsolete parameters `expand_wildcards_open` and `expand_wildcards_close` are no longer
supported by the snapshot and restore operations. These parameters have been replaced by
a single `expand_wildcards` parameter. See <<multi-index,the multi-index docs>> for more.

Expand Up @@ -371,10 +371,6 @@ public CreateSnapshotRequest source(XContentBuilder source) {
* @return this request
*/
public CreateSnapshotRequest source(Map source) {
boolean ignoreUnavailable = IndicesOptions.lenientExpandOpen().ignoreUnavailable();
boolean allowNoIndices = IndicesOptions.lenientExpandOpen().allowNoIndices();
boolean expandWildcardsOpen = IndicesOptions.lenientExpandOpen().expandWildcardsOpen();
boolean expandWildcardsClosed = IndicesOptions.lenientExpandOpen().expandWildcardsClosed();
for (Map.Entry<String, Object> entry : ((Map<String, Object>) source).entrySet()) {
String name = entry.getKey();
if (name.equals("indices")) {
Expand All @@ -385,10 +381,6 @@ public CreateSnapshotRequest source(Map source) {
} else {
throw new ElasticsearchIllegalArgumentException("malformed indices section, should be an array of strings");
}
} else if (name.equals("expand_wildcards_open") || name.equals("expandWildcardsOpen")) {
expandWildcardsOpen = nodeBooleanValue(entry.getValue());
} else if (name.equals("expand_wildcards_closed") || name.equals("expandWildcardsClosed")) {
expandWildcardsClosed = nodeBooleanValue(entry.getValue());
} else if (name.equals("partial")) {
partial(nodeBooleanValue(entry.getValue()));
} else if (name.equals("settings")) {
Expand All @@ -400,7 +392,7 @@ public CreateSnapshotRequest source(Map source) {
includeGlobalState = nodeBooleanValue(entry.getValue());
}
}
indicesOptions(IndicesOptions.fromMap((Map<String, Object>) source, IndicesOptions.fromOptions(ignoreUnavailable, allowNoIndices, expandWildcardsOpen, expandWildcardsClosed)));
indicesOptions(IndicesOptions.fromMap((Map<String, Object>) source, IndicesOptions.lenientExpandOpen()));
return this;
}

Expand Down
Expand Up @@ -504,11 +504,6 @@ public RestoreSnapshotRequest source(XContentBuilder source) {
* @return this request
*/
public RestoreSnapshotRequest source(Map source) {
boolean ignoreUnavailable = IndicesOptions.lenientExpandOpen().ignoreUnavailable();
boolean allowNoIndices = IndicesOptions.lenientExpandOpen().allowNoIndices();
boolean expandWildcardsOpen = IndicesOptions.lenientExpandOpen().expandWildcardsOpen();
boolean expandWildcardsClosed = IndicesOptions.lenientExpandOpen().expandWildcardsClosed();

for (Map.Entry<String, Object> entry : ((Map<String, Object>) source).entrySet()) {
String name = entry.getKey();
if (name.equals("indices")) {
Expand All @@ -519,10 +514,6 @@ public RestoreSnapshotRequest source(Map source) {
} else {
throw new ElasticsearchIllegalArgumentException("malformed indices section, should be an array of strings");
}
} else if (name.equals("expand_wildcards_open") || name.equals("expandWildcardsOpen")) {
expandWildcardsOpen = nodeBooleanValue(entry.getValue());
} else if (name.equals("expand_wildcards_closed") || name.equals("expandWildcardsClosed")) {
expandWildcardsClosed = nodeBooleanValue(entry.getValue());
} else if (name.equals("partial")) {
partial(nodeBooleanValue(entry.getValue()));
} else if (name.equals("settings")) {
Expand Down Expand Up @@ -563,7 +554,7 @@ public RestoreSnapshotRequest source(Map source) {
throw new ElasticsearchIllegalArgumentException("Unknown parameter " + name);
}
}
indicesOptions(IndicesOptions.fromMap((Map<String, Object>) source, IndicesOptions.fromOptions(ignoreUnavailable, allowNoIndices, expandWildcardsOpen, expandWildcardsClosed)));
indicesOptions(IndicesOptions.fromMap((Map<String, Object>) source, IndicesOptions.lenientExpandOpen()));
return this;
}

Expand Down

0 comments on commit 60721b2

Please sign in to comment.