pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] ivankelly commented on a change in pull request #2865: Refactored JCloud Tiered Storage
Date Tue, 30 Oct 2018 15:31:49 GMT
ivankelly commented on a change in pull request #2865: Refactored JCloud Tiered Storage
URL: https://github.com/apache/pulsar/pull/2865#discussion_r229357238
 
 

 ##########
 File path: tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/impl/DataBlockUtils.java
 ##########
 @@ -0,0 +1,77 @@
+/**
+ * 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.impl;
+
+import com.google.common.collect.ImmutableMap;
+
+import java.io.IOException;
+import java.util.Map;
+import java.util.UUID;
+
+import org.jclouds.blobstore.domain.Blob;
+import org.jclouds.blobstore.domain.BlobBuilder;
+
+/**
+ * Utility class for performing various Data Block functions including:
+ *    - Calculating the data block offload key
+ *    - Calculating the data block index key
+ *    - Adding version metadata information to a Data Block
+ *    - Validating the version metadata information of a Data Block.
+ *  <p>
+ *  Additional functions can be added in to future to tag Data Blocks with
+ *  information such as the compression algorithm used to compress the contents,
+ *  the md5 checksum of the content for validation, date published, etc.
+ *  </p>
+ */
+public class DataBlockUtils {
+
+    /**
+     * Version checking marker interface.
+     */
+    public interface VersionCheck {
+        void check(String key, Blob blob) throws IOException;
+    }
+
+    public static final String METADATA_FORMAT_VERSION_KEY = "ManagedLedgerOffloaderFormatVersion";
 
 Review comment:
   BC break here. It was originally called S3ManagedLedgerOffloaderFormatVersion, so any ledgers
which have been offload with a previous version will have it named as that. VERSION_CHECK
below will fail.
   
   The S3 stuff should have been renamed for GCS. You'll have to add BC handling for this.

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