Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions docs/plugins/repository-azure.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -185,22 +185,6 @@ client.admin().cluster().preparePutRepository("my_backup_java1")
).get();
----

[[repository-azure-global-settings]]
===== Global repositories settings

All those repository settings can also be defined globally in `elasticsearch.yml` file using prefix
`repositories.azure.`. For example:

[source,yaml]
----
repositories.azure:
container: backup-container
base_path: backups
chunk_size: 32m
compress": true
----


[[repository-azure-validation]]
===== Repository validation rules

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,26 @@ final class Storage {

public static final Setting<TimeValue> TIMEOUT_SETTING =
Setting.timeSetting("cloud.azure.storage.timeout", TimeValue.timeValueMinutes(-1), Property.NodeScope);
@Deprecated
public static final Setting<String> ACCOUNT_SETTING =
Setting.simpleString("repositories.azure.account", Property.NodeScope, Property.Filtered);
Setting.simpleString("repositories.azure.account", Property.NodeScope, Property.Filtered, Property.Deprecated);
@Deprecated
public static final Setting<String> CONTAINER_SETTING =
new Setting<>("repositories.azure.container", "elasticsearch-snapshots", Function.identity(), Property.NodeScope);
new Setting<>("repositories.azure.container", "elasticsearch-snapshots", Function.identity(), Property.NodeScope,
Property.Deprecated);
@Deprecated
public static final Setting<String> BASE_PATH_SETTING =
Setting.simpleString("repositories.azure.base_path", Property.NodeScope);
Setting.simpleString("repositories.azure.base_path", Property.NodeScope, Property.Deprecated);
@Deprecated
public static final Setting<String> LOCATION_MODE_SETTING =
Setting.simpleString("repositories.azure.location_mode", Property.NodeScope);
Setting.simpleString("repositories.azure.location_mode", Property.NodeScope, Property.Deprecated);
@Deprecated
public static final Setting<ByteSizeValue> CHUNK_SIZE_SETTING =
Setting.byteSizeSetting("repositories.azure.chunk_size", MAX_CHUNK_SIZE, MIN_CHUNK_SIZE, MAX_CHUNK_SIZE, Property.NodeScope);
Setting.byteSizeSetting("repositories.azure.chunk_size", MAX_CHUNK_SIZE, MIN_CHUNK_SIZE, MAX_CHUNK_SIZE, Property.NodeScope,
Property.Deprecated);
@Deprecated
public static final Setting<Boolean> COMPRESS_SETTING =
Setting.boolSetting("repositories.azure.compress", false, Property.NodeScope);
Setting.boolSetting("repositories.azure.compress", false, Property.NodeScope, Property.Deprecated);
}

boolean doesContainerExist(String account, LocationMode mode, String container);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import com.microsoft.azure.storage.LocationMode;
import com.microsoft.azure.storage.StorageException;
import org.apache.logging.log4j.core.net.Protocol;
import org.elasticsearch.cloud.azure.storage.AzureStorageService;
import org.elasticsearch.cluster.metadata.RepositoryMetaData;
import org.elasticsearch.common.settings.Settings;
Expand Down Expand Up @@ -124,4 +125,24 @@ public void testChunkSize() throws StorageException, IOException, URISyntaxExcep
azureRepository(Settings.builder().put("chunk_size", "65mb").build()));
assertEquals("Failed to parse value [65mb] for setting [chunk_size] must be <= 64mb", e.getMessage());
}

public void testDeprecatedRepositoriesSettings() throws StorageException, IOException, URISyntaxException {
Settings settings = Settings.builder()
.put(AzureStorageService.Storage.ACCOUNT_SETTING.getKey(), "account")
.put(AzureStorageService.Storage.BASE_PATH_SETTING.getKey(), "path")
.put(AzureStorageService.Storage.CHUNK_SIZE_SETTING.getKey(), AzureStorageService.MAX_CHUNK_SIZE)
.put(AzureStorageService.Storage.COMPRESS_SETTING.getKey(), false)
.put(AzureStorageService.Storage.CONTAINER_SETTING.getKey(), "container")
.put(AzureStorageService.Storage.LOCATION_MODE_SETTING.getKey(), "primary_only")
.build();
azureRepository(settings);
assertWarnings("[" + AzureStorageService.Storage.ACCOUNT_SETTING.getKey() + "] setting was deprecated",
"[" + AzureStorageService.Storage.BASE_PATH_SETTING.getKey() + "] setting was deprecated",
"[" + AzureStorageService.Storage.CHUNK_SIZE_SETTING.getKey() + "] setting was deprecated",
"[" + AzureStorageService.Storage.COMPRESS_SETTING.getKey() + "] setting was deprecated",
"[" + AzureStorageService.Storage.CONTAINER_SETTING.getKey() + "] setting was deprecated",
"[" + AzureStorageService.Storage.LOCATION_MODE_SETTING.getKey() + "] setting was deprecated");
}


}