Skip to content

Commit

Permalink
more cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
  • Loading branch information
nknize committed May 17, 2023
1 parent d9dbe36 commit cdcf800
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public void testReopenDuringCloseOnMultipleIndices() throws Exception {
createIndexWithDocs(indices.get(i), dataOnlyNodes);
}

ensureYellowAndNoInitializingShards(indices.toArray(org.opensearch.common.Strings.EMPTY_ARRAY));
ensureYellowAndNoInitializingShards(indices.toArray(Strings.EMPTY_ARRAY));

final CountDownLatch block = new CountDownLatch(1);
final Releasable releaseBlock = interceptVerifyShardBeforeCloseActions(randomFrom(indices), block::countDown);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class AddVotingConfigExclusionsRequest extends ClusterManagerNodeRequest<
* @param nodeNames Names of the nodes to add - see {@link AddVotingConfigExclusionsRequest#resolveVotingConfigExclusions(ClusterState)}
*/
public AddVotingConfigExclusionsRequest(String... nodeNames) {
this(org.opensearch.common.Strings.EMPTY_ARRAY, Strings.EMPTY_ARRAY, nodeNames, TimeValue.timeValueSeconds(30));
this(Strings.EMPTY_ARRAY, Strings.EMPTY_ARRAY, nodeNames, TimeValue.timeValueSeconds(30));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public ClusterStateRequest all() {
metadata = true;
blocks = true;
customs = true;
indices = org.opensearch.common.Strings.EMPTY_ARRAY;
indices = Strings.EMPTY_ARRAY;
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ public SearchSourceBuilder fetchSource(boolean fetch) {
*/
public SearchSourceBuilder fetchSource(@Nullable String include, @Nullable String exclude) {
return fetchSource(
include == null ? org.opensearch.common.Strings.EMPTY_ARRAY : new String[] { include },
include == null ? Strings.EMPTY_ARRAY : new String[] { include },
exclude == null ? Strings.EMPTY_ARRAY : new String[] { exclude }
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ public class FetchSourceContext implements Writeable, ToXContentObject {

public FetchSourceContext(boolean fetchSource, String[] includes, String[] excludes) {
this.fetchSource = fetchSource;
this.includes = includes == null ? org.opensearch.common.Strings.EMPTY_ARRAY : includes;
this.excludes = excludes == null ? org.opensearch.common.Strings.EMPTY_ARRAY : excludes;
this.includes = includes == null ? Strings.EMPTY_ARRAY : includes;
this.excludes = excludes == null ? Strings.EMPTY_ARRAY : excludes;
}

public FetchSourceContext(boolean fetchSource) {
this(fetchSource, org.opensearch.common.Strings.EMPTY_ARRAY, org.opensearch.common.Strings.EMPTY_ARRAY);
this(fetchSource, Strings.EMPTY_ARRAY, Strings.EMPTY_ARRAY);
}

public FetchSourceContext(StreamInput in) throws IOException {
Expand Down Expand Up @@ -139,8 +139,8 @@ public static FetchSourceContext parseFromRestRequest(RestRequest request) {
public static FetchSourceContext fromXContent(XContentParser parser) throws IOException {
XContentParser.Token token = parser.currentToken();
boolean fetchSource = true;
String[] includes = org.opensearch.common.Strings.EMPTY_ARRAY;
String[] excludes = org.opensearch.common.Strings.EMPTY_ARRAY;
String[] includes = Strings.EMPTY_ARRAY;
String[] excludes = Strings.EMPTY_ARRAY;
if (token == XContentParser.Token.VALUE_BOOLEAN) {
fetchSource = parser.booleanValue();
} else if (token == XContentParser.Token.VALUE_STRING) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ private HitContext hitExecute(
return hitExecuteMultiple(
source,
fetchSource,
include == null ? org.opensearch.common.Strings.EMPTY_ARRAY : new String[] { include },
include == null ? Strings.EMPTY_ARRAY : new String[] { include },
exclude == null ? Strings.EMPTY_ARRAY : new String[] { exclude },
nestedIdentity
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private IndexSettings createIndexSettings(Version indexVersionCreated, int numSh
}

private ShardSearchRequest createRequest(int shardId) {
return createRequest(shardId, org.opensearch.common.Strings.EMPTY_ARRAY, null);
return createRequest(shardId, Strings.EMPTY_ARRAY, null);
}

private ShardSearchRequest createRequest(int shardId, String[] routings, String preference) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,11 @@ public void testGroupIndices() throws IOException {
{
Map<String, OriginalIndices> perClusterIndices = service.groupIndices(
IndicesOptions.LENIENT_EXPAND_OPEN,
org.opensearch.common.Strings.EMPTY_ARRAY,
Strings.EMPTY_ARRAY,
i -> false
);
assertEquals(1, perClusterIndices.size());
assertArrayEquals(
org.opensearch.common.Strings.EMPTY_ARRAY,
perClusterIndices.get(RemoteClusterAware.LOCAL_CLUSTER_GROUP_KEY).indices()
);
assertArrayEquals(Strings.EMPTY_ARRAY, perClusterIndices.get(RemoteClusterAware.LOCAL_CLUSTER_GROUP_KEY).indices());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ private static void assertIndexUUIDs(BlobStoreRepository repository, RepositoryD
.filter(s -> s.startsWith("extra") == false)
.collect(Collectors.toList());
}
assertThat(foundIndexUUIDs, containsInAnyOrder(expectedIndexUUIDs.toArray(org.opensearch.common.Strings.EMPTY_ARRAY)));
assertThat(foundIndexUUIDs, containsInAnyOrder(expectedIndexUUIDs.toArray(Strings.EMPTY_ARRAY)));
for (String indexId : foundIndexUUIDs) {
final Set<String> indexMetaGenerationsFound = indicesContainer.children()
.get(indexId)
Expand Down Expand Up @@ -247,7 +247,7 @@ private static void assertSnapshotUUIDs(BlobStoreRepository repository, Reposito
.filter(p -> p.startsWith(prefix))
.map(p -> p.replace(prefix, "").replace(".dat", ""))
.collect(Collectors.toSet());
assertThat(foundSnapshotUUIDs, containsInAnyOrder(expectedSnapshotUUIDs.toArray(org.opensearch.common.Strings.EMPTY_ARRAY)));
assertThat(foundSnapshotUUIDs, containsInAnyOrder(expectedSnapshotUUIDs.toArray(Strings.EMPTY_ARRAY)));
}

final BlobContainer indicesContainer = repository.getBlobContainer().children().get("indices");
Expand Down

0 comments on commit cdcf800

Please sign in to comment.