Skip to content

Commit

Permalink
OAK-8438: Allow not to create blob container in AzureDataStore
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/oak/trunk@1862113 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
trekawek committed Jun 26, 2019
1 parent 8b34edc commit 94a392d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ public class AzureBlobStoreBackend extends AbstractSharedBackend {
private Integer requestTimeout;
private int httpDownloadURIExpirySeconds = 0; // disabled by default
private int httpUploadURIExpirySeconds = 0; // disabled by default
private boolean createBlobContainer = true;

private Cache<DataIdentifier, URI> httpDownloadURICache;

Expand Down Expand Up @@ -154,6 +155,7 @@ public void init() throws DataStoreException {
try {
Utils.setProxyIfNeeded(properties);
containerName = (String) properties.get(AzureConstants.AZURE_BLOB_CONTAINER_NAME);
createBlobContainer = PropertiesUtil.toBoolean(AzureConstants.AZURE_CREATE_CONTAINER, true);
connectionString = Utils.getConnectionStringFromProperties(properties);
concurrentRequestCount = PropertiesUtil.toInteger(properties.get(AzureConstants.AZURE_BLOB_CONCURRENT_REQUESTS_PER_OPERATION), 1);
LOG.info("Using concurrentRequestsPerOperation={}", concurrentRequestCount);
Expand All @@ -164,7 +166,7 @@ public void init() throws DataStoreException {

CloudBlobContainer azureContainer = getAzureContainer();

if (azureContainer.createIfNotExists()) {
if (createBlobContainer && azureContainer.createIfNotExists()) {
LOG.info("New container created. containerName={}", containerName);
} else {
LOG.info("Reusing existing container. containerName={}", containerName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ public final class AzureConstants {
*/
public static final String AZURE_BLOB_CONTAINER_NAME = "container";

/**
* Azure create container if doesn't exist
*/
public static final String AZURE_CREATE_CONTAINER = "azureCreateContainer";

/**
* Azure blob storage request timeout
*/
Expand Down

0 comments on commit 94a392d

Please sign in to comment.