ivankelly commented on a change in pull request #1593: PIP-17:  the part of 
index block for offload.
URL: https://github.com/apache/incubator-pulsar/pull/1593#discussion_r185013023
 
 

 ##########
 File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/s3offload/OffloadIndexBlock.java
 ##########
 @@ -0,0 +1,69 @@
+/**
+ * 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.pulsar.broker.s3offload;
+
+import java.io.Closeable;
+import java.io.IOException;
+import java.io.InputStream;
+import org.apache.bookkeeper.client.api.LedgerMetadata;
+import 
org.apache.bookkeeper.common.annotation.InterfaceAudience.LimitedPrivate;
+import org.apache.bookkeeper.common.annotation.InterfaceStability.Unstable;
+
+/**
+ *
+ * The Index block abstraction used for offload a ledger to long term storage.
+ *
+ */
+@Unstable
+@LimitedPrivate
+public interface OffloadIndexBlock extends Closeable {
+
+    /**
+     * Get the content of the index block as InputStream.
+     * Read out in format:
+     *   | index_magic_header | index_block_len | index_entry_count |
+     *   |segment_metadata_length | segment metadata | index entries |
+     */
+    InputStream toStream() throws IOException;
+
+    /**
+     * Get the related OffloadIndexEntry that contains the given 
messageEntryId.
+     *
+     * @param messageEntryId
+     *                      the entry id of message
+     * @return the offload index entry
+     */
+    OffloadIndexEntry getIndexEntryForEntry(long messageEntryId);
+
+    /**
+     * Get the entry count that contained in this index Block.
+     */
+    int getEntryCount();
+
+    /**
+     * Get LedgerMetadata.
+     */
+    LedgerMetadata getLedgerMetadata();
+
+    /**
+     * Get Magic Word for index block.
+     */
+    int getIndexMagicWord();
 
 Review comment:
   Remove this from the interface.

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


With regards,
Apache Git Services

Reply via email to