ierandra commented on code in PR #2409:
URL: https://github.com/apache/jackrabbit-oak/pull/2409#discussion_r2388302128


##########
oak-blob-cloud-azure/src/main/java/org/apache/jackrabbit/oak/blob/cloud/azure/blobstorage/AzureBlobStoreBackend.java:
##########
@@ -790,39 +687,43 @@ private static String getKeyName(DataIdentifier 
identifier) {
     private static String getIdentifierName(String key) {
         if (!key.contains(Utils.DASH)) {
             return null;
-        } else if (key.contains(META_KEY_PREFIX)) {
+        } else if (key.contains(AZURE_BLOB_META_KEY_PREFIX)) {
             return key;
         }
         return key.substring(0, 4) + key.substring(5);
     }
 
     private static String addMetaKeyPrefix(final String key) {
-        return META_KEY_PREFIX + key;
+        return AZURE_BLOB_META_KEY_PREFIX + key;
     }
 
     private static String stripMetaKeyPrefix(String name) {
-        if (name.startsWith(META_KEY_PREFIX)) {
-            return name.substring(META_KEY_PREFIX.length());
+        if (name.startsWith(AZURE_BLOB_META_KEY_PREFIX)) {
+            return name.substring(AZURE_BLOB_META_KEY_PREFIX.length());
         }
         return name;
     }
 
-    private static void addLastModified(CloudBlockBlob blob) {
-        blob.getMetadata().put(LAST_MODIFIED_KEY, 
String.valueOf(System.currentTimeMillis()));
+    private static void updateLastModifiedMetadata(BlockBlobClient 
blockBlobClient) {
+        BlobContainerClient blobContainerClient = 
blockBlobClient.getContainerClient();
+        Map<String, String> metadata = 
blobContainerClient.getProperties().getMetadata();
+        metadata.put(AZURE_BLOB_LAST_MODIFIED_KEY, 
String.valueOf(System.currentTimeMillis()));
+        blobContainerClient.setMetadata(metadata);
     }
 
-    private static long getLastModified(CloudBlob blob) {
-        if (blob.getMetadata().containsKey(LAST_MODIFIED_KEY)) {
-            return Long.parseLong(blob.getMetadata().get(LAST_MODIFIED_KEY));
+    private static long getLastModified(BlockBlobClient blobClient) {
+        BlobContainerProperties blobProperties = 
blobClient.getContainerClient().getProperties();

Review Comment:
   same as above, you are getting the **container** client and get the 
container metadata not the blob metadata.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to