From fc0abb7a44dbcb6c26cd9de2a42d1b28dcacbd80 Mon Sep 17 00:00:00 2001 From: ZhangJian He Date: Wed, 22 May 2024 12:59:30 +0800 Subject: [PATCH 1/2] fix typos in test java files Signed-off-by: ZhangJian He --- .../util/TestSharedResourceManager.java | 2 +- .../bookie/FileInfoBackingCache.java | 2 +- .../bookie/IndexPersistenceMgr.java | 2 +- .../bookkeeper/net/NetworkTopology.java | 2 +- .../bookkeeper/net/NetworkTopologyImpl.java | 2 +- .../cli/commands/bookies/InitCommand.java | 2 +- .../org/apache/bookkeeper/auth/TestAuth.java | 12 +++++----- .../bookie/BookieInitializationTest.java | 8 +++---- .../bookkeeper/bookie/CreateNewLogTest.java | 2 +- .../bookie/DefaultEntryLogTest.java | 6 ++--- .../bookie/IndexPersistenceMgrTest.java | 4 ++-- .../bookkeeper/bookie/LedgerCacheTest.java | 4 ++-- .../bookie/LedgerStorageCheckpointTest.java | 8 +++---- .../apache/bookkeeper/bookie/UpgradeTest.java | 12 +++++----- .../ldb/DbReadLedgerIndexEntriesTest.java | 4 ++-- .../client/BookKeeperCloseTest.java | 2 +- .../bookkeeper/client/BookKeeperTest.java | 6 ++--- .../client/BookieWriteLedgerTest.java | 2 +- .../bookkeeper/client/DeferredSyncTest.java | 2 +- .../GenericEnsemblePlacementPolicyTest.java | 2 +- .../bookkeeper/client/HandleFailuresTest.java | 4 ++-- .../client/LedgerRecovery2Test.java | 2 +- .../client/MetadataUpdateLoopTest.java | 4 ++-- .../client/MockBookKeeperTestCase.java | 16 +++++++------- .../client/ParallelLedgerRecoveryTest.java | 4 ++-- .../client/TestLedgerFragmentReplication.java | 22 +++++++++---------- .../TestRackawareEnsemblePlacementPolicy.java | 14 ++++++------ ...estRegionAwareEnsemblePlacementPolicy.java | 20 ++++++++--------- .../TestZoneawareEnsemblePlacementPolicy.java | 2 +- .../client/api/BookKeeperBuildersTest.java | 6 ++--- .../meta/LedgerManagerIteratorTest.java | 4 ++-- .../meta/LedgerManagerTestCase.java | 2 +- .../net/NetworkTopologyImplTest.java | 4 ++-- .../proto/NetworkLessBookieTest.java | 2 +- .../apache/bookkeeper/proto/TestBKStats.java | 2 +- .../proto/WriteEntryProcessorV3Test.java | 2 +- ...ompositeByteBufUnwrapBugReproduceTest.java | 2 +- .../TestLedgerUnderreplicationManager.java | 2 +- .../bookkeeper/test/BookieClientTest.java | 2 +- .../bookkeeper/test/BookieReadWriteTest.java | 2 +- .../test/ForceReadOnlyBookieTest.java | 8 +++---- .../ConcurrentLongLongHashMapTest.java | 2 +- .../ConcurrentLongLongPairHashMapTest.java | 2 +- .../zookeeper/TestZooKeeperClient.java | 2 +- docker/Makefile | 2 +- .../prometheus/TestPrometheusFormatter.java | 2 +- .../clients/StorageClientImplTest.java | 2 +- .../apache/distributedlog/net/NetUtils.java | 2 +- .../TestAppendOnlyStreamWriter.java | 2 +- .../distributedlog/TestAsyncReaderLock.java | 2 +- .../TestBKDistributedLogManager.java | 2 +- .../TestBKLogSegmentWriter.java | 16 +++++++------- .../TestReadAheadEntryReader.java | 2 +- .../bk/TestLedgerAllocator.java | 4 ++-- .../bk/TestLedgerAllocatorPool.java | 2 +- .../lock/TestZKSessionLock.java | 2 +- .../tools/TestDistributedLogTool.java | 2 +- .../apache/distributedlog/util/TestUtils.java | 2 +- stream/proto/src/main/proto/kv_rpc.proto | 2 +- .../checkpoint/RocksCheckpointerTest.java | 2 +- .../cluster/ClusterControllerLeaderImpl.java | 10 ++++----- .../ClusterControllerLeaderImplTest.java | 14 ++++++------ .../InMemClusterMetadataStoreTest.java | 2 +- .../cluster/ZkClusterMetadataStoreTest.java | 2 +- ...TestCompatHierarchicalLedgerManager.groovy | 2 +- ...stCompatUpgradeWithHostnameBookieId.groovy | 2 +- .../cli/commands/cookie/AdminCommandTest.java | 4 ++-- .../GenerateCookieCommandIndexTest.java | 10 ++++----- 68 files changed, 156 insertions(+), 156 deletions(-) diff --git a/bookkeeper-common/src/test/java/org/apache/bookkeeper/common/util/TestSharedResourceManager.java b/bookkeeper-common/src/test/java/org/apache/bookkeeper/common/util/TestSharedResourceManager.java index fab622f0c7b..be09259aed1 100644 --- a/bookkeeper-common/src/test/java/org/apache/bookkeeper/common/util/TestSharedResourceManager.java +++ b/bookkeeper-common/src/test/java/org/apache/bookkeeper/common/util/TestSharedResourceManager.java @@ -98,7 +98,7 @@ public void destroyResourceWhenRefCountReachesZero() { assertEquals(SharedResourceManager.DESTROY_DELAY_SECONDS, scheduledDestroyTask.getDelay(TimeUnit.SECONDS)); - // Simluate that the destroyer executes the foo destroying task + // Simulate that the destroyer executes the foo destroying task scheduledDestroyTask.runTask(); assertTrue(sharedFoo.closed); diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileInfoBackingCache.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileInfoBackingCache.java index 172e192abf0..266595b1587 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileInfoBackingCache.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileInfoBackingCache.java @@ -66,7 +66,7 @@ CachedFileInfo loadFileInfo(long ledgerId, byte[] masterKey) throws IOException // and if it is called (and succeeds) the fi will have been // removed from fileInfos at the same time, so we should not // have been able to get a reference to it here. - // The caller of loadFileInfo owns the refence, and is + // The caller of loadFileInfo owns the reference, and is // responsible for calling the corresponding #release(). return tryRetainFileInfo(fi); } diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/IndexPersistenceMgr.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/IndexPersistenceMgr.java index 69b877642d3..220f81eb8a3 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/IndexPersistenceMgr.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/IndexPersistenceMgr.java @@ -661,7 +661,7 @@ long getPersistEntryBeyondInMem(long ledgerId, long lastEntryInMem) throws IOExc fi = getFileInfo(ledgerId, null); long size = fi.size(); // make sure the file size is aligned with index entry size - // otherwise we may read incorret data + // otherwise we may read incorrect data if (0 != size % LedgerEntryPage.getIndexEntrySize()) { LOG.warn("Index file of ledger {} is not aligned with index entry size.", ledgerId); size = size - size % LedgerEntryPage.getIndexEntrySize(); diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/net/NetworkTopology.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/net/NetworkTopology.java index 70a1032ce83..bb686dd9e95 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/net/NetworkTopology.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/net/NetworkTopology.java @@ -41,7 +41,7 @@ public interface NetworkTopology { void add(Node node); /** - * Remove a node from nework topology. + * Remove a node from network topology. * * @param node * remove the node from network topology diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/net/NetworkTopologyImpl.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/net/NetworkTopologyImpl.java index ff5704407a4..82890dedc18 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/net/NetworkTopologyImpl.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/net/NetworkTopologyImpl.java @@ -162,7 +162,7 @@ private String getNextAncestorName(Node n) { boolean add(Node n) { if (!isAncestor(n)) { throw new IllegalArgumentException(n.getName() + ", which is located at " + n.getNetworkLocation() - + ", is not a decendent of " + getPath(this)); + + ", is not a descendent of " + getPath(this)); } if (isParent(n)) { // this node is the parent of n; add n directly diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/tools/cli/commands/bookies/InitCommand.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/tools/cli/commands/bookies/InitCommand.java index 8846f548387..84f7c013e62 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/tools/cli/commands/bookies/InitCommand.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/tools/cli/commands/bookies/InitCommand.java @@ -26,7 +26,7 @@ import org.apache.bookkeeper.tools.framework.CliSpec; /** - * Intializes new cluster by creating required znodes for the cluster. If + * Initializes new cluster by creating required znodes for the cluster. If * ledgersrootpath is already existing then it will error out. If for any * reason it errors out while creating znodes for the cluster, then before * running initnewcluster again, try nuking existing cluster by running diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/auth/TestAuth.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/auth/TestAuth.java index 5b15471c8ee..5b4ed570002 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/auth/TestAuth.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/auth/TestAuth.java @@ -273,7 +273,7 @@ public void testMultiMessageAuthFailure() throws Exception { fail("Shouldn't get this far"); } catch (BKException.BKUnauthorizedAccessException bke) { // bookie should have sent a negative response before - // breaking the conneciton + // breaking the connection } assertFalse(ledgerId.get() == -1); assertEquals("Shouldn't have entry", 0, entryCount(ledgerId.get(), bookieConf, clientConf)); @@ -300,7 +300,7 @@ public void testDifferentPluginFailure() throws Exception { fail("Shouldn't get this far"); } catch (BKException.BKUnauthorizedAccessException bke) { // bookie should have sent a negative response before - // breaking the conneciton + // breaking the connection assertEquals(ProtocolVersion.ProtocolV3, protocolVersion); } catch (BKException.BKNotEnoughBookiesException nebe) { // With V2 we don't get the authorization error, but rather just @@ -316,7 +316,7 @@ public void testDifferentPluginFailure() throws Exception { * doesn't implement the interface, we fail predictably. */ @Test - public void testExistantButNotValidPlugin() throws Exception { + public void testExistentButNotValidPlugin() throws Exception { ServerConfiguration bookieConf = newServerConfiguration(); bookieConf.setBookieAuthProviderFactoryClass( "java.lang.String"); @@ -351,14 +351,14 @@ public void testExistantButNotValidPlugin() throws Exception { * break. */ @Test - public void testNonExistantPlugin() throws Exception { + public void testNonExistentPlugin() throws Exception { ServerConfiguration bookieConf = newServerConfiguration(); bookieConf.setBookieAuthProviderFactoryClass( - "NonExistantClassNameForTestingAuthPlugins"); + "NonExistentClassNameForTestingAuthPlugins"); ClientConfiguration clientConf = newClientConfiguration(); clientConf.setClientAuthProviderFactoryClass( - "NonExistantClassNameForTestingAuthPlugins"); + "NonExistentClassNameForTestingAuthPlugins"); try { startAndStoreBookie(bookieConf); fail("Shouldn't get this far"); diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/BookieInitializationTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/BookieInitializationTest.java index 5188eb816bb..1b7aa371a82 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/BookieInitializationTest.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/BookieInitializationTest.java @@ -324,7 +324,7 @@ public void testBookieRegistrationWithSameZooKeeperClient() throws Exception { "Bookie registration node doesn't exists!", rm.isBookieRegistered(bookieId)); - // test register bookie again if the registeration node is created by itself. + // test register bookie again if the registration node is created by itself. manager.registerBookie(true).get(); assertTrue( "Bookie registration node doesn't exists!", @@ -742,11 +742,11 @@ bkConf, new TestBookieImpl(conf), * OutOfMemoryError. */ public static class MockInterleavedLedgerStorage extends InterleavedLedgerStorage { - AtomicInteger atmoicInt = new AtomicInteger(0); + AtomicInteger atomicInt = new AtomicInteger(0); @Override public long addEntry(ByteBuf entry) throws IOException { - if (atmoicInt.incrementAndGet() == 10) { + if (atomicInt.incrementAndGet() == 10) { throw new OutOfMemoryError("Some Injected Exception"); } return super.addEntry(entry); @@ -1676,7 +1676,7 @@ private void bookieConnectAfterCookieDeleteWorker(ServerConfiguration conf, Regi final BookieId bookieAddress = BookieImpl.getBookieId(conf); - // Read cookie from registation manager + // Read cookie from registration manager Versioned rmCookie = Cookie.readFromRegistrationManager(rm, bookieAddress); // Shutdown bookie diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CreateNewLogTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CreateNewLogTest.java index 4d7015876b7..4190feaeda9 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CreateNewLogTest.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CreateNewLogTest.java @@ -862,7 +862,7 @@ public List getWritableLedgerDirsForNewLog() throws NoWritableLedgerDirExc /* * In a new thread, create newlog for 'firstLedgerId' and then set * 'newLogCreated' to true. Since this is the first createNewLog call, - * it is going to be blocked untill latch is countdowned to 0. + * it is going to be blocked until latch is countdowned to 0. */ new Thread() { @Override diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/DefaultEntryLogTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/DefaultEntryLogTest.java index 3048ef33a8c..4b92df528fe 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/DefaultEntryLogTest.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/DefaultEntryLogTest.java @@ -1382,7 +1382,7 @@ public void testExpiryRemovalByAccessingNonCacheRelatedMethods() throws Exceptio BufferedLogChannel newLogChannel = createDummyBufferedLogChannel(entryLogger, 1, conf); entryLogManager.setCurrentLogForLedgerAndAddToRotate(ledgerId, newLogChannel); - AtomicBoolean exceptionOccured = new AtomicBoolean(false); + AtomicBoolean exceptionOccurred = new AtomicBoolean(false); Thread t = new Thread() { public void run() { try { @@ -1402,7 +1402,7 @@ public void run() { entryLogManager.getCurrentLogIfPresent(newLedgerId); } catch (Exception e) { LOG.error("Got Exception in thread", e); - exceptionOccured.set(true); + exceptionOccurred.set(true); } } }; @@ -1410,7 +1410,7 @@ public void run() { t.start(); Thread.sleep(evictionPeriod * 1000 + 100); entryLogManager.doEntryLogMapCleanup(); - Assert.assertFalse("Exception occured in thread, which is not expected", exceptionOccured.get()); + Assert.assertFalse("Exception occurred in thread, which is not expected", exceptionOccurred.get()); /* * since for more than evictionPeriod, that ledger is not accessed and cache is cleaned up, mapping for that diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/IndexPersistenceMgrTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/IndexPersistenceMgrTest.java index d5296c39aca..0635d1dd213 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/IndexPersistenceMgrTest.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/IndexPersistenceMgrTest.java @@ -164,7 +164,7 @@ public void testGetFileInfoReadBeforeWrite() throws Exception { indexPersistenceMgr.getFileInfo(lid, null); fail("Should fail get file info for reading if the file doesn't exist"); } catch (Bookie.NoLedgerException nle) { - // exepcted + // expected } assertEquals(0, indexPersistenceMgr.writeFileInfoCache.size()); assertEquals(0, indexPersistenceMgr.readFileInfoCache.size()); @@ -468,7 +468,7 @@ void validateFileInfo(IndexPersistenceMgr indexPersistenceMgr, long ledgerId, in assertEquals("explicitLac ByteBuf contents should match", 0, ByteBufUtil.compare(explicitLacByteBuf, indexPersistenceMgr.getExplicitLac(ledgerId))); /* - * release fileInfo untill it is marked dead and closed, so that + * release fileInfo until it is marked dead and closed, so that * contents of it are persisted. */ while (fileInfo.refCount.get() != FileInfoBackingCache.DEAD_REF) { diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/LedgerCacheTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/LedgerCacheTest.java index 4e8f06fe7f4..d854e3b837b 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/LedgerCacheTest.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/LedgerCacheTest.java @@ -225,7 +225,7 @@ public void testPageEviction() throws Exception { // create ledger cache newLedgerCache(); try { - // create serveral ledgers + // create several ledgers for (int i = 1; i <= numLedgers; i++) { ledgerCache.setMasterKey((long) i, masterKey); ledgerCache.putEntryOffset(i, 0, i * 8); @@ -237,7 +237,7 @@ public void testPageEviction() throws Exception { // flush all ledgerCache.flushLedger(true); - // delete serveral ledgers + // delete several ledgers for (int i = 1; i <= numLedgers / 2; i++) { ledgerCache.deleteLedger(i); } diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/LedgerStorageCheckpointTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/LedgerStorageCheckpointTest.java index c468d2c2dc6..f84644aba10 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/LedgerStorageCheckpointTest.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/LedgerStorageCheckpointTest.java @@ -261,7 +261,7 @@ conf, new TestBookieImpl(conf), LogMark curMarkAfterFirstSetOfAdds = lastLogMarkAfterFirstSetOfAdds.getCurMark(); File lastMarkFile = new File(ledgerDir, "lastMark"); - // lastMark file should be zero, because checkpoint hasn't happenend + // lastMark file should be zero, because checkpoint hasn't happened LogMark logMarkFileBeforeCheckpoint = readLastMarkFile(lastMarkFile); Assert.assertEquals("lastMarkFile before checkpoint should be zero", 0, logMarkFileBeforeCheckpoint.compare(new LogMark())); @@ -282,7 +282,7 @@ conf, new TestBookieImpl(conf), LogMark curMarkAfterCheckpoint = lastLogMarkAfterCheckpoint.getCurMark(); LogMark rolledLogMark = readLastMarkFile(lastMarkFile); - Assert.assertNotEquals("rolledLogMark should not be zero, since checkpoint has happenend", 0, + Assert.assertNotEquals("rolledLogMark should not be zero, since checkpoint has happened", 0, rolledLogMark.compare(new LogMark())); /* * Curmark should be equal before and after checkpoint, because we didnt @@ -558,7 +558,7 @@ conf, new TestBookieImpl(conf), executorController.advance(Duration.ofMillis(conf.getFlushInterval())); /* - * since checkpoint happenend, there shouldn't be any logChannelsToFlush + * since checkpoint happened, there shouldn't be any logChannelsToFlush * and bytesWrittenSinceLastFlush should be zero. */ List copyOfRotatedLogChannels = entryLogManager.getRotatedLogChannels(); @@ -673,7 +673,7 @@ conf, new TestBookieImpl(conf), Assert.assertTrue("lastMark file must be existing, because checkpoint should have happened", lastMarkFile.exists()); LogMark rolledLogMark = readLastMarkFile(lastMarkFile); - Assert.assertNotEquals("rolledLogMark should not be zero, since checkpoint has happenend", 0, + Assert.assertNotEquals("rolledLogMark should not be zero, since checkpoint has happened", 0, rolledLogMark.compare(new LogMark())); bkClient.close(); diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/UpgradeTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/UpgradeTest.java index e484f91133b..5db649e53ad 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/UpgradeTest.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/UpgradeTest.java @@ -185,7 +185,7 @@ static File initV2LedgerDirectoryWithIndexDir(File ledgerDir, File indexDir) thr return ledgerDir; } - private static void testUpgradeProceedure(String zkServers, String journalDir, String ledgerDir, String indexDir) + private static void testUpgradeProcedure(String zkServers, String journalDir, String ledgerDir, String indexDir) throws Exception { ServerConfiguration conf = TestBKConfiguration.newServerConfiguration(); conf.setMetadataServiceUri("zk://" + zkServers + "/ledgers"); @@ -250,7 +250,7 @@ private static void testUpgradeProceedure(String zkServers, String journalDir, S public void testUpgradeV1toCurrent() throws Exception { File journalDir = initV1JournalDirectory(tmpDirs.createNew("bookie", "journal")); File ledgerDir = initV1LedgerDirectory(tmpDirs.createNew("bookie", "ledger")); - testUpgradeProceedure(zkUtil.getZooKeeperConnectString(), journalDir.getPath(), + testUpgradeProcedure(zkUtil.getZooKeeperConnectString(), journalDir.getPath(), ledgerDir.getPath(), ledgerDir.getPath()); } @@ -260,7 +260,7 @@ public void testUpgradeV1toCurrentWithIndexDir() throws Exception { File indexDir = tmpDirs.createNew("bookie", "index"); File ledgerDir = initV1LedgerDirectoryWithIndexDir( tmpDirs.createNew("bookie", "ledger"), indexDir); - testUpgradeProceedure(zkUtil.getZooKeeperConnectString(), journalDir.getPath(), + testUpgradeProcedure(zkUtil.getZooKeeperConnectString(), journalDir.getPath(), ledgerDir.getPath(), indexDir.getPath()); } @@ -269,7 +269,7 @@ public void testUpgradeV2toCurrent() throws Exception { File journalDir = initV2JournalDirectory(tmpDirs.createNew("bookie", "journal")); File ledgerDir = initV2LedgerDirectory(tmpDirs.createNew("bookie", "ledger")); File indexDir = tmpDirs.createNew("bookie", "index"); - testUpgradeProceedure(zkUtil.getZooKeeperConnectString(), journalDir.getPath(), + testUpgradeProcedure(zkUtil.getZooKeeperConnectString(), journalDir.getPath(), ledgerDir.getPath(), indexDir.getPath()); } @@ -279,7 +279,7 @@ public void testUpgradeV2toCurrentWithIndexDir() throws Exception { File indexDir = tmpDirs.createNew("bookie", "index"); File ledgerDir = initV2LedgerDirectoryWithIndexDir( tmpDirs.createNew("bookie", "ledger"), indexDir); - testUpgradeProceedure(zkUtil.getZooKeeperConnectString(), journalDir.getPath(), + testUpgradeProcedure(zkUtil.getZooKeeperConnectString(), journalDir.getPath(), ledgerDir.getPath(), indexDir.getPath()); } @@ -304,7 +304,7 @@ public void testUpgradeCurrent(boolean hasIndexDir) throws Exception { initV2LedgerDirectory(ledgerDir); } - testUpgradeProceedure(zkUtil.getZooKeeperConnectString(), journalDir.getPath(), + testUpgradeProcedure(zkUtil.getZooKeeperConnectString(), journalDir.getPath(), ledgerDir.getPath(), indexDir.getPath()); // Upgrade again diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/storage/ldb/DbReadLedgerIndexEntriesTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/storage/ldb/DbReadLedgerIndexEntriesTest.java index c4ee2a8326f..585764a075d 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/storage/ldb/DbReadLedgerIndexEntriesTest.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/storage/ldb/DbReadLedgerIndexEntriesTest.java @@ -125,8 +125,8 @@ public void testReadLedgerIndexEntries() throws Exception { try { for (ledgerId = TEST_LEDGER_MIN_ID; ledgerId <= TEST_LEDGER_MAX_ID; ledgerId++) { BlockingQueue entrys = new ArrayBlockingQueue<>(TEST_ENTRY_MAX_ID + 1); - DbLedgerStorage.readLedgerIndexEntries(ledgerId, conf, (eId, entryLodId, pos) -> { - System.out.println("entry " + eId + "\t:\t(log: " + entryLodId + ", pos: " + pos + ")"); + DbLedgerStorage.readLedgerIndexEntries(ledgerId, conf, (eId, entryLogId, pos) -> { + System.out.println("entry " + eId + "\t:\t(log: " + entryLogId + ", pos: " + pos + ")"); entrys.add(eId); }); for (long entryId = TEST_ENTRY_MIN_ID; entryId <= TEST_ENTRY_MAX_ID; entryId++) { diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperCloseTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperCloseTest.java index 2dd5e544418..e9db5b9d736 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperCloseTest.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperCloseTest.java @@ -151,7 +151,7 @@ public void createComplete(int rc, LedgerHandle lh, Object ctx) { // wait for creating the ledger assertTrue("create ledger call should have completed", openLatch.await(20, TimeUnit.SECONDS)); - assertEquals("Succesfully created ledger through closed bkclient!", + assertEquals("Successfully created ledger through closed bkclient!", BKException.Code.ClientClosedException, returnCode.get()); } diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperTest.java index 78a762f8e17..45647079d84 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperTest.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperTest.java @@ -218,7 +218,7 @@ public void testAsyncReadWithError() throws Exception { final AtomicInteger result = new AtomicInteger(0); final CountDownLatch counter = new CountDownLatch(1); - // Try to write, we shoud get and error callback but not an exception + // Try to write, we should get and error callback but not an exception lh.asyncAddEntry("test".getBytes(), new AddCallback() { public void addComplete(int rc, LedgerHandle lh, long entryId, Object ctx) { result.set(rc); @@ -398,7 +398,7 @@ public void testReadAfterLastAddConfirmed() throws Exception { // without readUnconfirmedEntries we are not able to read all of the entries try { rlh.readEntries(0, numOfEntries - 1); - fail("shoud not be able to read up to " + (numOfEntries - 1) + " with readEntries"); + fail("should not be able to read up to " + (numOfEntries - 1) + " with readEntries"); } catch (BKException.BKReadException expected) { } @@ -480,7 +480,7 @@ public void testReadAfterLastAddConfirmed() throws Exception { // without readUnconfirmedEntries we are not able to read all of the entries try { rlh.readEntries(0, numOfEntries - 1); - fail("shoud not be able to read up to " + (numOfEntries - 1) + " with readEntries"); + fail("should not be able to read up to " + (numOfEntries - 1) + " with readEntries"); } catch (BKException.BKReadException expected) { } diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookieWriteLedgerTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookieWriteLedgerTest.java index 52d1326af33..ea0d1b56b49 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookieWriteLedgerTest.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookieWriteLedgerTest.java @@ -466,7 +466,7 @@ public void testLedgerCreateAdvAndWriteNonAdv() throws Exception { } /** - * Verify that LedgerHandleAdv cannnot handle addEntry without the entryId. + * Verify that LedgerHandleAdv cannot handle addEntry without the entryId. * * @throws Exception */ diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/DeferredSyncTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/DeferredSyncTest.java index dabf2b6088c..a49b5775945 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/DeferredSyncTest.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/DeferredSyncTest.java @@ -146,7 +146,7 @@ public void testForceRequiresFullEnsemble() throws Exception { } @Test - public void testForceWillAdvanceLacOnlyUpToLastAcknoledgedWrite() throws Exception { + public void testForceWillAdvanceLacOnlyUpToLastAcknowledgedWrite() throws Exception { try (WriteHandle wh = result(newCreateLedgerOp() .withEnsembleSize(3) .withWriteQuorumSize(3) diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/GenericEnsemblePlacementPolicyTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/GenericEnsemblePlacementPolicyTest.java index 094cf064ef1..9a30b5930d0 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/GenericEnsemblePlacementPolicyTest.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/GenericEnsemblePlacementPolicyTest.java @@ -113,7 +113,7 @@ public void testNewEnsemble() throws Exception { } @Test - public void testNewEnsembleWithNotEnoughtBookies() throws Exception { + public void testNewEnsembleWithNotEnoughBookies() throws Exception { numBookies = 0; try { startBKCluster(zkUtil.getMetadataServiceUri()); diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/HandleFailuresTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/HandleFailuresTest.java index 8e8f5649dad..d1182668e9c 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/HandleFailuresTest.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/HandleFailuresTest.java @@ -171,7 +171,7 @@ public void testHandlingFailuresOneBookieFailsAfterOneEntry() throws Exception { } @Test(timeout = 30000) - public void testHandlingFailuresMultipleBookieFailImmediatelyNotEnoughToReplace() throws Exception { + public void testHandlingFailuresMultipleBookieFailImmediatelyNotEnoughoReplace() throws Exception { MockClientContext clientCtx = MockClientContext.create(); Versioned md = ClientUtil.setupLedger(clientCtx, 10L, LedgerMetadataBuilder.create() @@ -197,7 +197,7 @@ public void testHandlingFailuresMultipleBookieFailImmediatelyNotEnoughToReplace( } @Test(timeout = 30000) - public void testHandlingFailuresMultipleBookieFailAfterOneEntryNotEnoughToReplace() throws Exception { + public void testHandlingFailuresMultipleBookieFailAfterOneEntryNotEnoughoReplace() throws Exception { MockClientContext clientCtx = MockClientContext.create(); Versioned md = ClientUtil.setupLedger(clientCtx, 10L, LedgerMetadataBuilder.create() diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/LedgerRecovery2Test.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/LedgerRecovery2Test.java index 59025f42f3b..22112cbc608 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/LedgerRecovery2Test.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/LedgerRecovery2Test.java @@ -294,7 +294,7 @@ public void testRecoveryTwoBookiesFailOnSameEntry() throws Exception { } /** - * This test verifies the fix for the data loss scenario found by the TLA+ specfication, specifically + * This test verifies the fix for the data loss scenario found by the TLA+ specification, specifically * the invariant violation that metadata and writer can diverge. The scenario is that the original writer * can commit an entry e that will later be lost because a second writer can close the ledger at e-1. * The cause is that fencing was originally only performed on LAC reads which is not enough to prevent diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/MetadataUpdateLoopTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/MetadataUpdateLoopTest.java index 5b7db179b10..ed97b4af52a 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/MetadataUpdateLoopTest.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/MetadataUpdateLoopTest.java @@ -98,7 +98,7 @@ public void testBasicUpdate() throws Exception { } /** - * Test that when 2 update loops conflict when making diffent updates to the metadata, + * Test that when 2 update loops conflict when making different updates to the metadata, * both will eventually succeed, and both updates will be reflected in the final metadata. */ @Test @@ -446,7 +446,7 @@ public synchronized CompletableFuture> writeLedgerMeta .whenComplete((written, exception) -> { synchronized (DeferCallbacksMockLedgerManager.this) { if (writeCount++ < numToDefer) { - LOG.info("Added to deferals"); + LOG.info("Added to deferrals"); deferred.add(Triple.of(promise, written, exception)); } else { LOG.info("Completing {}", numToDefer); diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/MockBookKeeperTestCase.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/MockBookKeeperTestCase.java index e1881d74771..d5a4f05c24a 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/MockBookKeeperTestCase.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/MockBookKeeperTestCase.java @@ -484,8 +484,8 @@ private void setupWriteLedgerMetadata() { @SuppressWarnings("unchecked") protected void setupBookieClientReadEntry() { - final Stubber stub = doAnswer(invokation -> { - Object[] args = invokation.getArguments(); + final Stubber stub = doAnswer(invocation -> { + Object[] args = invocation.getArguments(); BookieId bookieSocketAddress = (BookieId) args[0]; long ledgerId = (Long) args[1]; long entryId = (Long) args[2]; @@ -544,8 +544,8 @@ protected void setupBookieClientReadEntry() { @SuppressWarnings("unchecked") protected void setupBookieClientReadLac() { - final Stubber stub = doAnswer(invokation -> { - Object[] args = invokation.getArguments(); + final Stubber stub = doAnswer(invocation -> { + Object[] args = invocation.getArguments(); BookieId bookieSocketAddress = (BookieId) args[0]; long ledgerId = (Long) args[1]; final BookkeeperInternalCallbacks.ReadLacCallback callback = @@ -589,8 +589,8 @@ private byte[] extractEntryPayload(long ledgerId, long entryId, ByteBufList toSe @SuppressWarnings("unchecked") protected void setupBookieClientAddEntry() { - final Stubber stub = doAnswer(invokation -> { - Object[] args = invokation.getArguments(); + final Stubber stub = doAnswer(invocation -> { + Object[] args = invocation.getArguments(); BookkeeperInternalCallbacks.WriteCallback callback = (BookkeeperInternalCallbacks.WriteCallback) args[5]; BookieId bookieSocketAddress = (BookieId) args[0]; long ledgerId = (Long) args[1]; @@ -646,8 +646,8 @@ protected void setupBookieClientAddEntry() { @SuppressWarnings("unchecked") protected void setupBookieClientForceLedger() { - final Stubber stub = doAnswer(invokation -> { - Object[] args = invokation.getArguments(); + final Stubber stub = doAnswer(invocation -> { + Object[] args = invocation.getArguments(); BookieId bookieSocketAddress = (BookieId) args[0]; long ledgerId = (Long) args[1]; BookkeeperInternalCallbacks.ForceLedgerCallback callback = diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/ParallelLedgerRecoveryTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/ParallelLedgerRecoveryTest.java index 4efc4465e38..78dd64f0b49 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/ParallelLedgerRecoveryTest.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/ParallelLedgerRecoveryTest.java @@ -338,7 +338,7 @@ public void addComplete(int rc, LedgerHandle lh, long entryId, Object ctx) { LOG.info("Added {} entries to ledger {}.", numEntries, lh.getId()); - long ledgerLenth = lh.getLength(); + long ledgerLength = lh.getLength(); LedgerHandle recoverLh = newBk.openLedgerNoRecovery(lh.getId(), digestType, "".getBytes()); assertEquals(BookieProtocol.INVALID_ENTRY_ID, recoverLh.getLastAddPushed()); @@ -395,7 +395,7 @@ public void operationComplete(int rc, Void result) { assertTrue(success.get()); assertEquals(numEntries - 1, recoverLh.getLastAddPushed()); assertEquals(numEntries - 1, recoverLh.getLastAddConfirmed()); - assertEquals(ledgerLenth, recoverLh.getLength()); + assertEquals(ledgerLength, recoverLh.getLength()); assertTrue(recoverLh.getLedgerMetadata().isClosed()); Enumeration enumeration = recoverLh.readEntries(0, numEntries - 1); diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestLedgerFragmentReplication.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestLedgerFragmentReplication.java index b67caaae172..cea98d9492f 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestLedgerFragmentReplication.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestLedgerFragmentReplication.java @@ -381,23 +381,23 @@ public void testSplitLedgerFragmentState() throws Exception { * In the second sub-fragment firstEntryID, firstStoredEntryId, * lastKnownEntryID and lastStoredEntryId should be 10. */ - Set partionedFragments = LedgerFragmentReplicator.splitIntoSubFragments(lh, lfrag, + Set partitionedFragments = LedgerFragmentReplicator.splitIntoSubFragments(lh, lfrag, rereplicationEntryBatchSize); - assertEquals("Number of sub-fragments", 2, partionedFragments.size()); - for (LedgerFragment partionedFragment : partionedFragments) { - if (partionedFragment.getFirstEntryId() == 0) { - validateEntryIds(partionedFragment, 0, 0, 9, 8); + assertEquals("Number of sub-fragments", 2, partitionedFragments.size()); + for (LedgerFragment partitionedFragment : partitionedFragments) { + if (partitionedFragment.getFirstEntryId() == 0) { + validateEntryIds(partitionedFragment, 0, 0, 9, 8); } else { - validateEntryIds(partionedFragment, 10, 10, 10, 10); + validateEntryIds(partitionedFragment, 10, 10, 10, 10); } } } - private void validateEntryIds(LedgerFragment partionedFragment, long expectedFirstEntryId, + private void validateEntryIds(LedgerFragment partitionedFragment, long expectedFirstEntryId, long expectedFirstStoredEntryId, long expectedLastKnownEntryID, long expectedLastStoredEntryId) { - assertEquals("FirstEntryId", expectedFirstEntryId, partionedFragment.getFirstEntryId()); - assertEquals("FirstStoredEntryId", expectedFirstStoredEntryId, partionedFragment.getFirstStoredEntryId()); - assertEquals("LastKnownEntryID", expectedLastKnownEntryID, partionedFragment.getLastKnownEntryId()); - assertEquals("LastStoredEntryId", expectedLastStoredEntryId, partionedFragment.getLastStoredEntryId()); + assertEquals("FirstEntryId", expectedFirstEntryId, partitionedFragment.getFirstEntryId()); + assertEquals("FirstStoredEntryId", expectedFirstStoredEntryId, partitionedFragment.getFirstStoredEntryId()); + assertEquals("LastKnownEntryID", expectedLastKnownEntryID, partitionedFragment.getLastKnownEntryId()); + assertEquals("LastStoredEntryId", expectedLastStoredEntryId, partitionedFragment.getLastStoredEntryId()); } } diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestRackawareEnsemblePlacementPolicy.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestRackawareEnsemblePlacementPolicy.java index ac773747068..ddd58d2cbac 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestRackawareEnsemblePlacementPolicy.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestRackawareEnsemblePlacementPolicy.java @@ -159,7 +159,7 @@ static void updateMyRack(String rack) throws Exception { } @Test - public void testInitalize() throws Exception{ + public void testInitialize() throws Exception { String dnsResolverName = conf.getString(REPP_DNS_RESOLVER_CLASS, ScriptBasedMapping.class.getName()); DNSToSwitchMapping dnsResolver = ReflectionUtils.newInstance(dnsResolverName, DNSToSwitchMapping.class); AbstractDNSToSwitchMapping tmp = (AbstractDNSToSwitchMapping) dnsResolver; @@ -2347,13 +2347,13 @@ public void testNodeWithFailures() throws Exception { addrs.add(addr4.toBookieId()); repp.onClusterChanged(addrs, new HashSet()); - DistributionSchedule.WriteSet reoderSet = repp.reorderReadSequence( + DistributionSchedule.WriteSet reorderSet = repp.reorderReadSequence( ensemble, getBookiesHealthInfo(bookieFailures, new HashMap<>()), writeSet); - LOG.info("reorder set : {}", reoderSet); - assertEquals(ensemble.get(reoderSet.get(2)), addr1.toBookieId()); - assertEquals(ensemble.get(reoderSet.get(3)), addr2.toBookieId()); - assertEquals(ensemble.get(reoderSet.get(0)), addr3.toBookieId()); - assertEquals(ensemble.get(reoderSet.get(1)), addr4.toBookieId()); + LOG.info("reorder set : {}", reorderSet); + assertEquals(ensemble.get(reorderSet.get(2)), addr1.toBookieId()); + assertEquals(ensemble.get(reorderSet.get(3)), addr2.toBookieId()); + assertEquals(ensemble.get(reorderSet.get(0)), addr3.toBookieId()); + assertEquals(ensemble.get(reorderSet.get(1)), addr4.toBookieId()); } @Test diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestRegionAwareEnsemblePlacementPolicy.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestRegionAwareEnsemblePlacementPolicy.java index 3f076262e74..8f2562763d3 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestRegionAwareEnsemblePlacementPolicy.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestRegionAwareEnsemblePlacementPolicy.java @@ -1692,17 +1692,17 @@ public void testNodeWithFailures() throws Exception { bookieFailures.put(addr4.toBookieId(), 25L); LOG.info("write set : {}", writeSet2); - DistributionSchedule.WriteSet reoderSet = repp.reorderReadSequence( + DistributionSchedule.WriteSet reorderSet = repp.reorderReadSequence( ensemble, getBookiesHealthInfo(bookieFailures, new HashMap<>()), writeSet2); - LOG.info("reorder set : {}", reoderSet); - assertEquals(ensemble.get(reoderSet.get(0)), addr6.toBookieId()); - assertEquals(ensemble.get(reoderSet.get(1)), addr7.toBookieId()); - assertEquals(ensemble.get(reoderSet.get(2)), addr5.toBookieId()); - assertEquals(ensemble.get(reoderSet.get(3)), addr2.toBookieId()); - assertEquals(ensemble.get(reoderSet.get(4)), addr3.toBookieId()); - assertEquals(ensemble.get(reoderSet.get(5)), addr8.toBookieId()); - assertEquals(ensemble.get(reoderSet.get(6)), addr1.toBookieId()); - assertEquals(ensemble.get(reoderSet.get(7)), addr4.toBookieId()); + LOG.info("reorder set : {}", reorderSet); + assertEquals(ensemble.get(reorderSet.get(0)), addr6.toBookieId()); + assertEquals(ensemble.get(reorderSet.get(1)), addr7.toBookieId()); + assertEquals(ensemble.get(reorderSet.get(2)), addr5.toBookieId()); + assertEquals(ensemble.get(reorderSet.get(3)), addr2.toBookieId()); + assertEquals(ensemble.get(reorderSet.get(4)), addr3.toBookieId()); + assertEquals(ensemble.get(reorderSet.get(5)), addr8.toBookieId()); + assertEquals(ensemble.get(reorderSet.get(6)), addr1.toBookieId()); + assertEquals(ensemble.get(reorderSet.get(7)), addr4.toBookieId()); } @Test diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestZoneawareEnsemblePlacementPolicy.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestZoneawareEnsemblePlacementPolicy.java index b191225c834..e98a19e4636 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestZoneawareEnsemblePlacementPolicy.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestZoneawareEnsemblePlacementPolicy.java @@ -466,7 +466,7 @@ public void testMinUDsNotAvailable() throws Exception { * of writeQuorum 6 is expected to fail. */ zepp.newEnsemble(6, 6, 2, null, new HashSet<>()); - fail("newEnsemble is expected to fail because writeQuorum cannt be created with insufficient UDs"); + fail("newEnsemble is expected to fail because writeQuorum cannot be created with insufficient UDs"); } catch (BKException.BKNotEnoughBookiesException bkne) { // expected NotEnoughBookiesException } diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/api/BookKeeperBuildersTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/api/BookKeeperBuildersTest.java index 478a3ef208f..cc1d29c1522 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/api/BookKeeperBuildersTest.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/api/BookKeeperBuildersTest.java @@ -169,7 +169,7 @@ public void testFailDigestTypeNullAndAutodetectionFalse() throws Exception { .withDigestType(null) .withPassword(password) .execute()); - fail("shoud not be able to create a ledger with such specs"); + fail("should not be able to create a ledger with such specs"); } @Test(expected = BKClientClosedException.class) @@ -178,7 +178,7 @@ public void testFailDigestTypeNullAndBookkKeeperClosed() throws Exception { result(newCreateLedgerOp() .withPassword(password) .execute()); - fail("shoud not be able to create a ledger, client is closed"); + fail("should not be able to create a ledger, client is closed"); } @Test @@ -305,7 +305,7 @@ public void testFailCreateAdvLedgerBadFixedLedgerIdNegative() throws Exception { .makeAdv() .withLedgerId(-2) .execute()); - fail("shoud not be able to create a ledger with such specs"); + fail("should not be able to create a ledger with such specs"); } @Test(expected = BKNoSuchLedgerExistsOnMetadataServerException.class) diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/meta/LedgerManagerIteratorTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/meta/LedgerManagerIteratorTest.java index ec6957adc44..53e4c4fd5dc 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/meta/LedgerManagerIteratorTest.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/meta/LedgerManagerIteratorTest.java @@ -69,7 +69,7 @@ public LedgerManagerIteratorTest(Class lmFactory } /** - * Remove ledger using lm syncronously. + * Remove ledger using lm synchronously. * * @param lm * @param ledgerId @@ -80,7 +80,7 @@ void removeLedger(LedgerManager lm, Long ledgerId) throws Exception { } /** - * Create ledger using lm syncronously. + * Create ledger using lm synchronously. * * @param lm * @param ledgerId diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/meta/LedgerManagerTestCase.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/meta/LedgerManagerTestCase.java index 13272ab51c4..c81c3f7586d 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/meta/LedgerManagerTestCase.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/meta/LedgerManagerTestCase.java @@ -55,7 +55,7 @@ import org.junit.runners.Parameterized.Parameters; /** - * Test case to run over serveral ledger managers. + * Test case to run over several ledger managers. */ @RunWith(Parameterized.class) public abstract class LedgerManagerTestCase extends BookKeeperClusterTestCase { diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/net/NetworkTopologyImplTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/net/NetworkTopologyImplTest.java index e9ed1577e75..3da28642761 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/net/NetworkTopologyImplTest.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/net/NetworkTopologyImplTest.java @@ -155,14 +155,14 @@ public void testInvalidRackName() { networkTopology.add(bookieRack0ScopeNode); fail(); } catch (IllegalArgumentException e) { - assertEquals("bookieIdScopeRack0, which is located at , is not a decendent of /", e.getMessage()); + assertEquals("bookieIdScopeRack0, which is located at , is not a descendent of /", e.getMessage()); } try { networkTopology.add(bookieRack1ScopeNode); fail(); } catch (IllegalArgumentException e) { - assertEquals("bookieIdScopeRack1, which is located at , is not a decendent of /", e.getMessage()); + assertEquals("bookieIdScopeRack1, which is located at , is not a descendent of /", e.getMessage()); } } diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/NetworkLessBookieTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/NetworkLessBookieTest.java index 990838073a4..ec848578c4a 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/NetworkLessBookieTest.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/NetworkLessBookieTest.java @@ -33,7 +33,7 @@ import org.junit.Test; /** - * Tests of the main BookKeeper client using networkless comunication. + * Tests of the main BookKeeper client using networkless communication. */ public class NetworkLessBookieTest extends BookKeeperClusterTestCase { diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/TestBKStats.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/TestBKStats.java index 68d1b04c732..c6b82f02f3b 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/TestBKStats.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/TestBKStats.java @@ -31,7 +31,7 @@ public class TestBKStats { /** - * Tests that updatLatency should not fail with + * Tests that updateLatency should not fail with * ArrayIndexOutOfBoundException when latency time coming as negative. */ @Test diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/WriteEntryProcessorV3Test.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/WriteEntryProcessorV3Test.java index 40eb662cc54..94024aa5c0d 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/WriteEntryProcessorV3Test.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/WriteEntryProcessorV3Test.java @@ -284,7 +284,7 @@ public void testWritesCacheFlushTimeout() throws Exception { } @Test - public void testWritesWithClientNotAcceptingReponses() throws Exception { + public void testWritesWithClientNotAcceptingResponses() throws Exception { when(requestProcessor.getWaitTimeoutOnBackpressureMillis()).thenReturn(5L); doAnswer(invocationOnMock -> { diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/checksum/CompositeByteBufUnwrapBugReproduceTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/checksum/CompositeByteBufUnwrapBugReproduceTest.java index 6252bb71be9..45219c43161 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/checksum/CompositeByteBufUnwrapBugReproduceTest.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/checksum/CompositeByteBufUnwrapBugReproduceTest.java @@ -49,7 +49,7 @@ * the payload is a CompositeByteBuf and this buffer has a reader index state other than 0. * The reader index state gets lost in the unwrapping process. * - * There were at least 2 different bugs. One that occured when the + * There were at least 2 different bugs. One that occurred when the * payload was >= BookieProtoEncoding.SMALL_ENTRY_SIZE_THRESHOLD and the other when * it was < BookieProtoEncoding.SMALL_ENTRY_SIZE_THRESHOLD. * This test covers both useV2Protocol=true and useV2Protocol=false since the bug was triggered differently. diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/TestLedgerUnderreplicationManager.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/TestLedgerUnderreplicationManager.java index 33cdd24c1c3..f466f41fa56 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/TestLedgerUnderreplicationManager.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/TestLedgerUnderreplicationManager.java @@ -619,7 +619,7 @@ public void process(WatchedEvent event) { if (event.getType() == EventType.NodeCreated) { znodeLatch.countDown(); if (LOG.isDebugEnabled()) { - LOG.debug("Recieved node creation event for the zNodePath:" + LOG.debug("Received node creation event for the zNodePath:" + event.getPath()); } } diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieClientTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieClientTest.java index 2fadbbd2c25..d8ab2f5989a 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieClientTest.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieClientTest.java @@ -767,7 +767,7 @@ public void testBatchedReadWithMaxSizeLimitCase2() throws Exception { * a.`PerChannelBookieClient.addEntry` * a-1.Build a new ByteBuf for request command. We call this `ByteBuf` new as `request` in the following * sections. - * a-2.`channle.writeAndFlush(request)` or release the ByteBuf when `channel` is switching. + * a-2.`channel.writeAndFlush(request)` or release the ByteBuf when `channel` is switching. * Note the callback will be called immediately if the channel is switching. * b.Release the `ByteBuf` since it has been retained at `step 1`. `toSend.recCnf` should be `1` now. */ diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieReadWriteTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieReadWriteTest.java index 870943b7a93..3ed8a2a655e 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieReadWriteTest.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieReadWriteTest.java @@ -140,7 +140,7 @@ public void testOpenException() throws IOException, InterruptedException { @Test public void testStreamingClients() throws IOException, BKException, InterruptedException { lh = bkc.createLedger(digestType, ledgerPassword); - // write a string so that we cna + // write a string so that we can // create a buffer of a single bytes // and check for corner cases String toWrite = "we need to check for this string to match " + "and for the record mahadev is the best"; diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/ForceReadOnlyBookieTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/ForceReadOnlyBookieTest.java index b00fc19a854..ed3e5a65c93 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/ForceReadOnlyBookieTest.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/ForceReadOnlyBookieTest.java @@ -60,7 +60,7 @@ public void testBookieForceStartAsReadOnly() throws Exception { ledger.addEntry("data".getBytes()); } ledger.close(); - LOG.info("successed prepare"); + LOG.info("prepare succeeded"); // start bookie 1 as readonly confByIndex(1).setReadOnlyModeEnabled(true); @@ -70,7 +70,7 @@ public void testBookieForceStartAsReadOnly() throws Exception { assertTrue("Bookie should be running and in readonly mode", bookie.isRunning() && bookie.isReadOnly()); - LOG.info("successed force start ReadOnlyBookie"); + LOG.info("force start ReadOnlyBookie succeeded"); // Check new bookie with readonly mode enabled. File[] ledgerDirs = confByIndex(1).getLedgerDirs(); @@ -85,13 +85,13 @@ public void testBookieForceStartAsReadOnly() throws Exception { assertEquals("Entry should contain correct data", "data", new String(entry.getEntry())); } - LOG.info("successed read entry from ReadOnlyBookie"); + LOG.info("read entry from ReadOnlyBookie succeeded"); // test will not transfer to Writable mode. LedgerDirsManager ledgerDirsManager = ((BookieImpl) bookie).getLedgerDirsManager(); ledgerDirsManager.addToWritableDirs(new File(ledgerDirs[0], "current"), true); assertTrue("Bookie should be running and in readonly mode", bookie.isRunning() && bookie.isReadOnly()); - LOG.info("successed: bookie still readonly"); + LOG.info("bookie still readonly"); } } diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/collections/ConcurrentLongLongHashMapTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/collections/ConcurrentLongLongHashMapTest.java index b9a67e17d16..e7a9e993ad6 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/collections/ConcurrentLongLongHashMapTest.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/collections/ConcurrentLongLongHashMapTest.java @@ -612,7 +612,7 @@ public void testRemoveIfValue() { } @Test - public void testIvalidKeys() { + public void testInvalidKeys() { ConcurrentLongLongHashMap map = ConcurrentLongLongHashMap.newBuilder() .expectedItems(16) .concurrencyLevel(1) diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/collections/ConcurrentLongLongPairHashMapTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/collections/ConcurrentLongLongPairHashMapTest.java index 36605c5b96f..30672837f5a 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/collections/ConcurrentLongLongPairHashMapTest.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/collections/ConcurrentLongLongPairHashMapTest.java @@ -487,7 +487,7 @@ public void testPutIfAbsent() { } @Test - public void testIvalidKeys() { + public void testInvalidKeys() { ConcurrentLongLongPairHashMap map = ConcurrentLongLongPairHashMap.newBuilder() .expectedItems(16) .concurrencyLevel(1) diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/zookeeper/TestZooKeeperClient.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/zookeeper/TestZooKeeperClient.java index 3c1bd65a64b..e62e5c08b21 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/zookeeper/TestZooKeeperClient.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/zookeeper/TestZooKeeperClient.java @@ -157,7 +157,7 @@ public void process(WatchedEvent event) { } @Test - public void testReconnectAfterExipred() throws Exception { + public void testReconnectAfterExpired() throws Exception { final CountDownLatch expireLatch = new CountDownLatch(1); Watcher testWatcher = new Watcher() { diff --git a/docker/Makefile b/docker/Makefile index bc448bfc6bf..5e4dfd01c92 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -89,7 +89,7 @@ run-bk: # -------------------------------- # # Create run and destroy a container that will -# intializes new bookkeeper cluster by creating required znodes for the cluster +# initializes new bookkeeper cluster by creating required znodes for the cluster # make run-init run-init: diff --git a/stats/bookkeeper-stats-providers/prometheus-metrics-provider/src/test/java/org/apache/bookkeeper/stats/prometheus/TestPrometheusFormatter.java b/stats/bookkeeper-stats-providers/prometheus-metrics-provider/src/test/java/org/apache/bookkeeper/stats/prometheus/TestPrometheusFormatter.java index 8855044f24a..f5459a33021 100644 --- a/stats/bookkeeper-stats-providers/prometheus-metrics-provider/src/test/java/org/apache/bookkeeper/stats/prometheus/TestPrometheusFormatter.java +++ b/stats/bookkeeper-stats-providers/prometheus-metrics-provider/src/test/java/org/apache/bookkeeper/stats/prometheus/TestPrometheusFormatter.java @@ -225,7 +225,7 @@ public void testPrometheusTypeDuplicate() throws IOException { /** - * Hacky parsing of Prometheus text format. Sould be good enough for unit tests + * Hacky parsing of Prometheus text format. Should be good enough for unit tests */ private static Multimap parseMetrics(String metrics) { Multimap parsed = ArrayListMultimap.create(); diff --git a/stream/clients/java/all/src/test/java/org/apache/bookkeeper/clients/StorageClientImplTest.java b/stream/clients/java/all/src/test/java/org/apache/bookkeeper/clients/StorageClientImplTest.java index 56f99d424ee..ec935cf449a 100644 --- a/stream/clients/java/all/src/test/java/org/apache/bookkeeper/clients/StorageClientImplTest.java +++ b/stream/clients/java/all/src/test/java/org/apache/bookkeeper/clients/StorageClientImplTest.java @@ -104,7 +104,7 @@ public void testOpenPTable() throws Exception { @SuppressWarnings("unchecked") @Test - public void testOpenPTableDiffernetNamespace() throws Exception { + public void testOpenPTableDifferentNamespace() throws Exception { StreamProperties tableProps1 = StreamProperties.newBuilder(STREAM_PROPERTIES) .setStreamName("table1") .setStreamConf(StreamConfiguration.newBuilder(DEFAULT_STREAM_CONF) diff --git a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/net/NetUtils.java b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/net/NetUtils.java index 27b693d106a..002cdde4756 100644 --- a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/net/NetUtils.java +++ b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/net/NetUtils.java @@ -34,7 +34,7 @@ public class NetUtils { * *

It would try to load the class with the constructor with hostRegionOverrides. * If it fails, it would fall back to load the class with default empty constructor. - * The interpretion of hostRegionOverrides is up to the implementation. + * The interpretation of hostRegionOverrides is up to the implementation. * * @param resolverCls * resolver class diff --git a/stream/distributedlog/core/src/test/java/org/apache/distributedlog/TestAppendOnlyStreamWriter.java b/stream/distributedlog/core/src/test/java/org/apache/distributedlog/TestAppendOnlyStreamWriter.java index 0608bd6bc4a..2c8f2f7443d 100644 --- a/stream/distributedlog/core/src/test/java/org/apache/distributedlog/TestAppendOnlyStreamWriter.java +++ b/stream/distributedlog/core/src/test/java/org/apache/distributedlog/TestAppendOnlyStreamWriter.java @@ -296,7 +296,7 @@ long writeRecordsAndReadThemBackAfterInjectingAFailedTransmit( FailpointUtils.FailPointActions.FailPointAction_Throw); writer.force(false); - fail("should have thown ⊙﹏⊙"); + fail("should have thrown ⊙﹏⊙"); } catch (WriteException we) { } finally { FailpointUtils.removeFailpoint( diff --git a/stream/distributedlog/core/src/test/java/org/apache/distributedlog/TestAsyncReaderLock.java b/stream/distributedlog/core/src/test/java/org/apache/distributedlog/TestAsyncReaderLock.java index a4ceea79af3..94d4cf6014f 100644 --- a/stream/distributedlog/core/src/test/java/org/apache/distributedlog/TestAsyncReaderLock.java +++ b/stream/distributedlog/core/src/test/java/org/apache/distributedlog/TestAsyncReaderLock.java @@ -277,7 +277,7 @@ public void testReaderLockSessionExpires() throws Exception { ns1.getNamespaceDriver()).getWriterZKC(), zkServers, 1000); // The result of expireSession is somewhat non-deterministic with this lock. - // It may fail with LockingException or it may succesfully reacquire, so for + // It may fail with LockingException or it may successfully reacquire, so for // the moment rather than make it deterministic we accept either result. boolean success = false; try { diff --git a/stream/distributedlog/core/src/test/java/org/apache/distributedlog/TestBKDistributedLogManager.java b/stream/distributedlog/core/src/test/java/org/apache/distributedlog/TestBKDistributedLogManager.java index 9341dece0b6..dcc422e7861 100644 --- a/stream/distributedlog/core/src/test/java/org/apache/distributedlog/TestBKDistributedLogManager.java +++ b/stream/distributedlog/core/src/test/java/org/apache/distributedlog/TestBKDistributedLogManager.java @@ -335,7 +335,7 @@ public void testWriteRestartFrom1() throws Exception { } out.closeAndComplete(); - // open journal arbitarily far in the future + // open journal arbitrarily far in the future txid = DEFAULT_SEGMENT_SIZE * 4; out = (BKSyncLogWriter) dlm.startLogSegmentNonPartitioned(); out.write(DLMTestUtil.getLogRecordInstance(txid)); diff --git a/stream/distributedlog/core/src/test/java/org/apache/distributedlog/TestBKLogSegmentWriter.java b/stream/distributedlog/core/src/test/java/org/apache/distributedlog/TestBKLogSegmentWriter.java index 89aab53e07c..80abd934113 100644 --- a/stream/distributedlog/core/src/test/java/org/apache/distributedlog/TestBKLogSegmentWriter.java +++ b/stream/distributedlog/core/src/test/java/org/apache/distributedlog/TestBKLogSegmentWriter.java @@ -263,9 +263,9 @@ public void testCloseShouldFlush() throws Exception { numRecords, dlsns.size()); for (int i = 0; i < numRecords; i++) { DLSN dlsn = dlsns.get(i); - assertEquals("Incorrent ledger sequence number", + assertEquals("Incorrect ledger sequence number", 0L, dlsn.getLogSegmentSequenceNo()); - assertEquals("Incorrent entry id", + assertEquals("Incorrect entry id", 0L, dlsn.getEntryId()); assertEquals("Inconsistent slot id", i, dlsn.getSlotId()); @@ -572,9 +572,9 @@ public void testAbortShouldFailAllWrites() throws Exception { numRecords, dlsns.size()); for (int i = 0; i < numRecords; i++) { DLSN dlsn = dlsns.get(i); - assertEquals("Incorrent ledger sequence number", + assertEquals("Incorrect ledger sequence number", 0L, dlsn.getLogSegmentSequenceNo()); - assertEquals("Incorrent entry id", + assertEquals("Incorrect entry id", 0L, dlsn.getEntryId()); assertEquals("Inconsistent slot id", i, dlsn.getSlotId()); @@ -643,17 +643,17 @@ public void testUpdateLastTxIdForUserRecords() throws Exception { numRecords + 1, dlsns.size()); for (int i = 0; i < numRecords; i++) { DLSN dlsn = dlsns.get(i); - assertEquals("Incorrent ledger sequence number", + assertEquals("Incorrect ledger sequence number", 0L, dlsn.getLogSegmentSequenceNo()); - assertEquals("Incorrent entry id", + assertEquals("Incorrect entry id", 0L, dlsn.getEntryId()); assertEquals("Inconsistent slot id", i, dlsn.getSlotId()); } DLSN dlsn = dlsns.get(numRecords); - assertEquals("Incorrent ledger sequence number", + assertEquals("Incorrect ledger sequence number", 0L, dlsn.getLogSegmentSequenceNo()); - assertEquals("Incorrent entry id", + assertEquals("Incorrect entry id", 1L, dlsn.getEntryId()); assertEquals("Inconsistent slot id", 0L, dlsn.getSlotId()); diff --git a/stream/distributedlog/core/src/test/java/org/apache/distributedlog/TestReadAheadEntryReader.java b/stream/distributedlog/core/src/test/java/org/apache/distributedlog/TestReadAheadEntryReader.java index 6cb1e5d5f5f..1716b0902ce 100644 --- a/stream/distributedlog/core/src/test/java/org/apache/distributedlog/TestReadAheadEntryReader.java +++ b/stream/distributedlog/core/src/test/java/org/apache/distributedlog/TestReadAheadEntryReader.java @@ -236,7 +236,7 @@ public void testStartWithEmptySegmentList() throws Exception { assertEquals(segments.size() + " log segments found, expected to be only one", 1, segments.size()); - // notify the readahead reader with new segment lsit + // notify the readahead reader with new segment list readAheadEntryReader.onSegmentsUpdated(segments); // check the reader state after initialization diff --git a/stream/distributedlog/core/src/test/java/org/apache/distributedlog/bk/TestLedgerAllocator.java b/stream/distributedlog/core/src/test/java/org/apache/distributedlog/bk/TestLedgerAllocator.java index 23d958dfc6c..02cd7feccb0 100644 --- a/stream/distributedlog/core/src/test/java/org/apache/distributedlog/bk/TestLedgerAllocator.java +++ b/stream/distributedlog/core/src/test/java/org/apache/distributedlog/bk/TestLedgerAllocator.java @@ -354,8 +354,8 @@ public void testCloseAllocatorAfterAbort() throws Exception { @Test(timeout = 60000) public void testConcurrentAllocation() throws Exception { - String allcationPath = "/" + runtime.getMethodName(); - SimpleLedgerAllocator allocator = createAllocator(allcationPath); + String allocationPath = "/" + runtime.getMethodName(); + SimpleLedgerAllocator allocator = createAllocator(allocationPath); allocator.allocate(); ZKTransaction txn1 = newTxn(); CompletableFuture obtainFuture1 = allocator.tryObtain(txn1, NULL_LISTENER); diff --git a/stream/distributedlog/core/src/test/java/org/apache/distributedlog/bk/TestLedgerAllocatorPool.java b/stream/distributedlog/core/src/test/java/org/apache/distributedlog/bk/TestLedgerAllocatorPool.java index 1528518d08d..2d4f6d47807 100644 --- a/stream/distributedlog/core/src/test/java/org/apache/distributedlog/bk/TestLedgerAllocatorPool.java +++ b/stream/distributedlog/core/src/test/java/org/apache/distributedlog/bk/TestLedgerAllocatorPool.java @@ -133,7 +133,7 @@ public void testNonAvailableAllocator() throws Exception { try { pool.allocate(); Utils.ioResult(pool.tryObtain(newTxn(), NULL_LISTENER)); - fail("Should fail to allocate ledger if there are enought bookies"); + fail("Should fail to allocate ledger if there are enough bookies"); } catch (SimpleLedgerAllocator.AllocationException ae) { assertEquals(SimpleLedgerAllocator.Phase.ERROR, ae.getPhase()); } diff --git a/stream/distributedlog/core/src/test/java/org/apache/distributedlog/lock/TestZKSessionLock.java b/stream/distributedlog/core/src/test/java/org/apache/distributedlog/lock/TestZKSessionLock.java index 9c05f6ef473..deba668389a 100644 --- a/stream/distributedlog/core/src/test/java/org/apache/distributedlog/lock/TestZKSessionLock.java +++ b/stream/distributedlog/core/src/test/java/org/apache/distributedlog/lock/TestZKSessionLock.java @@ -1052,7 +1052,7 @@ public void run() { if (timeout == 0) { try { lock0_1.tryLock(0, TimeUnit.MILLISECONDS); - fail("Should fail on locking if sibling is using differnt lock id."); + fail("Should fail on locking if sibling is using different lock id."); } catch (OwnershipAcquireFailedException oafe) { assertEquals(clientId0, oafe.getCurrentOwner()); } diff --git a/stream/distributedlog/core/src/test/java/org/apache/distributedlog/tools/TestDistributedLogTool.java b/stream/distributedlog/core/src/test/java/org/apache/distributedlog/tools/TestDistributedLogTool.java index 4aa6ac15768..ab0ad2f33f0 100644 --- a/stream/distributedlog/core/src/test/java/org/apache/distributedlog/tools/TestDistributedLogTool.java +++ b/stream/distributedlog/core/src/test/java/org/apache/distributedlog/tools/TestDistributedLogTool.java @@ -199,7 +199,7 @@ public void testToolReadLastConfirmed() throws Exception { cmd.setUri(defaultUri); cmd.setLedgerId(99999999); - // Too hard to predict ledger entry id. Settle for basicaly + // Too hard to predict ledger entry id. Settle for basically // correct functionality. try { cmd.runCmd(); diff --git a/stream/distributedlog/core/src/test/java/org/apache/distributedlog/util/TestUtils.java b/stream/distributedlog/core/src/test/java/org/apache/distributedlog/util/TestUtils.java index 6ae197acb54..573d3f02647 100644 --- a/stream/distributedlog/core/src/test/java/org/apache/distributedlog/util/TestUtils.java +++ b/stream/distributedlog/core/src/test/java/org/apache/distributedlog/util/TestUtils.java @@ -62,7 +62,7 @@ public void teardown() throws Exception { } @Test(timeout = 60000) - public void testZkAsyncCreateFulPathOptimisticRecursive() throws Exception { + public void testZkAsyncCreateFullPathOptimisticRecursive() throws Exception { String path1 = "/a/b/c/d"; Optional parentPathShouldNotCreate = Optional.empty(); final CountDownLatch doneLatch1 = new CountDownLatch(1); diff --git a/stream/proto/src/main/proto/kv_rpc.proto b/stream/proto/src/main/proto/kv_rpc.proto index 13cd7dbc746..de9542bfe42 100644 --- a/stream/proto/src/main/proto/kv_rpc.proto +++ b/stream/proto/src/main/proto/kv_rpc.proto @@ -210,7 +210,7 @@ message DeleteRangeRequest { bytes range_end = 2; // If prev_kv is set, etcd gets the previous key-value pairs before deleting it. - // The previous key-value pairs will be returned in the delte response. + // The previous key-value pairs will be returned in the delete response. bool prev_kv = 3; // header diff --git a/stream/statelib/src/test/java/org/apache/bookkeeper/statelib/impl/rocksdb/checkpoint/RocksCheckpointerTest.java b/stream/statelib/src/test/java/org/apache/bookkeeper/statelib/impl/rocksdb/checkpoint/RocksCheckpointerTest.java index b880ac1b94b..9fe2f116409 100644 --- a/stream/statelib/src/test/java/org/apache/bookkeeper/statelib/impl/rocksdb/checkpoint/RocksCheckpointerTest.java +++ b/stream/statelib/src/test/java/org/apache/bookkeeper/statelib/impl/rocksdb/checkpoint/RocksCheckpointerTest.java @@ -715,7 +715,7 @@ public void testCheckpointRestoreAfterCrash() throws Exception { fail("expected RuntimeException"); } catch (RuntimeException se) { // noop - // in real life case ths is simply crash, + // in real life case this is simply crash, // so "finally" at the checkpoint() won't run either } diff --git a/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/cluster/ClusterControllerLeaderImpl.java b/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/cluster/ClusterControllerLeaderImpl.java index 97b41f3eae3..80c56f3a92d 100644 --- a/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/cluster/ClusterControllerLeaderImpl.java +++ b/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/cluster/ClusterControllerLeaderImpl.java @@ -64,7 +64,7 @@ public class ClusterControllerLeaderImpl implements ClusterControllerLeader, Reg // last successful assignment happened at (timestamp) @Getter(AccessLevel.PACKAGE) - private long lastSuccessfulAssigmentAt; + private long lastSuccessfulAssignmentAt; // the min interval that controller is scheduled to assign containers private final Duration scheduleDuration; @@ -77,7 +77,7 @@ public class ClusterControllerLeaderImpl implements ClusterControllerLeader, Reg this.scController = scController; this.regClient = regClient; this.performServerChangesPermits = new Semaphore(0); - this.lastSuccessfulAssigmentAt = -1L; + this.lastSuccessfulAssignmentAt = -1L; this.scheduleDuration = scheduleDuration; } @@ -162,7 +162,7 @@ private void processServerChange() throws InterruptedException { // check if the leader can perform server changes performServerChangesPermits.acquire(); - long elapsedMs = System.currentTimeMillis() - lastSuccessfulAssigmentAt; + long elapsedMs = System.currentTimeMillis() - lastSuccessfulAssignmentAt; long remainingMs = scheduleDuration.toMillis() - elapsedMs; if (remainingMs > 0) { log.info("Waiting {} milliseconds for controller to assign containers", remainingMs); @@ -175,7 +175,7 @@ private void processServerChange() throws InterruptedException { Set availableServersSnapshot = availableServers; if (null == availableServersSnapshot || availableServersSnapshot.isEmpty()) { // haven't received any servers from registration service, wait for 200ms and retry. - if (lastSuccessfulAssigmentAt < 0) { + if (lastSuccessfulAssignmentAt < 0) { log.info("No servers is alive yet. Backoff 200ms and retry."); TimeUnit.MILLISECONDS.sleep(200); performServerChangesPermits.release(); @@ -204,7 +204,7 @@ private void processServerChange() throws InterruptedException { } } else { // update the assignment state - lastSuccessfulAssigmentAt = System.currentTimeMillis(); + lastSuccessfulAssignmentAt = System.currentTimeMillis(); clusterMetadataStore.updateClusterAssignmentData(newState); } } diff --git a/stream/storage/impl/src/test/java/org/apache/bookkeeper/stream/storage/impl/cluster/ClusterControllerLeaderImplTest.java b/stream/storage/impl/src/test/java/org/apache/bookkeeper/stream/storage/impl/cluster/ClusterControllerLeaderImplTest.java index 6ed0c432dbf..a9fbab0fbda 100644 --- a/stream/storage/impl/src/test/java/org/apache/bookkeeper/stream/storage/impl/cluster/ClusterControllerLeaderImplTest.java +++ b/stream/storage/impl/src/test/java/org/apache/bookkeeper/stream/storage/impl/cluster/ClusterControllerLeaderImplTest.java @@ -184,7 +184,7 @@ public void testProcessAsLeader() throws Exception { // but since there is no servers available, the storage controller will not compute any ideal state // for the assignment and `lastSuccessfulAssignmentAt` will remain negative. assertFalse(coordSem.tryAcquire(1, TimeUnit.SECONDS)); - assertTrue(clusterController.getLastSuccessfulAssigmentAt() < 0); + assertTrue(clusterController.getLastSuccessfulAssignmentAt() < 0); // notify the registration client that a new host is added Set cluster = Sets.newSet(BookieId.parse("127.0.0.1:4181")); @@ -194,14 +194,14 @@ public void testProcessAsLeader() throws Exception { // the cluster controller will be notified with cluster change and storage controller will compute // the assignment state. cluster metadata store should be used for updating cluster assignment data. coordSem.acquire(); - assertTrue(clusterController.getLastSuccessfulAssigmentAt() > 0); - long lastSuccessfulAssignmentAt = clusterController.getLastSuccessfulAssigmentAt(); + assertTrue(clusterController.getLastSuccessfulAssignmentAt() > 0); + long lastSuccessfulAssignmentAt = clusterController.getLastSuccessfulAssignmentAt(); // notify the cluster controller with same cluster, cluster controller should not attempt to update // the assignment regListenerRef.get().onBookiesChanged(new Versioned<>(cluster, version)); assertFalse(coordSem.tryAcquire(200, TimeUnit.MILLISECONDS)); - assertEquals(lastSuccessfulAssignmentAt, clusterController.getLastSuccessfulAssigmentAt()); + assertEquals(lastSuccessfulAssignmentAt, clusterController.getLastSuccessfulAssignmentAt()); // multiple hosts added and removed cluster.add(BookieId.parse("127.0.0.1:4182")); @@ -213,14 +213,14 @@ public void testProcessAsLeader() throws Exception { regListenerRef.get().onBookiesChanged(new Versioned<>(cluster, version)); // the cluster controller should update assignment data if cluster is changed coordSem.acquire(); - assertTrue(clusterController.getLastSuccessfulAssigmentAt() > lastSuccessfulAssignmentAt); - lastSuccessfulAssignmentAt = clusterController.getLastSuccessfulAssigmentAt(); + assertTrue(clusterController.getLastSuccessfulAssignmentAt() > lastSuccessfulAssignmentAt); + lastSuccessfulAssignmentAt = clusterController.getLastSuccessfulAssignmentAt(); // if cluster information is changed to empty, cluster controller should not be eager to change // the assignment. regListenerRef.get().onBookiesChanged(new Versioned<>(Collections.emptySet(), new LongVersion(2L))); assertFalse(coordSem.tryAcquire(1, TimeUnit.SECONDS)); - assertEquals(lastSuccessfulAssignmentAt, clusterController.getLastSuccessfulAssigmentAt()); + assertEquals(lastSuccessfulAssignmentAt, clusterController.getLastSuccessfulAssignmentAt()); } } diff --git a/stream/storage/impl/src/test/java/org/apache/bookkeeper/stream/storage/impl/cluster/InMemClusterMetadataStoreTest.java b/stream/storage/impl/src/test/java/org/apache/bookkeeper/stream/storage/impl/cluster/InMemClusterMetadataStoreTest.java index 3da87914059..447f934822c 100644 --- a/stream/storage/impl/src/test/java/org/apache/bookkeeper/stream/storage/impl/cluster/InMemClusterMetadataStoreTest.java +++ b/stream/storage/impl/src/test/java/org/apache/bookkeeper/stream/storage/impl/cluster/InMemClusterMetadataStoreTest.java @@ -57,7 +57,7 @@ public void teardown() { } @Test - public void testUnitialized() { + public void testUninitialized() { assertEquals( ClusterMetadata.newBuilder().setNumStorageContainers(NUM_STORAGE_CONTAINERS).build(), store.getClusterMetadata()); diff --git a/stream/storage/impl/src/test/java/org/apache/bookkeeper/stream/storage/impl/cluster/ZkClusterMetadataStoreTest.java b/stream/storage/impl/src/test/java/org/apache/bookkeeper/stream/storage/impl/cluster/ZkClusterMetadataStoreTest.java index 62dfe1eabf1..b53d24929ba 100644 --- a/stream/storage/impl/src/test/java/org/apache/bookkeeper/stream/storage/impl/cluster/ZkClusterMetadataStoreTest.java +++ b/stream/storage/impl/src/test/java/org/apache/bookkeeper/stream/storage/impl/cluster/ZkClusterMetadataStoreTest.java @@ -82,7 +82,7 @@ public void teardown() { } @Test - public void testUnitialized() { + public void testUninitialized() { ZkClusterMetadataStore newStore = new ZkClusterMetadataStore( curatorClient, zkServers, "/" + runtime.getMethodName() + "-new"); diff --git a/tests/backward-compat/hierarchical-ledger-manager/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatHierarchicalLedgerManager.groovy b/tests/backward-compat/hierarchical-ledger-manager/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatHierarchicalLedgerManager.groovy index 69b06d078d2..7f92266d0b4 100644 --- a/tests/backward-compat/hierarchical-ledger-manager/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatHierarchicalLedgerManager.groovy +++ b/tests/backward-compat/hierarchical-ledger-manager/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatHierarchicalLedgerManager.groovy @@ -41,7 +41,7 @@ class TestCompatHierarchicalLedgerManager { DockerClient docker /** - * Test compatability between version old version and the current version + * Test compatibility between version old version and the current version * with respect to the HierarchicalLedgerManagers. * - 4.2.0 server starts with HierarchicalLedgerManager. * - Write ledgers with old and new clients diff --git a/tests/backward-compat/hostname-bookieid/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatUpgradeWithHostnameBookieId.groovy b/tests/backward-compat/hostname-bookieid/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatUpgradeWithHostnameBookieId.groovy index 88affbd6919..07c60b3ae76 100644 --- a/tests/backward-compat/hostname-bookieid/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatUpgradeWithHostnameBookieId.groovy +++ b/tests/backward-compat/hostname-bookieid/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatUpgradeWithHostnameBookieId.groovy @@ -59,7 +59,7 @@ class TestCompatUpgradeWithHostnameBookieId { } /** - * Test compatability between version old version and the current version. + * Test compatibility between version old version and the current version. * - 4.1.0 server restarts with useHostNameAsBookieID=true. * - Write ledgers with old and new clients * - Read ledgers written by old clients. diff --git a/tools/ledger/src/test/java/org/apache/bookkeeper/tools/cli/commands/cookie/AdminCommandTest.java b/tools/ledger/src/test/java/org/apache/bookkeeper/tools/cli/commands/cookie/AdminCommandTest.java index 50f274d17ee..3b675144464 100644 --- a/tools/ledger/src/test/java/org/apache/bookkeeper/tools/cli/commands/cookie/AdminCommandTest.java +++ b/tools/ledger/src/test/java/org/apache/bookkeeper/tools/cli/commands/cookie/AdminCommandTest.java @@ -86,13 +86,13 @@ public void setup() throws Exception { mockUpdateBookieIdInCookie(); mockVerifyCookie(); - mockInitDirecotory(); + mockInitDirectory(); mockExpandStorage(); mockListOrDeleteCookies(); } - private void mockInitDirecotory() throws IOException { + private void mockInitDirectory() throws IOException { File[] files = new File[1]; files[0] = testDir.getRoot(); testDir.newFile(BookKeeperConstants.VERSION_FILENAME); diff --git a/tools/ledger/src/test/java/org/apache/bookkeeper/tools/cli/commands/cookie/GenerateCookieCommandIndexTest.java b/tools/ledger/src/test/java/org/apache/bookkeeper/tools/cli/commands/cookie/GenerateCookieCommandIndexTest.java index 7d3db61f3ea..620d6843eb7 100644 --- a/tools/ledger/src/test/java/org/apache/bookkeeper/tools/cli/commands/cookie/GenerateCookieCommandIndexTest.java +++ b/tools/ledger/src/test/java/org/apache/bookkeeper/tools/cli/commands/cookie/GenerateCookieCommandIndexTest.java @@ -163,7 +163,7 @@ public void testGenerateCookieWithoutInstanceId() throws Exception { File cookieFile = testFolder.newFile("cookie-without-instance-id"); String journalDir = "/path/to/journal"; String ledgersDir = "/path/to/ledgers"; - String indexDir = "/path/to/indexs"; + String indexDir = "/path/to/indices"; String instanceId = "test-instance-id"; Cookie cookie = Cookie.newBuilder() @@ -202,7 +202,7 @@ public void testGenerateCookieWithInstanceId() throws Exception { File cookieFile = testFolder.newFile("cookie-with-instance-id"); String journalDir = "/path/to/journal"; String ledgersDir = "/path/to/ledgers"; - String indexsDir = "/path/to/indexs"; + String indexesDir = "/path/to/indices"; String instanceId = "test-instance-id"; Cookie cookie = Cookie.newBuilder() @@ -210,7 +210,7 @@ public void testGenerateCookieWithInstanceId() throws Exception { .setInstanceId(instanceId) .setJournalDirs(journalDir) .setLedgerDirs(Cookie.encodeDirPaths(ledgersDir.split(","))) - .setIndexDirs(Cookie.encodeDirPaths(indexsDir.split(","))) + .setIndexDirs(Cookie.encodeDirPaths(indexesDir.split(","))) .build(); when(rm.getClusterInstanceId()).thenReturn(instanceId); @@ -218,7 +218,7 @@ public void testGenerateCookieWithInstanceId() throws Exception { getConsoleOutput(), runCommand(new String[] { "-l", ledgersDir, - "-ix", indexsDir, + "-ix", indexesDir, "-j", journalDir, "-o", cookieFile.getPath(), "-i", instanceId, @@ -242,7 +242,7 @@ public void testGenerateCookieWithMultipleLedgerIndexDirs() throws Exception { File cookieFile = testFolder.newFile("cookie-with-instance-id"); String journalDir = "/path/to/journal"; String ledgerDirs = "/path/to/ledgers,/path/to/more/ledgers"; - String indexDirs = "/path/to/indexs,/path/to/more/indexs"; + String indexDirs = "/path/to/indexes,/path/to/more/indexes"; String instanceId = "test-instance-id"; when(rm.getClusterInstanceId()).thenReturn(instanceId); From 237aa124758383f72182f851c2d169217be6f155 Mon Sep 17 00:00:00 2001 From: ZhangJian He Date: Thu, 23 May 2024 10:59:11 +0800 Subject: [PATCH 2/2] fix typos in test java files Signed-off-by: ZhangJian He --- .../src/main/java/org/apache/bookkeeper/bookie/FileInfo.java | 4 ++-- .../java/org/apache/bookkeeper/client/HandleFailuresTest.java | 4 ++-- .../java/org/apache/distributedlog/bk/LedgerAllocator.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileInfo.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileInfo.java index 553d52f606e..150697b822a 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileInfo.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileInfo.java @@ -47,7 +47,7 @@ * Ledger index file is made of a header and several fixed-length index pages, which records the offsets of data stored * in entry loggers *

<header><index pages>
- * Header is formated as below: + * Header is formatted as below: *
<magic bytes><len of master key><master key>
*
    *
  • magic bytes: 4 bytes, 'BKLE', version: 4 bytes @@ -55,7 +55,7 @@ *
  • master key: master key *
  • state: bit map to indicate the state, 32 bits. *
- * Index page is a fixed-length page, which contains serveral entries which point to the offsets of data stored + * Index page is a fixed-length page, which contains several entries which point to the offsets of data stored * in entry loggers. *

*/ diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/HandleFailuresTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/HandleFailuresTest.java index d1182668e9c..8e8f5649dad 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/HandleFailuresTest.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/HandleFailuresTest.java @@ -171,7 +171,7 @@ public void testHandlingFailuresOneBookieFailsAfterOneEntry() throws Exception { } @Test(timeout = 30000) - public void testHandlingFailuresMultipleBookieFailImmediatelyNotEnoughoReplace() throws Exception { + public void testHandlingFailuresMultipleBookieFailImmediatelyNotEnoughToReplace() throws Exception { MockClientContext clientCtx = MockClientContext.create(); Versioned md = ClientUtil.setupLedger(clientCtx, 10L, LedgerMetadataBuilder.create() @@ -197,7 +197,7 @@ public void testHandlingFailuresMultipleBookieFailImmediatelyNotEnoughoReplace() } @Test(timeout = 30000) - public void testHandlingFailuresMultipleBookieFailAfterOneEntryNotEnoughoReplace() throws Exception { + public void testHandlingFailuresMultipleBookieFailAfterOneEntryNotEnoughToReplace() throws Exception { MockClientContext clientCtx = MockClientContext.create(); Versioned md = ClientUtil.setupLedger(clientCtx, 10L, LedgerMetadataBuilder.create() diff --git a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/bk/LedgerAllocator.java b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/bk/LedgerAllocator.java index 80f1ce0311a..8a7cf42bfa8 100644 --- a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/bk/LedgerAllocator.java +++ b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/bk/LedgerAllocator.java @@ -28,7 +28,7 @@ public interface LedgerAllocator extends Allocator { /** - * Start the ledger allocator. The implementaion should not be blocking call. + * Start the ledger allocator. The implementation should not be blocking call. */ void start() throws IOException;