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/12/01 20:13:37 UTC

[GitHub] [pulsar] rdhabalia commented on a change in pull request #12770: PIP-45: Added BookKeeper metadata adapter based on MetadataStore

rdhabalia commented on a change in pull request #12770:
URL: https://github.com/apache/pulsar/pull/12770#discussion_r760536758



##########
File path: pulsar-metadata/src/test/java/org/apache/pulsar/metadata/bookkeeper/PulsarLedgerAuditorManagerTest.java
##########
@@ -0,0 +1,122 @@
+/**
+ * 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.metadata.bookkeeper;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import java.util.UUID;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+import java.util.function.Supplier;
+import lombok.Cleanup;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.bookkeeper.meta.LedgerAuditorManager;
+import org.apache.bookkeeper.net.BookieId;
+import org.apache.pulsar.metadata.BaseMetadataStoreTest;
+import org.apache.pulsar.metadata.api.MetadataStoreConfig;
+import org.apache.pulsar.metadata.api.extended.MetadataStoreExtended;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.Test;
+
+@Slf4j
+public class PulsarLedgerAuditorManagerTest extends BaseMetadataStoreTest {
+
+    private static final int managerVersion = 0xabcd;
+
+    private MetadataStoreExtended store1;
+    private MetadataStoreExtended store2;
+
+    private String ledgersRootPath;
+
+
+    private void methodSetup(Supplier<String> urlSupplier) throws Exception {
+        this.ledgersRootPath = "/ledgers-" + UUID.randomUUID();
+        this.store1 = MetadataStoreExtended.create(urlSupplier.get(), MetadataStoreConfig.builder().build());
+        this.store2 = MetadataStoreExtended.create(urlSupplier.get(), MetadataStoreConfig.builder().build());
+    }
+
+    @AfterMethod(alwaysRun = true)
+    public final void methodCleanup() throws Exception {
+        if (store1 != null) {
+            store1.close();
+            store1 = null;
+        }
+
+        if (store2 != null) {
+            store2.close();
+            store2 = null;
+        }
+    }
+
+    @Test(dataProvider = "impl")
+    public void testSimple(String provider, Supplier<String> urlSupplier) throws Exception {

Review comment:
       is it because `MetadataStoreExtended.create(..)` for RocksDB don't share the same file so, they don't sync with each other ?




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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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