You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/02/01 10:02:32 UTC

[GitHub] [pulsar] 315157973 commented on a change in pull request #9397: [ML] Make ManagedLedger storage configurable

315157973 commented on a change in pull request #9397:
URL: https://github.com/apache/pulsar/pull/9397#discussion_r567697024



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/storage/ManagedLedgerStorage.java
##########
@@ -0,0 +1,95 @@
+/**
+ * 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.storage;
+
+import java.io.IOException;
+import org.apache.bookkeeper.client.BookKeeper;
+import org.apache.bookkeeper.mledger.ManagedLedgerFactory;
+import org.apache.bookkeeper.stats.StatsProvider;
+import org.apache.pulsar.broker.BookKeeperClientFactory;
+import org.apache.pulsar.broker.ServiceConfiguration;
+import org.apache.pulsar.common.classification.InterfaceAudience.Private;
+import org.apache.pulsar.common.classification.InterfaceStability.Unstable;
+import org.apache.zookeeper.ZooKeeper;
+
+/**
+ * Storage to access {@link org.apache.bookkeeper.mledger.ManagedLedger}s.
+ */
+@Private
+@Unstable
+public interface ManagedLedgerStorage extends AutoCloseable {
+
+    /**
+     * Initialize the managed ledger storage.
+     *
+     * @param conf service config
+     * @param zkClient zk client
+     * @param bookkeperProvider bookkeeper provider
+     * @throws Exception
+     */
+    void initialize(ServiceConfiguration conf,

Review comment:
       If we wrap an object or abstract a client API, which has nothing to do with the storage medium, would it be better? 
   If it is abstract, we don’t have to use zk or bk.
   In the future, we will increase the storage type, only need to modify this object, and no need to modify the interface.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org