pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] david-streamlio commented on a change in pull request #2865: Refactored JCloud Tiered Storage
Date Fri, 09 Nov 2018 00:13:15 GMT
david-streamlio commented on a change in pull request #2865: Refactored JCloud Tiered Storage
URL: https://github.com/apache/pulsar/pull/2865#discussion_r232106273
 
 

 ##########
 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:
   `    // build context for jclouds BlobStoreContext, mostly used in test
       @VisibleForTesting
       BlobStoreManagedLedgerOffloader(BlobStore blobStore, String container, OrderedScheduler
scheduler,
                                       int maxBlockSize, int readBufferSize) {
           this(blobStore, container, scheduler, maxBlockSize, readBufferSize, Maps.newHashMap());
       }
   
       BlobStoreManagedLedgerOffloader(BlobStore blobStore, String container, OrderedScheduler
scheduler,
                                       int maxBlockSize, int readBufferSize,
                                       Map<String, String> userMetadata) {
           this.offloadDriverName = "aws-s3";
           this.scheduler = scheduler;
           this.readBufferSize = readBufferSize;
           this.writeBucket = container;
           this.writeRegion = null;
           this.writeEndpoint = null;
           this.maxBlockSize = maxBlockSize;
           this.writeBlobStore = blobStore;
           this.writeLocation = null;
           this.userMetadata = userMetadata;
           this.credentials = null;
   
           readBlobStores.put(
               BlobStoreLocation.of(writeRegion, writeEndpoint),
               blobStore
           );
       }
   `
   
   This is the method in question that I replaced, it has a lot more issues that just only
being used for testing.  There are a lot of values set to NULL, the driver name is hard-coded,
which made testing for Azure REALLY difficult.  And lastly, it was also keeping an internal
Map of BlobStores, which is what the BlobStoreRepository does. 
   
   Putting this back in will create more issues than it solves.  

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message