|
220 | 220 | import static org.opensearch.core.common.util.CollectionUtils.eagerPartition;
|
221 | 221 | import static org.opensearch.discovery.DiscoveryModule.DISCOVERY_SEED_PROVIDERS_SETTING;
|
222 | 222 | import static org.opensearch.discovery.SettingsBasedSeedHostsProvider.DISCOVERY_SEED_HOSTS_SETTING;
|
| 223 | +import static org.opensearch.gateway.remote.RemoteClusterStateService.REMOTE_CLUSTER_STATE_ENABLED_SETTING; |
| 224 | +import static org.opensearch.gateway.remote.RemoteClusterStateService.REMOTE_PUBLICATION_SETTING_KEY; |
223 | 225 | import static org.opensearch.index.IndexSettings.INDEX_DOC_ID_FUZZY_SET_ENABLED_SETTING;
|
224 | 226 | import static org.opensearch.index.IndexSettings.INDEX_DOC_ID_FUZZY_SET_FALSE_POSITIVE_PROBABILITY_SETTING;
|
225 | 227 | import static org.opensearch.index.IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_PERIOD_SETTING;
|
226 | 228 | import static org.opensearch.index.query.QueryBuilders.matchAllQuery;
|
227 | 229 | import static org.opensearch.index.remote.RemoteStoreEnums.PathHashAlgorithm.FNV_1A_COMPOSITE_1;
|
228 | 230 | import static org.opensearch.indices.IndicesService.CLUSTER_REPLICATION_TYPE_SETTING;
|
229 |
| -import static org.opensearch.node.remotestore.RemoteStoreNodeAttribute.REMOTE_STORE_CLUSTER_STATE_REPOSITORY_NAME_ATTRIBUTE_KEY; |
230 |
| -import static org.opensearch.node.remotestore.RemoteStoreNodeAttribute.REMOTE_STORE_REPOSITORY_SETTINGS_ATTRIBUTE_KEY_PREFIX; |
231 |
| -import static org.opensearch.node.remotestore.RemoteStoreNodeAttribute.REMOTE_STORE_REPOSITORY_TYPE_ATTRIBUTE_KEY_FORMAT; |
232 |
| -import static org.opensearch.node.remotestore.RemoteStoreNodeAttribute.REMOTE_STORE_ROUTING_TABLE_REPOSITORY_NAME_ATTRIBUTE_KEY; |
233 |
| -import static org.opensearch.node.remotestore.RemoteStoreNodeAttribute.REMOTE_STORE_SEGMENT_REPOSITORY_NAME_ATTRIBUTE_KEY; |
234 |
| -import static org.opensearch.node.remotestore.RemoteStoreNodeAttribute.REMOTE_STORE_TRANSLOG_REPOSITORY_NAME_ATTRIBUTE_KEY; |
| 231 | +import static org.opensearch.node.remotestore.RemoteStoreNodeAttribute.*; |
235 | 232 | import static org.opensearch.node.remotestore.RemoteStoreNodeService.MIGRATION_DIRECTION_SETTING;
|
236 | 233 | import static org.opensearch.node.remotestore.RemoteStoreNodeService.REMOTE_STORE_COMPATIBILITY_MODE_SETTING;
|
237 | 234 | import static org.opensearch.test.XContentTestUtils.convertToMap;
|
@@ -411,6 +408,9 @@ public abstract class OpenSearchIntegTestCase extends OpenSearchTestCase {
|
411 | 408 |
|
412 | 409 | private String randomStorageType;
|
413 | 410 |
|
| 411 | + protected Path translogRepoPath; |
| 412 | + protected Path segmentRepoPath; |
| 413 | + |
414 | 414 | @BeforeClass
|
415 | 415 | public static void beforeClass() throws Exception {
|
416 | 416 | prefixModeVerificationEnable = randomBoolean();
|
@@ -1968,6 +1968,43 @@ protected Settings nodeSettings(int nodeOrdinal) {
|
1968 | 1968 | builder.put(CLUSTER_REPLICATION_TYPE_SETTING.getKey(), randomReplicationType);
|
1969 | 1969 | }
|
1970 | 1970 | }
|
| 1971 | + |
| 1972 | + if (segmentRepoPath == null || translogRepoPath == null) { |
| 1973 | + segmentRepoPath = randomRepoPath().toAbsolutePath(); |
| 1974 | + translogRepoPath = randomRepoPath().toAbsolutePath(); |
| 1975 | + } |
| 1976 | + String segmentRepoName = "test-remote-store-repo"; |
| 1977 | + String stateRepoSettingsAttributeKeyPrefix = String.format( |
| 1978 | + Locale.getDefault(), |
| 1979 | + "node.attr." + REMOTE_STORE_REPOSITORY_SETTINGS_ATTRIBUTE_KEY_PREFIX, |
| 1980 | + segmentRepoName |
| 1981 | + ); |
| 1982 | + String prefixModeVerificationSuffix = BlobStoreRepository.PREFIX_MODE_VERIFICATION_SETTING.getKey(); |
| 1983 | + String stateRepoTypeAttributeKey = String.format( |
| 1984 | + Locale.getDefault(), |
| 1985 | + "node.attr." + REMOTE_STORE_REPOSITORY_TYPE_ATTRIBUTE_KEY_FORMAT, |
| 1986 | + segmentRepoName |
| 1987 | + ); |
| 1988 | + String routingTableRepoName = "remote-routing-repo"; |
| 1989 | + String routingTableRepoTypeAttributeKey = String.format( |
| 1990 | + Locale.getDefault(), |
| 1991 | + "node.attr." + REMOTE_STORE_REPOSITORY_TYPE_ATTRIBUTE_KEY_FORMAT, |
| 1992 | + routingTableRepoName |
| 1993 | + ); |
| 1994 | + String routingTableRepoSettingsAttributeKeyPrefix = String.format( |
| 1995 | + Locale.getDefault(), |
| 1996 | + "node.attr." + REMOTE_STORE_REPOSITORY_SETTINGS_ATTRIBUTE_KEY_PREFIX, |
| 1997 | + routingTableRepoName |
| 1998 | + ); |
| 1999 | + builder.put("node.attr." + REMOTE_STORE_CLUSTER_STATE_REPOSITORY_NAME_ATTRIBUTE_KEY, segmentRepoName) |
| 2000 | + .put(stateRepoTypeAttributeKey, ReloadableFsRepository.TYPE) |
| 2001 | + .put(stateRepoSettingsAttributeKeyPrefix + "location", segmentRepoPath) |
| 2002 | + .put(stateRepoSettingsAttributeKeyPrefix + prefixModeVerificationSuffix, prefixModeVerificationEnable) |
| 2003 | + .put(REMOTE_CLUSTER_STATE_ENABLED_SETTING.getKey(), true) |
| 2004 | + .put("node.attr." + REMOTE_STORE_ROUTING_TABLE_REPOSITORY_NAME_ATTRIBUTE_KEY, routingTableRepoName) |
| 2005 | + .put(routingTableRepoTypeAttributeKey, ReloadableFsRepository.TYPE) |
| 2006 | + .put(routingTableRepoSettingsAttributeKeyPrefix + "location", segmentRepoPath) |
| 2007 | + .put(REMOTE_PUBLICATION_SETTING_KEY, true); |
1971 | 2008 | return builder.build();
|
1972 | 2009 | }
|
1973 | 2010 |
|
|
0 commit comments