|
36 | 36 | import com.carrotsearch.randomizedtesting.annotations.TestGroup;
|
37 | 37 | import com.carrotsearch.randomizedtesting.generators.RandomNumbers;
|
38 | 38 | import com.carrotsearch.randomizedtesting.generators.RandomPicks;
|
39 |
| - |
40 | 39 | import org.apache.hc.core5.http.HttpHost;
|
41 | 40 | import org.apache.lucene.codecs.Codec;
|
42 | 41 | import org.apache.lucene.search.Sort;
|
43 | 42 | import org.apache.lucene.search.TotalHits;
|
44 | 43 | import org.apache.lucene.tests.util.LuceneTestCase;
|
| 44 | +import org.hamcrest.Matchers; |
| 45 | +import org.junit.After; |
| 46 | +import org.junit.AfterClass; |
45 | 47 | import org.junit.Assert;
|
| 48 | +import org.junit.Before; |
| 49 | +import org.junit.BeforeClass; |
46 | 50 | import org.opensearch.ExceptionsHelper;
|
47 | 51 | import org.opensearch.OpenSearchException;
|
48 | 52 | import org.opensearch.action.DocWriteResponse;
|
|
85 | 89 | import org.opensearch.cluster.health.ClusterHealthStatus;
|
86 | 90 | import org.opensearch.cluster.metadata.IndexMetadata;
|
87 | 91 | import org.opensearch.cluster.metadata.Metadata;
|
88 |
| -import org.opensearch.cluster.metadata.RepositoriesMetadata; |
| 92 | +import org.opensearch.cluster.node.DiscoveryNode; |
89 | 93 | import org.opensearch.cluster.routing.IndexRoutingTable;
|
90 | 94 | import org.opensearch.cluster.routing.IndexShardRoutingTable;
|
91 | 95 | import org.opensearch.cluster.routing.ShardRouting;
|
|
170 | 174 | import org.opensearch.transport.TransportRequest;
|
171 | 175 | import org.opensearch.transport.TransportRequestHandler;
|
172 | 176 | import org.opensearch.transport.TransportService;
|
173 |
| -import org.hamcrest.Matchers; |
174 |
| -import org.junit.After; |
175 |
| -import org.junit.AfterClass; |
176 |
| -import org.junit.Before; |
177 |
| -import org.junit.BeforeClass; |
178 | 177 |
|
179 | 178 | import java.io.IOException;
|
180 | 179 | import java.lang.Runtime.Version;
|
|
204 | 203 | import java.util.concurrent.Callable;
|
205 | 204 | import java.util.concurrent.CopyOnWriteArrayList;
|
206 | 205 | import java.util.concurrent.CountDownLatch;
|
207 |
| -import java.util.concurrent.ExecutionException; |
208 | 206 | import java.util.concurrent.TimeUnit;
|
209 | 207 | import java.util.concurrent.atomic.AtomicInteger;
|
210 | 208 | import java.util.function.Function;
|
211 | 209 | import java.util.stream.Collectors;
|
212 | 210 |
|
213 |
| -import static org.opensearch.action.admin.cluster.remotestore.RemoteStoreNode.*; |
| 211 | +import static org.hamcrest.Matchers.empty; |
| 212 | +import static org.hamcrest.Matchers.emptyIterable; |
| 213 | +import static org.hamcrest.Matchers.equalTo; |
| 214 | +import static org.hamcrest.Matchers.greaterThanOrEqualTo; |
| 215 | +import static org.hamcrest.Matchers.is; |
| 216 | +import static org.hamcrest.Matchers.lessThanOrEqualTo; |
| 217 | +import static org.hamcrest.Matchers.startsWith; |
214 | 218 | import static org.opensearch.action.admin.cluster.remotestore.RemoteStoreNode.REMOTE_STORE_REPOSITORY_SETTINGS_ATTRIBUTE_KEY_PREFIX;
|
215 |
| -import static org.opensearch.cluster.metadata.IndexMetadata.*; |
| 219 | +import static org.opensearch.action.admin.cluster.remotestore.RemoteStoreNode.REMOTE_STORE_REPOSITORY_TYPE_ATTRIBUTE_KEY_FORMAT; |
| 220 | +import static org.opensearch.action.admin.cluster.remotestore.RemoteStoreNode.REMOTE_STORE_SEGMENT_REPOSITORY_NAME_ATTRIBUTE_KEY; |
| 221 | +import static org.opensearch.action.admin.cluster.remotestore.RemoteStoreNode.REMOTE_STORE_TRANSLOG_REPOSITORY_NAME_ATTRIBUTE_KEY; |
| 222 | +import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_REPLICAS; |
| 223 | +import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_SHARDS; |
| 224 | +import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_REPLICATION_TYPE; |
216 | 225 | import static org.opensearch.common.unit.TimeValue.timeValueMillis;
|
217 | 226 | import static org.opensearch.core.common.util.CollectionUtils.eagerPartition;
|
218 | 227 | import static org.opensearch.discovery.DiscoveryModule.DISCOVERY_SEED_PROVIDERS_SETTING;
|
219 | 228 | import static org.opensearch.discovery.SettingsBasedSeedHostsProvider.DISCOVERY_SEED_HOSTS_SETTING;
|
220 | 229 | import static org.opensearch.index.IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_PERIOD_SETTING;
|
221 | 230 | import static org.opensearch.index.query.QueryBuilders.matchAllQuery;
|
222 | 231 | import static org.opensearch.indices.IndicesService.CLUSTER_REPLICATION_TYPE_SETTING;
|
223 |
| -import static org.opensearch.indices.IndicesService.*; |
224 |
| -import static org.opensearch.test.XContentTestUtils.convertToMap; |
225 | 232 | import static org.opensearch.test.XContentTestUtils.differenceBetweenMapsIgnoringArrayOrder;
|
226 |
| -import static org.hamcrest.Matchers.empty; |
227 |
| -import static org.hamcrest.Matchers.emptyIterable; |
228 |
| -import static org.hamcrest.Matchers.equalTo; |
229 |
| -import static org.hamcrest.Matchers.greaterThanOrEqualTo; |
230 |
| -import static org.hamcrest.Matchers.is; |
231 |
| -import static org.hamcrest.Matchers.lessThanOrEqualTo; |
232 |
| -import static org.hamcrest.Matchers.startsWith; |
233 |
| -import static org.opensearch.test.hamcrest.OpenSearchAssertions.*; |
| 233 | +import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertAcked; |
| 234 | +import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertNoFailures; |
| 235 | +import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertNoTimeout; |
234 | 236 |
|
235 | 237 | /**
|
236 | 238 | * {@link OpenSearchIntegTestCase} is an abstract base class to run integration
|
@@ -2605,4 +2607,9 @@ protected boolean isIndexRemoteStoreEnabled(String index) throws Exception {
|
2605 | 2607 | .getSetting(index, IndexMetadata.SETTING_REMOTE_STORE_ENABLED).equals(Boolean.TRUE.toString());
|
2606 | 2608 | }
|
2607 | 2609 |
|
| 2610 | + protected boolean isRemoteStoreEnabled() { |
| 2611 | + DiscoveryNode node = client().admin().cluster().prepareState().get().getState().nodes().getClusterManagerNode(); |
| 2612 | + return node.isRemoteStoreNode(); |
| 2613 | + } |
| 2614 | + |
2608 | 2615 | }
|
0 commit comments