You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by AsterixDB Code Review <do...@asterix-gerrit.ics.uci.edu> on 2025/03/31 01:31:43 UTC

Change in asterixdb[ionic]: [NO ISSUE][*DB][STO] += getCloudAccessTtl to ICloudGuardian

From Michael Blow <mb...@apache.org>:

Michael Blow has uploaded this change for review. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/19603 )


Change subject: [NO ISSUE][*DB][STO] += getCloudAccessTtl to ICloudGuardian
......................................................................

[NO ISSUE][*DB][STO] += getCloudAccessTtl to ICloudGuardian

Ext-ref: MB-65876
Change-Id: I129bd867fc6fe162bbad80efd5b888e547f5d8b5
---
M asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/clients/ICloudGuardian.java
1 file changed, 31 insertions(+), 0 deletions(-)



  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/03/19603/1

diff --git a/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/clients/ICloudGuardian.java b/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/clients/ICloudGuardian.java
index 2125cdd..ba0f1e7 100644
--- a/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/clients/ICloudGuardian.java
+++ b/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/clients/ICloudGuardian.java
@@ -18,6 +18,8 @@
  */
 package org.apache.asterix.cloud.clients;
 
+import java.util.concurrent.TimeUnit;
+
 /**
  * Interface containing methods to perform IO operation on the Cloud Storage
  */
@@ -41,8 +43,22 @@
      */
     void checkReadAccess(String bucket, String path);
 
+    /**
+     * Set the cloud client to be used for cloud operations.
+     *
+     * @param cloudClient the cloud client
+     */
     void setCloudClient(ICloudClient cloudClient);
 
+    /**
+     * Get the time-to-live (TTL) the guardian can assume we retain cloud access after a
+     * successful check before needing to refreshing the authorization.
+     *
+     * @param timeUnit the time unit for the TTL
+     * @return the TTL for cloud access
+     */
+    long getCloudAccessTtl(TimeUnit timeUnit);
+
     class NoOpCloudGuardian implements ICloudGuardian {
 
         public static final NoOpCloudGuardian INSTANCE = new NoOpCloudGuardian();
@@ -68,5 +84,10 @@
         @Override
         public void setCloudClient(ICloudClient cloudClient) {
         }
+
+        @Override
+        public long getCloudAccessTtl(TimeUnit timeUnit) {
+            return 0L;
+        }
     }
 }

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/19603
To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: ionic
Gerrit-Change-Id: I129bd867fc6fe162bbad80efd5b888e547f5d8b5
Gerrit-Change-Number: 19603
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Blow <mb...@apache.org>
Gerrit-MessageType: newchange