Skip to content

Commit f8e8a37

Browse files
author
Gagan Singh Saini
committed
Small fix with Spotless check
Signed-off-by: Gagan Singh Saini <gagasa@amazon.com>
1 parent 2f3c89d commit f8e8a37

File tree

4 files changed

+21
-19
lines changed

4 files changed

+21
-19
lines changed

server/src/internalClusterTest/java/org/opensearch/remotestore/RemoteSnapshotIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public RemoteSnapshotIT(Settings nodeSettings) {
3434
super(nodeSettings);
3535
}
3636

37-
public RemoteSnapshotIT(){
37+
public RemoteSnapshotIT() {
3838
super();
3939
}
4040

server/src/internalClusterTest/java/org/opensearch/snapshots/CloneSnapshotV2IT.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
3535
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters;
36+
3637
import org.apache.lucene.tests.util.LuceneTestCase;
3738
import org.opensearch.action.ActionRunnable;
3839
import org.opensearch.action.DocWriteResponse;
@@ -83,9 +84,9 @@ public CloneSnapshotV2IT(Settings nodeSettings) {
8384
}
8485

8586
/*
86-
Disabling MockFSIndexStore plugin as the MockFSDirectoryFactory wraps the FSDirectory over a OpenSearchMockDirectoryWrapper which extends FilterDirectory (whereas FSDirectory extends BaseDirectory)
87-
As a result of this wrapping the local directory of Composite Directory does not satisfy the assertion that local directory must be of type FSDirectory
88-
*/
87+
Disabling MockFSIndexStore plugin as the MockFSDirectoryFactory wraps the FSDirectory over a OpenSearchMockDirectoryWrapper which extends FilterDirectory (whereas FSDirectory extends BaseDirectory)
88+
As a result of this wrapping the local directory of Composite Directory does not satisfy the assertion that local directory must be of type FSDirectory
89+
*/
8990
@Override
9091
protected boolean addMockIndexStorePlugin() {
9192
return !WRITABLE_WARM_INDEX_SETTING.get(settings);
@@ -94,18 +95,18 @@ protected boolean addMockIndexStorePlugin() {
9495
@ParametersFactory
9596
public static Collection<Object[]> parameters() {
9697
return Arrays.asList(
97-
new Object[] { Settings.builder().put(WRITABLE_WARM_INDEX_SETTING.getKey(), false).build() },
98-
new Object[] { Settings.builder().put(WRITABLE_WARM_INDEX_SETTING.getKey(), true).build() }
98+
new Object[] { Settings.builder().put(WRITABLE_WARM_INDEX_SETTING.getKey(), false).build() },
99+
new Object[] { Settings.builder().put(WRITABLE_WARM_INDEX_SETTING.getKey(), true).build() }
99100
);
100101
}
101102

102103
@Override
103104
protected Settings nodeSettings(int nodeOrdinal) {
104105
ByteSizeValue cacheSize = new ByteSizeValue(16, ByteSizeUnit.GB);
105106
return Settings.builder()
106-
.put(super.nodeSettings(nodeOrdinal))
107-
.put(Node.NODE_SEARCH_CACHE_SIZE_SETTING.getKey(), cacheSize.toString())
108-
.build();
107+
.put(super.nodeSettings(nodeOrdinal))
108+
.put(Node.NODE_SEARCH_CACHE_SIZE_SETTING.getKey(), cacheSize.toString())
109+
.build();
109110
}
110111

111112
public void testCloneShallowCopyV2() throws Exception {

server/src/internalClusterTest/java/org/opensearch/snapshots/ConcurrentSnapshotsV2IT.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
1212
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters;
13+
1314
import org.apache.lucene.tests.util.LuceneTestCase;
1415
import org.opensearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse;
1516
import org.opensearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse;
@@ -39,12 +40,12 @@
3940
import java.util.List;
4041
import java.util.concurrent.ExecutionException;
4142

43+
import static org.opensearch.common.util.FeatureFlags.WRITABLE_WARM_INDEX_SETTING;
4244
import static org.hamcrest.Matchers.contains;
4345
import static org.hamcrest.Matchers.containsInAnyOrder;
4446
import static org.hamcrest.Matchers.equalTo;
4547
import static org.hamcrest.Matchers.greaterThan;
4648
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
47-
import static org.opensearch.common.util.FeatureFlags.WRITABLE_WARM_INDEX_SETTING;
4849

4950
// TODO : Delete Index in teardown and prune cache to remove Index Files
5051
@LuceneTestCase.SuppressFileSystems("*")
@@ -57,9 +58,9 @@ public ConcurrentSnapshotsV2IT(Settings nodeSettings) {
5758
}
5859

5960
/*
60-
Disabling MockFSIndexStore plugin as the MockFSDirectoryFactory wraps the FSDirectory over a OpenSearchMockDirectoryWrapper which extends FilterDirectory (whereas FSDirectory extends BaseDirectory)
61-
As a result of this wrapping the local directory of Composite Directory does not satisfy the assertion that local directory must be of type FSDirectory
62-
*/
61+
Disabling MockFSIndexStore plugin as the MockFSDirectoryFactory wraps the FSDirectory over a OpenSearchMockDirectoryWrapper which extends FilterDirectory (whereas FSDirectory extends BaseDirectory)
62+
As a result of this wrapping the local directory of Composite Directory does not satisfy the assertion that local directory must be of type FSDirectory
63+
*/
6364
@Override
6465
protected boolean addMockIndexStorePlugin() {
6566
return !WRITABLE_WARM_INDEX_SETTING.get(settings);
@@ -68,18 +69,18 @@ protected boolean addMockIndexStorePlugin() {
6869
@ParametersFactory
6970
public static Collection<Object[]> parameters() {
7071
return Arrays.asList(
71-
new Object[] { Settings.builder().put(WRITABLE_WARM_INDEX_SETTING.getKey(), false).build() },
72-
new Object[] { Settings.builder().put(WRITABLE_WARM_INDEX_SETTING.getKey(), true).build() }
72+
new Object[] { Settings.builder().put(WRITABLE_WARM_INDEX_SETTING.getKey(), false).build() },
73+
new Object[] { Settings.builder().put(WRITABLE_WARM_INDEX_SETTING.getKey(), true).build() }
7374
);
7475
}
7576

7677
@Override
7778
protected Settings nodeSettings(int nodeOrdinal) {
7879
ByteSizeValue cacheSize = new ByteSizeValue(16, ByteSizeUnit.GB);
7980
return Settings.builder()
80-
.put(super.nodeSettings(nodeOrdinal))
81-
.put(Node.NODE_SEARCH_CACHE_SIZE_SETTING.getKey(), cacheSize.toString())
82-
.build();
81+
.put(super.nodeSettings(nodeOrdinal))
82+
.put(Node.NODE_SEARCH_CACHE_SIZE_SETTING.getKey(), cacheSize.toString())
83+
.build();
8384
}
8485

8586
public void testLongRunningSnapshotDontAllowConcurrentSnapshot() throws Exception {

server/src/main/java/org/opensearch/index/shard/IndexShard.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5285,7 +5285,7 @@ public void syncSegmentsFromGivenRemoteSegmentStore(
52855285
}
52865286
}
52875287
assert Arrays.stream(store.directory().listAll()).filter(f -> f.startsWith(IndexFileNames.SEGMENTS)).findAny().isEmpty()
5288-
: "There should not be any segments file in the dir";
5288+
|| indexSettings.isWarmIndex() : "There should not be any segments file in the dir";
52895289
store.commitSegmentInfos(infosSnapshot, processedLocalCheckpoint, processedLocalCheckpoint);
52905290
} else if (segmentsNFile != null) {
52915291
try (

0 commit comments

Comments
 (0)