This is an automated email from the ASF dual-hosted git repository.

mhubail pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 43b0b3ed28 [NO ISSUE][OTH] Fix bucket name in S3Mock
43b0b3ed28 is described below

commit 43b0b3ed28baca75e6b9f47ac0b72d95a837fa7d
Author: Murtadha Hubail <mhub...@apache.org>
AuthorDate: Sun May 14 21:17:25 2023 +0300

    [NO ISSUE][OTH] Fix bucket name in S3Mock
    
    - user model changes: no
    - storage format changes: no
    - interface changes: yes
    
    Details:
    
    - Fixed the bucket name in S3Mock to match the bucket name
      used in the mock cloud storage config.
    - Remove unused partitions count from ICloudStorageConfiguration.
    
    Change-Id: I16e3c8b16ccab843ff4737bc9cc4df488277045d
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17529
    Integration-Tests: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
    Tested-by: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
    Reviewed-by: Hussain Towaileb <hussai...@gmail.com>
---
 .../src/test/java/org/apache/asterix/api/common/CloudUtils.java    | 3 ++-
 .../asterix/cloud/storage/FileCloudStorageConfiguration.java       | 7 -------
 .../apache/asterix/cloud/storage/ICloudStorageConfiguration.java   | 5 -----
 .../asterix/cloud/storage/MockCloudStorageConfiguration.java       | 6 ------
 4 files changed, 2 insertions(+), 19 deletions(-)

diff --git 
a/asterixdb/asterix-app/src/test/java/org/apache/asterix/api/common/CloudUtils.java
 
b/asterixdb/asterix-app/src/test/java/org/apache/asterix/api/common/CloudUtils.java
index 5f13e0b33b..293a58041a 100644
--- 
a/asterixdb/asterix-app/src/test/java/org/apache/asterix/api/common/CloudUtils.java
+++ 
b/asterixdb/asterix-app/src/test/java/org/apache/asterix/api/common/CloudUtils.java
@@ -20,6 +20,7 @@ package org.apache.asterix.api.common;
 
 import java.net.URI;
 
+import org.apache.asterix.cloud.storage.MockCloudStorageConfiguration;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 
@@ -36,7 +37,7 @@ public class CloudUtils {
 
     private static final int MOCK_SERVER_PORT = 8001;
     private static final String MOCK_SERVER_HOSTNAME = "http://127.0.0.1:"; + 
MOCK_SERVER_PORT;
-    private static final String CLOUD_STORAGE_BUCKET = "cloud-storage-bucket";
+    private static final String CLOUD_STORAGE_BUCKET = 
MockCloudStorageConfiguration.INSTANCE.getContainer();
     private static final String MOCK_SERVER_REGION = "us-west-2";
     private static S3Mock s3MockServer;
 
diff --git 
a/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/storage/FileCloudStorageConfiguration.java
 
b/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/storage/FileCloudStorageConfiguration.java
index 7cee20a06d..ef75bba8e8 100644
--- 
a/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/storage/FileCloudStorageConfiguration.java
+++ 
b/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/storage/FileCloudStorageConfiguration.java
@@ -28,7 +28,6 @@ import org.apache.hyracks.api.exceptions.HyracksDataException;
 public class FileCloudStorageConfiguration implements 
ICloudStorageConfiguration {
 
     private final String containerName;
-    private final int storagePartitionsCount;
 
     public FileCloudStorageConfiguration(File file) throws 
HyracksDataException {
         if (!file.exists()) {
@@ -38,7 +37,6 @@ public class FileCloudStorageConfiguration implements 
ICloudStorageConfiguration
         try {
             List<String> lines = FileUtils.readLines(file, "UTF-8");
             this.containerName = lines.get(0);
-            this.storagePartitionsCount = Integer.parseInt(lines.get(1));
         } catch (IOException ex) {
             throw HyracksDataException.create(ex);
         }
@@ -48,9 +46,4 @@ public class FileCloudStorageConfiguration implements 
ICloudStorageConfiguration
     public String getContainer() {
         return containerName;
     }
-
-    @Override
-    public int getPartitionsCount() {
-        return storagePartitionsCount;
-    }
 }
diff --git 
a/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/storage/ICloudStorageConfiguration.java
 
b/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/storage/ICloudStorageConfiguration.java
index e140c7cd8a..356b2ef06d 100644
--- 
a/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/storage/ICloudStorageConfiguration.java
+++ 
b/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/storage/ICloudStorageConfiguration.java
@@ -29,9 +29,4 @@ public interface ICloudStorageConfiguration {
      * @return returns the container name used for the storage
      */
     String getContainer();
-
-    /**
-     * @return returns the number of storage partitions
-     */
-    int getPartitionsCount();
 }
diff --git 
a/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/storage/MockCloudStorageConfiguration.java
 
b/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/storage/MockCloudStorageConfiguration.java
index cf4f46fd96..1483739c4b 100644
--- 
a/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/storage/MockCloudStorageConfiguration.java
+++ 
b/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/storage/MockCloudStorageConfiguration.java
@@ -21,7 +21,6 @@ package org.apache.asterix.cloud.storage;
 public class MockCloudStorageConfiguration implements 
ICloudStorageConfiguration {
 
     private static final String CONTAINER_NAME = "cloud-storage-container";
-    private static final int NUMBER_OF_STORAGE_PARTITIONS = 8;
 
     public static MockCloudStorageConfiguration INSTANCE = new 
MockCloudStorageConfiguration();
 
@@ -33,9 +32,4 @@ public class MockCloudStorageConfiguration implements 
ICloudStorageConfiguration
     public String getContainer() {
         return CONTAINER_NAME;
     }
-
-    @Override
-    public int getPartitionsCount() {
-        return NUMBER_OF_STORAGE_PARTITIONS;
-    }
 }

Reply via email to