|
28 | 28 | import org.opensearch.cluster.service.ClusterService;
|
29 | 29 | import org.opensearch.common.UUIDs;
|
30 | 30 | import org.opensearch.common.settings.Settings;
|
31 |
| -import org.opensearch.core.common.unit.ByteSizeUnit; |
32 | 31 | import org.opensearch.core.index.Index;
|
33 | 32 | import org.opensearch.index.IndexModule;
|
34 | 33 | import org.opensearch.index.IndexService;
|
|
57 | 56 | import java.util.concurrent.atomic.AtomicInteger;
|
58 | 57 | import java.util.stream.Collectors;
|
59 | 58 |
|
60 |
| -import static org.opensearch.node.remotestore.RemoteStoreNodeAttribute.REMOTE_STORE_CLUSTER_STATE_REPOSITORY_NAME_ATTRIBUTE_KEY; |
61 | 59 | import static org.opensearch.node.remotestore.RemoteStoreNodeAttribute.REMOTE_STORE_REPOSITORY_SETTINGS_ATTRIBUTE_KEY_PREFIX;
|
62 | 60 | import static org.opensearch.node.remotestore.RemoteStoreNodeAttribute.REMOTE_STORE_REPOSITORY_TYPE_ATTRIBUTE_KEY_FORMAT;
|
63 |
| -import static org.opensearch.node.remotestore.RemoteStoreNodeAttribute.REMOTE_STORE_SEGMENT_REPOSITORY_NAME_ATTRIBUTE_KEY; |
64 |
| -import static org.opensearch.node.remotestore.RemoteStoreNodeAttribute.REMOTE_STORE_TRANSLOG_REPOSITORY_NAME_ATTRIBUTE_KEY; |
65 | 61 | import static org.opensearch.repositories.fs.ReloadableFsRepository.REPOSITORIES_FAILRATE_SETTING;
|
66 | 62 | import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertAcked;
|
67 | 63 |
|
@@ -191,121 +187,6 @@ protected BulkResponse indexBulk(String indexName, int numDocs) {
|
191 | 187 | return client().bulk(bulkRequest).actionGet();
|
192 | 188 | }
|
193 | 189 |
|
194 |
| - public static Settings remoteStoreClusterSettings(String name, Path path) { |
195 |
| - return remoteStoreClusterSettings(name, path, name, path); |
196 |
| - } |
197 |
| - |
198 |
| - public static Settings remoteStoreClusterSettings( |
199 |
| - String segmentRepoName, |
200 |
| - Path segmentRepoPath, |
201 |
| - String segmentRepoType, |
202 |
| - String translogRepoName, |
203 |
| - Path translogRepoPath, |
204 |
| - String translogRepoType |
205 |
| - ) { |
206 |
| - Settings.Builder settingsBuilder = Settings.builder(); |
207 |
| - settingsBuilder.put( |
208 |
| - buildRemoteStoreNodeAttributes( |
209 |
| - segmentRepoName, |
210 |
| - segmentRepoPath, |
211 |
| - segmentRepoType, |
212 |
| - translogRepoName, |
213 |
| - translogRepoPath, |
214 |
| - translogRepoType, |
215 |
| - false |
216 |
| - ) |
217 |
| - ); |
218 |
| - return settingsBuilder.build(); |
219 |
| - } |
220 |
| - |
221 |
| - public static Settings remoteStoreClusterSettings( |
222 |
| - String segmentRepoName, |
223 |
| - Path segmentRepoPath, |
224 |
| - String translogRepoName, |
225 |
| - Path translogRepoPath |
226 |
| - ) { |
227 |
| - Settings.Builder settingsBuilder = Settings.builder(); |
228 |
| - settingsBuilder.put(buildRemoteStoreNodeAttributes(segmentRepoName, segmentRepoPath, translogRepoName, translogRepoPath, false)); |
229 |
| - return settingsBuilder.build(); |
230 |
| - } |
231 |
| - |
232 |
| - public static Settings buildRemoteStoreNodeAttributes( |
233 |
| - String segmentRepoName, |
234 |
| - Path segmentRepoPath, |
235 |
| - String translogRepoName, |
236 |
| - Path translogRepoPath, |
237 |
| - boolean withRateLimiterAttributes |
238 |
| - ) { |
239 |
| - return buildRemoteStoreNodeAttributes( |
240 |
| - segmentRepoName, |
241 |
| - segmentRepoPath, |
242 |
| - ReloadableFsRepository.TYPE, |
243 |
| - translogRepoName, |
244 |
| - translogRepoPath, |
245 |
| - ReloadableFsRepository.TYPE, |
246 |
| - withRateLimiterAttributes |
247 |
| - ); |
248 |
| - } |
249 |
| - |
250 |
| - public static Settings buildRemoteStoreNodeAttributes( |
251 |
| - String segmentRepoName, |
252 |
| - Path segmentRepoPath, |
253 |
| - String segmentRepoType, |
254 |
| - String translogRepoName, |
255 |
| - Path translogRepoPath, |
256 |
| - String translogRepoType, |
257 |
| - boolean withRateLimiterAttributes |
258 |
| - ) { |
259 |
| - String segmentRepoTypeAttributeKey = String.format( |
260 |
| - Locale.getDefault(), |
261 |
| - "node.attr." + REMOTE_STORE_REPOSITORY_TYPE_ATTRIBUTE_KEY_FORMAT, |
262 |
| - segmentRepoName |
263 |
| - ); |
264 |
| - String segmentRepoSettingsAttributeKeyPrefix = String.format( |
265 |
| - Locale.getDefault(), |
266 |
| - "node.attr." + REMOTE_STORE_REPOSITORY_SETTINGS_ATTRIBUTE_KEY_PREFIX, |
267 |
| - segmentRepoName |
268 |
| - ); |
269 |
| - String translogRepoTypeAttributeKey = String.format( |
270 |
| - Locale.getDefault(), |
271 |
| - "node.attr." + REMOTE_STORE_REPOSITORY_TYPE_ATTRIBUTE_KEY_FORMAT, |
272 |
| - translogRepoName |
273 |
| - ); |
274 |
| - String translogRepoSettingsAttributeKeyPrefix = String.format( |
275 |
| - Locale.getDefault(), |
276 |
| - "node.attr." + REMOTE_STORE_REPOSITORY_SETTINGS_ATTRIBUTE_KEY_PREFIX, |
277 |
| - translogRepoName |
278 |
| - ); |
279 |
| - String stateRepoTypeAttributeKey = String.format( |
280 |
| - Locale.getDefault(), |
281 |
| - "node.attr." + REMOTE_STORE_REPOSITORY_TYPE_ATTRIBUTE_KEY_FORMAT, |
282 |
| - segmentRepoName |
283 |
| - ); |
284 |
| - String stateRepoSettingsAttributeKeyPrefix = String.format( |
285 |
| - Locale.getDefault(), |
286 |
| - "node.attr." + REMOTE_STORE_REPOSITORY_SETTINGS_ATTRIBUTE_KEY_PREFIX, |
287 |
| - segmentRepoName |
288 |
| - ); |
289 |
| - |
290 |
| - Settings.Builder settings = Settings.builder() |
291 |
| - .put("node.attr." + REMOTE_STORE_SEGMENT_REPOSITORY_NAME_ATTRIBUTE_KEY, segmentRepoName) |
292 |
| - .put(segmentRepoTypeAttributeKey, segmentRepoType) |
293 |
| - .put(segmentRepoSettingsAttributeKeyPrefix + "location", segmentRepoPath) |
294 |
| - .put("node.attr." + REMOTE_STORE_TRANSLOG_REPOSITORY_NAME_ATTRIBUTE_KEY, translogRepoName) |
295 |
| - .put(translogRepoTypeAttributeKey, translogRepoType) |
296 |
| - .put(translogRepoSettingsAttributeKeyPrefix + "location", translogRepoPath) |
297 |
| - .put("node.attr." + REMOTE_STORE_CLUSTER_STATE_REPOSITORY_NAME_ATTRIBUTE_KEY, segmentRepoName) |
298 |
| - .put(stateRepoTypeAttributeKey, segmentRepoType) |
299 |
| - .put(stateRepoSettingsAttributeKeyPrefix + "location", segmentRepoPath); |
300 |
| - |
301 |
| - if (withRateLimiterAttributes) { |
302 |
| - settings.put(segmentRepoSettingsAttributeKeyPrefix + "compress", randomBoolean()) |
303 |
| - .put(segmentRepoSettingsAttributeKeyPrefix + "chunk_size", 200, ByteSizeUnit.BYTES); |
304 |
| - } |
305 |
| - |
306 |
| - return settings.build(); |
307 |
| - } |
308 |
| - |
309 | 190 | Settings defaultIndexSettings() {
|
310 | 191 | return Settings.builder()
|
311 | 192 | .put(super.indexSettings())
|
|
0 commit comments