ivankelly commented on a change in pull request #2865: Refactored JCloud Tiered 
Storage
URL: https://github.com/apache/pulsar/pull/2865#discussion_r231168068
 
 

 ##########
 File path: 
tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/provider/BlobStoreRepository.java
 ##########
 @@ -0,0 +1,85 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.bookkeeper.mledger.offload.jcloud.provider;
+
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+
+import org.jclouds.blobstore.BlobStore;
+
+/**
+ * Centralized storage location for all the Blobstore instances
+ * created and used for tiered-storage.
+ * <p>
+ * Users should first check to see if an existing Blobstore for the
+ * the given BlobStoreKey exists, and if so, use the existing one.
+ * Otherwise a new one will be created and added to the Repository
+ * </p>
+ */
+public class BlobStoreRepository {
 
 Review comment:
   What you describe, with passing the blobStore instance in is standard 
inversion of control or dependency injection. In general, it's a good thing to 
have, especially for unit testing.
   
   This repository is equivalent to a global variable.
   
   I think this should be changed back to use DI. Your concern about the create 
path not being tested is addressed by the whole thing being tested in the 
integration test.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to