rishabhdaim commented on code in PR #2558:
URL: https://github.com/apache/jackrabbit-oak/pull/2558#discussion_r2416481682


##########
oak-blob-cloud/src/main/java/org/apache/jackrabbit/oak/blob/cloud/s3/S3Backend.java:
##########
@@ -496,39 +499,41 @@ public void setProperties(Properties properties) {
         setRemoteStorageMode();
     }
 
-    private void setRemoteStorageMode() {
-        String s3EndPoint = properties.getProperty(S3Constants.S3_END_POINT, 
"");
-        if (s3EndPoint.contains("googleapis")) {
-            if (properties.get(S3Constants.MODE) == RemoteStorageMode.S3) {
-                LOG.warn("Mismatch between remote storage mode and s3EndPoint, 
overriding mode to GCP");
-            }
-            properties.put(S3Constants.MODE, RemoteStorageMode.GCP);
-            return;
-        }
-        // default mode is S3
-        properties.put(S3Constants.MODE, RemoteStorageMode.S3);
-    }
-
     @Override
     public void addMetadataRecord(final InputStream input, final String name) 
throws DataStoreException {
         checkArgument(input != null, "input should not be null");
         checkArgument(!StringUtils.isEmpty(name), "name should not be empty");
 
         ClassLoader contextClassLoader = 
Thread.currentThread().getContextClassLoader();
 
+        // Executor required to handle reading from the InputStream on a 
separate thread so the main upload is not blocked.
+        final ExecutorService executor = Executors.newSingleThreadExecutor();

Review Comment:
   1. It was written in this way since the beginning, so I didn't update the 
logic.
   2. This thread pool is only used once, and in this method, so I don't think 
we should declare it at the global/class level.



-- 
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