diff --git a/.github/workflows/bk-ci.yml b/.github/workflows/bk-ci.yml index 0dc2c7c5b30..3a211863762 100644 --- a/.github/workflows/bk-ci.yml +++ b/.github/workflows/bk-ci.yml @@ -483,6 +483,14 @@ jobs: if: cancelled() run: ./dev/ci-tool print_thread_dumps + typo-check: + name: Typo Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Check typos + uses: crate-ci/typos@master + owasp-dependency-check: name: OWASP Dependency Check runs-on: ubuntu-latest diff --git a/.github/workflows/owasp-daily-build.yml b/.github/workflows/owasp-daily-build.yml index 88dea1712cb..b79e123799a 100644 --- a/.github/workflows/owasp-daily-build.yml +++ b/.github/workflows/owasp-daily-build.yml @@ -29,6 +29,9 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Check typos + uses: crate-ci/typos@master + - name: Tune Runner VM uses: ./.github/actions/tune-runner-vm diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 00000000000..e8ef1d3a280 --- /dev/null +++ b/.typos.toml @@ -0,0 +1,56 @@ +# +# 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. +# + +[default.extend-words] +# abbr +"ba" = "ba" +"bve" = "bve" +"cace" = "cace" +"cann" = "cann" +"dbe" = "dbe" +"entrys" = "entrys" +"fo" = "fo" +"ine" = "ine" +"isse" = "isse" +"mor" = "mor" +"nwe" = "nwe" +"nd" = "nd" +"nin" = "nin" +"oce" = "oce" +"ot" = "ot" +"ser" = "ser" +"shouldnot" = "shouldnot" +"tio" = "tio" +"ue" = "ue" +# keep for comptability +"deleteable" = "deleteable" +"infinit" = "infinit" +"explict" = "explict" +"uninitalize" = "uninitalize" +# keyword fp +"guage" = "guage" +"passin" = "passin" +"testng" = "testng" +"vertx" = "vertx" +"verticle" = "verticle" + +[files] +extend-exclude = [ + "bookkeeper-server/src/test/java/org/apache/bookkeeper/meta/TestLedgerMetadataSerDe.java", +] diff --git a/bookkeeper-common/src/main/java/org/apache/bookkeeper/common/util/Retries.java b/bookkeeper-common/src/main/java/org/apache/bookkeeper/common/util/Retries.java index 6a52ef597c1..dff0075ac6d 100644 --- a/bookkeeper-common/src/main/java/org/apache/bookkeeper/common/util/Retries.java +++ b/bookkeeper-common/src/main/java/org/apache/bookkeeper/common/util/Retries.java @@ -75,7 +75,7 @@ public static CompletableFuture run( * @param task a task to execute. * @param scheduler scheduler to schedule the task and complete the futures. * @param key the submit key for the scheduler. - * @param the return tye. + * @param the return type. * @return future represents the result of the task with retries. */ public static CompletableFuture run( 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/BookieShell.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieShell.java index 663bea1709d..00869c7fc85 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieShell.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieShell.java @@ -323,7 +323,7 @@ int runCmd(CommandLine cmdLine) throws Exception { } /** - * 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 @@ -704,7 +704,7 @@ int runCmd(CommandLine cmdLine) throws Exception { ReadLedgerCommand cmd = new ReadLedgerCommand(entryFormatter, ledgerIdFormatter); ReadLedgerCommand.ReadLedgerFlags flags = new ReadLedgerCommand.ReadLedgerFlags(); - flags.bookieAddresss(bookieAddress); + flags.bookieAddress(bookieAddress); flags.firstEntryId(firstEntry); flags.forceRecovery(forceRecovery); flags.lastEntryId(lastEntry); diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogManagerForEntryLogPerLedger.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogManagerForEntryLogPerLedger.java index 6846b6b27fd..ca6224ea83c 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogManagerForEntryLogPerLedger.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogManagerForEntryLogPerLedger.java @@ -152,7 +152,7 @@ class EntryLogsPerLedgerCounter { * 'expiry duration' and 'maximumSize' will be set to * entryLogPerLedgerCounterLimitsMultFactor times of * 'ledgerIdEntryLogMap' cache limits. This is needed because entries - * from 'ledgerIdEntryLogMap' can be removed from cache becasue of + * from 'ledgerIdEntryLogMap' can be removed from cache because of * accesstime expiry or cache size limits, but to know the actual number * of entrylogs per ledger, we should maintain this count for long time. */ diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLoggerAllocator.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLoggerAllocator.java index aec2fb1cd0d..70b76aaf376 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLoggerAllocator.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLoggerAllocator.java @@ -137,8 +137,8 @@ BufferedLogChannel createNewLogForCompaction(File dirForNextEntryLog) throws IOE } } - void setWritingLogId(long lodId) { - this.writingLogId = lodId; + void setWritingLogId(long logId) { + this.writingLogId = logId; } void setWritingCompactingLogId(long logId) { 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/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/bookie/InterleavedLedgerStorage.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/InterleavedLedgerStorage.java index 323f7012bc7..4c6b7a9ee4d 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/InterleavedLedgerStorage.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/InterleavedLedgerStorage.java @@ -569,7 +569,7 @@ public void onRotateEntryLog() { // for interleaved ledger storage, we request a checkpoint when rotating a entry log file. // the checkpoint represent the point that all the entries added before this point are already // in ledger storage and ready to be synced to disk. - // TODO: we could consider remove checkpointSource and checkpointSouce#newCheckpoint + // TODO: we could consider remove checkpointSource and checkpointSource#newCheckpoint // later if we provide kind of LSN (Log/Journal Squeuence Number) // mechanism when adding entry. {@link https://github.com/apache/bookkeeper/issues/279} Checkpoint checkpoint = checkpointSource.newCheckpoint(); diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDirsManager.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDirsManager.java index 42910b02486..6689c96df57 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDirsManager.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDirsManager.java @@ -200,20 +200,20 @@ public List getWritableLedgerDirsForNewLog() throws NoWritableLedgerDirExc List getDirsAboveUsableThresholdSize(long thresholdSize, boolean loggingNoWritable) throws NoWritableLedgerDirException { - List fullLedgerDirsToAccomodate = new ArrayList(); + List fullLedgerDirsToAccommodate = new ArrayList(); for (File dir: this.ledgerDirectories) { // Pick dirs which can accommodate little more than thresholdSize if (dir.getUsableSpace() > thresholdSize) { - fullLedgerDirsToAccomodate.add(dir); + fullLedgerDirsToAccommodate.add(dir); } } - if (!fullLedgerDirsToAccomodate.isEmpty()) { + if (!fullLedgerDirsToAccommodate.isEmpty()) { if (loggingNoWritable) { LOG.info("No writable ledger dirs below diskUsageThreshold. " - + "But Dirs that can accommodate {} are: {}", thresholdSize, fullLedgerDirsToAccomodate); + + "But Dirs that can accommodate {} are: {}", thresholdSize, fullLedgerDirsToAccommodate); } - return fullLedgerDirsToAccomodate; + return fullLedgerDirsToAccommodate; } // We will reach here when we find no ledgerDir which has atleast diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDirsMonitor.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDirsMonitor.java index 7ad8ba1e0c5..32321aee277 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDirsMonitor.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDirsMonitor.java @@ -124,13 +124,13 @@ private void check(final LedgerDirsManager ldm) { } } - List fullfilledDirs = new ArrayList(ldm.getFullFilledLedgerDirs()); + List fulfilledDirs = new ArrayList(ldm.getFullFilledLedgerDirs()); boolean makeWritable = ldm.hasWritableLedgerDirs(); // When bookie is in READONLY mode, i.e there are no writableLedgerDirs: - // - Update fullfilledDirs disk usage. + // - Update fulfilledDirs disk usage. // - If the total disk usage is below DiskLowWaterMarkUsageThreshold - // add fullfilledDirs back to writableLedgerDirs list if their usage is < conf.getDiskUsageThreshold. + // add fulfilledDirs back to writableLedgerDirs list if their usage is < conf.getDiskUsageThreshold. try { if (!makeWritable) { float totalDiskUsage = diskChecker.getTotalDiskUsage(ldm.getAllLedgerDirs()); @@ -144,7 +144,7 @@ private void check(final LedgerDirsManager ldm) { } } // Update all full-filled disk space usage - for (File dir : fullfilledDirs) { + for (File dir : fulfilledDirs) { try { diskUsages.put(dir, diskChecker.checkDir(dir)); if (makeWritable) { @@ -254,7 +254,7 @@ private void checkDirs(final LedgerDirsManager ldm) private void validateThreshold(float diskSpaceThreshold, float diskSpaceLwmThreshold) { if (diskSpaceThreshold <= 0 || diskSpaceThreshold >= 1 || diskSpaceLwmThreshold - diskSpaceThreshold > 1e-6) { - throw new IllegalArgumentException("Disk space threashold: " + throw new IllegalArgumentException("Disk space threshold: " + diskSpaceThreshold + " and lwm threshold: " + diskSpaceLwmThreshold + " are not valid. Should be > 0 and < 1 and diskSpaceThreshold >= diskSpaceLwmThreshold"); } diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/ReadCache.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/ReadCache.java index ab2bc33cb43..1d850c456c6 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/ReadCache.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/ReadCache.java @@ -41,7 +41,7 @@ * *

Uses the specified amount of memory and pairs it with a hashmap. * - *

The memory is splitted in multiple segments that are used in a + *

The memory is split in multiple segments that are used in a * ring-buffer fashion. When the read cache is full, the oldest segment * is cleared and rotated to make space for new entries to be added to * the read cache. diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeper.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeper.java index d7043dc8c9a..751d40ef536 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeper.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeper.java @@ -706,7 +706,7 @@ public MetadataClientDriver getMetadataClientDriver() { * cheap to compute but does not protect against byzantine bookies (i.e., a * bookie might report fake bytes and a matching CRC32). The MAC code is more * expensive to compute, but is protected by a password, i.e., a bookie can't - * report fake bytes with a mathching MAC unless it knows the password. + * report fake bytes with a matching MAC unless it knows the password. * The CRC32C, which use SSE processor instruction, has better performance than CRC32. * Legacy DigestType for backward compatibility. If we want to add new DigestType, * we should add it in here, client.api.DigestType and DigestType in DataFormats.proto. diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeperAdmin.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeperAdmin.java index 1df915f650b..371c2145323 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeperAdmin.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeperAdmin.java @@ -1297,7 +1297,7 @@ public Boolean apply(MetadataBookieDriver driver) { } /** - * 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. * * @param conf @@ -1569,7 +1569,7 @@ public void triggerAudit() * Triggers AuditTask by resetting lostBookieRecoveryDelay and then make * sure the ledgers stored in the given decommissioning bookie are properly * replicated and they are not underreplicated because of the given bookie. - * This method waits untill there are no underreplicatedledgers because of this + * This method waits until there are no underreplicatedledgers because of this * bookie. If the given Bookie is not shutdown yet, then it will throw * BKIllegalOpException. * @@ -1612,7 +1612,7 @@ public void decommissionBookie(BookieId bookieAddress) Set ledgersStoredInThisBookie = bookieToLedgersMap.get(bookieAddress.toString()); if ((ledgersStoredInThisBookie != null) && (!ledgersStoredInThisBookie.isEmpty())) { /* - * wait untill all the ledgers are replicated to other + * wait until all the ledgers are replicated to other * bookies by making sure that these ledgers metadata don't * contain this bookie as part of their ensemble. */ diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/DistributionSchedule.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/DistributionSchedule.java index 2646d3abc51..295cbd9faa4 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/DistributionSchedule.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/DistributionSchedule.java @@ -22,7 +22,7 @@ import org.apache.bookkeeper.net.BookieId; /** - * This interface determins how entries are distributed among bookies. + * This interface determines how entries are distributed among bookies. * *

Every entry gets replicated to some number of replicas. The first replica for * an entry is given a replicaIndex of 0, and so on. To distribute write load, diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/EnsemblePlacementPolicy.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/EnsemblePlacementPolicy.java index 05a687b964d..58d2bc0fc42 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/EnsemblePlacementPolicy.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/EnsemblePlacementPolicy.java @@ -369,7 +369,7 @@ default void updateBookieInfo(Map bookieInfoMap) { * *

The default implementation will pick a bookie randomly from the ensemble. * Other placement policies will be able to do better decisions based on - * additional informations (eg: rack or region awareness). + * additional information (eg: rack or region awareness). * * @param metadata * the {@link LedgerMetadata} object diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerFragmentReplicator.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerFragmentReplicator.java index 3d58bdae36c..f6d54e1d02b 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerFragmentReplicator.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerFragmentReplicator.java @@ -233,11 +233,11 @@ void replicate(final LedgerHandle lh, final LedgerFragment lf, final Set targetBookieAddresses, final BiConsumer onReadEntryFailureCallback) throws InterruptedException { - Set partionedFragments = splitIntoSubFragments(lh, lf, + Set partitionedFragments = splitIntoSubFragments(lh, lf, bkc.getConf().getRereplicationEntryBatchSize()); LOG.info("Replicating fragment {} in {} sub fragments.", - lf, partionedFragments.size()); - replicateNextBatch(lh, partionedFragments.iterator(), + lf, partitionedFragments.size()); + replicateNextBatch(lh, partitionedFragments.iterator(), ledgerFragmentMcb, targetBookieAddresses, onReadEntryFailureCallback); } @@ -559,7 +559,7 @@ private void updateAverageEntrySize(int toSendSize) { /** * Callback for recovery of a single ledger fragment. Once the fragment has * had all entries replicated, update the ensemble in zookeeper. Once - * finished propogate callback up to ledgerFragmentsMcb which should be a + * finished propagate callback up to ledgerFragmentsMcb which should be a * multicallback responsible for all fragments in a single ledger */ static class SingleFragmentCallback implements AsyncCallback.VoidCallback { diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java index c49aa656163..6a15cb42f72 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java @@ -785,7 +785,7 @@ public void readComplete(int rc, LedgerHandle lh, Enumeration seq, * Read a sequence of entries asynchronously, allowing to read after the LastAddConfirmed range. *
This is the same of * {@link #asyncReadEntries(long, long, ReadCallback, Object) } - * but it lets the client read without checking the local value of LastAddConfirmed, so that it is possibile to + * but it lets the client read without checking the local value of LastAddConfirmed, so that it is possible to * read entries for which the writer has not received the acknowledge yet.
* For entries which are within the range 0..LastAddConfirmed BookKeeper guarantees that the writer has successfully * received the acknowledge.
@@ -1009,7 +1009,7 @@ private CompletableFuture batchReadEntriesInternalAsync(long star * Read a sequence of entries asynchronously, allowing to read after the LastAddConfirmed range. *
This is the same of * {@link #asyncReadEntries(long, long, ReadCallback, Object) } - * but it lets the client read without checking the local value of LastAddConfirmed, so that it is possibile to + * but it lets the client read without checking the local value of LastAddConfirmed, so that it is possible to * read entries for which the writer has not received the acknowledge yet.
* For entries which are within the range 0..LastAddConfirmed BookKeeper guarantees that the writer has successfully * received the acknowledge.
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/WeightedRandomSelectionImpl.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/WeightedRandomSelectionImpl.java index 16443c63d2c..1a2b9f0dcd5 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/WeightedRandomSelectionImpl.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/WeightedRandomSelectionImpl.java @@ -37,7 +37,7 @@ class WeightedRandomSelectionImpl implements WeightedRandomSelection { Double randomMax; int maxProbabilityMultiplier; Map map; - TreeMap cummulativeMap = new TreeMap(); + TreeMap cumulativeMap = new TreeMap(); ReadWriteLock rwLock = new ReentrantReadWriteLock(true); WeightedRandomSelectionImpl() { @@ -120,10 +120,10 @@ public int compare(WeightedObject o1, WeightedObject o2) { // The probability of picking a bookie randomly is defaultPickProbability // but we change that priority by looking at the weight that each bookie // carries. - TreeMap tmpCummulativeMap = new TreeMap(); + TreeMap tmpCumulativeMap = new TreeMap(); Double key = 0.0; for (Map.Entry e : weightMap.entrySet()) { - tmpCummulativeMap.put(key, e.getKey()); + tmpCumulativeMap.put(key, e.getKey()); if (LOG.isDebugEnabled()) { LOG.debug("Key: {} Value: {} AssignedKey: {} AssignedWeight: {}", e.getKey(), e.getValue(), key, e.getValue()); @@ -134,7 +134,7 @@ public int compare(WeightedObject o1, WeightedObject o2) { rwLock.writeLock().lock(); try { this.map = map; - cummulativeMap = tmpCummulativeMap; + cumulativeMap = tmpCumulativeMap; randomMax = key; } finally { rwLock.writeLock().unlock(); @@ -148,8 +148,8 @@ public T getNextRandom() { // pick a random number between 0 and randMax Double randomNum = randomMax * Math.random(); // find the nearest key in the map corresponding to the randomNum - Double key = cummulativeMap.floorKey(randomNum); - return cummulativeMap.get(key); + Double key = cumulativeMap.floorKey(randomNum); + return cumulativeMap.get(key); } finally { rwLock.readLock().unlock(); } diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/api/OpenBuilder.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/api/OpenBuilder.java index a0c09a3c924..9b843a1711a 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/api/OpenBuilder.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/api/OpenBuilder.java @@ -53,7 +53,7 @@ public interface OpenBuilder extends OpBuilder { OpenBuilder withRecovery(boolean recovery); /** - * Sets the password to be used to open the ledger. It defauls to an empty password + * Sets the password to be used to open the ledger. It defaults to an empty password * * @param password the password to unlock the ledger * diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/api/ReadHandle.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/api/ReadHandle.java index e9bcddd0b39..8e2e633a35a 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/api/ReadHandle.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/api/ReadHandle.java @@ -95,7 +95,7 @@ default LedgerEntries batchRead(long startEntry, int maxCount, long maxSize) * Read a sequence of entries asynchronously, allowing to read after the LastAddConfirmed range. *
This is the same of * {@link #read(long, long) } - * but it lets the client read without checking the local value of LastAddConfirmed, so that it is possibile to + * but it lets the client read without checking the local value of LastAddConfirmed, so that it is possible to * read entries for which the writer has not received the acknowledge yet.
* For entries which are within the range 0..LastAddConfirmed BookKeeper guarantees that the writer has successfully * received the acknowledge.
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/api/WriteAdvHandle.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/api/WriteAdvHandle.java index 7fd80a06375..9c33ecfbb18 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/api/WriteAdvHandle.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/api/WriteAdvHandle.java @@ -29,7 +29,7 @@ import org.apache.bookkeeper.common.concurrent.FutureUtils; /** - * Provide write access to a ledger. Using WriteAdvHandler the writer MUST explictly set an entryId. Beware that the + * Provide write access to a ledger. Using WriteAdvHandler the writer MUST explicitly set an entryId. Beware that the * write for a given entryId will be acknowledged if and only if all entries up to entryId - 1 have been acknowledged * too (expected from entryId 0) * diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ClientConfiguration.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ClientConfiguration.java index feae6924655..cb942d99b29 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ClientConfiguration.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ClientConfiguration.java @@ -980,7 +980,7 @@ public ClientConfiguration setFirstSpeculativeReadTimeout(int timeout) { } /** - * Multipler to use when determining time between successive speculative read requests. + * Multiplier to use when determining time between successive speculative read requests. * * @return speculative read timeout backoff multiplier. */ @@ -989,10 +989,10 @@ public float getSpeculativeReadTimeoutBackoffMultiplier() { } /** - * Set the multipler to use when determining time between successive speculative read requests. + * Set the multiplier to use when determining time between successive speculative read requests. * * @param speculativeReadTimeoutBackoffMultiplier - * multipler to use when determining time between successive speculative read requests. + * multiplier to use when determining time between successive speculative read requests. * @return client configuration. */ public ClientConfiguration setSpeculativeReadTimeoutBackoffMultiplier( @@ -1002,7 +1002,7 @@ public ClientConfiguration setSpeculativeReadTimeoutBackoffMultiplier( } /** - * Multipler to use when determining time between successive speculative read LAC requests. + * Multiplier to use when determining time between successive speculative read LAC requests. * * @return speculative read LAC timeout backoff multiplier. */ @@ -1011,10 +1011,10 @@ public float getSpeculativeReadLACTimeoutBackoffMultiplier() { } /** - * Set the multipler to use when determining time between successive speculative read LAC requests. + * Set the multiplier to use when determining time between successive speculative read LAC requests. * * @param speculativeReadLACTimeoutBackoffMultiplier - * multipler to use when determining time between successive speculative read LAC requests. + * multiplier to use when determining time between successive speculative read LAC requests. * @return client configuration. */ public ClientConfiguration setSpeculativeReadLACTimeoutBackoffMultiplier( @@ -1193,7 +1193,7 @@ public boolean isStickyReadsEnabled() { * preference) to read all entries for a ledger. * *

Having all the read to one bookie will increase the chances that - * a read request will be fullfilled by Bookie read cache (or OS file + * a read request will be fulfilled by Bookie read cache (or OS file * system cache) when doing sequential reads. * * @param enabled the flag to enable/disable sticky reads. diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ServerConfiguration.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ServerConfiguration.java index 51e45dc6f80..7785bfae0bb 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ServerConfiguration.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ServerConfiguration.java @@ -409,7 +409,7 @@ public ServerConfiguration setEntryLogFilePreAllocationEnabled(boolean enabled) /** * Get Garbage collection wait time. Default value is 10 minutes. * The guideline is not to set a too low value for this, if using zookeeper based - * ledger manager. And it would be nice to align with the average lifecyle time of + * ledger manager. And it would be nice to align with the average lifecycle time of * ledgers in the system. * * @return gc wait time @@ -1223,7 +1223,7 @@ public String getBookieId() { * Configure the bookie to advertise a specific BookieId. * *

By default, a bookie will advertise a BookieId computed - * from the primary network endpoint addresss. + * from the primary network endpoint address. * * @see #getBookieId() * @see #setAdvertisedAddress(java.lang.String) diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/discover/ZKRegistrationClient.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/discover/ZKRegistrationClient.java index 2f143c07f60..cca631086b0 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/discover/ZKRegistrationClient.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/discover/ZKRegistrationClient.java @@ -369,7 +369,7 @@ private CompletableFuture>> getChildren(String regPath, .collect(bookieInfoUpdated) .whenComplete((List> info, Throwable error) -> { // we are ignoring errors intentionally - // there could be bookies that publish unparseable information + // there could be bookies that publish unparsable information // or other temporary/permanent errors future.complete(new Versioned<>(bookies, version)); }); diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/feature/SettableFeature.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/feature/SettableFeature.java index bb6d1db091e..797f5badee7 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/feature/SettableFeature.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/feature/SettableFeature.java @@ -28,16 +28,16 @@ public SettableFeature(String name, int initialAvailability) { super(name, initialAvailability); } - public SettableFeature(String name, boolean isAvailabile) { - super(name, isAvailabile); + public SettableFeature(String name, boolean isAvailable) { + super(name, isAvailable); } public void set(int availability) { this.availability = availability; } - public void set(boolean isAvailabile) { - this.availability = isAvailabile ? FEATURE_AVAILABILITY_MAX_VALUE : 0; + public void set(boolean isAvailable) { + this.availability = isAvailable ? FEATURE_AVAILABILITY_MAX_VALUE : 0; } } diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/AbstractHierarchicalLedgerManager.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/AbstractHierarchicalLedgerManager.java index c7a730cc730..4a1ad27bb5e 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/AbstractHierarchicalLedgerManager.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/AbstractHierarchicalLedgerManager.java @@ -190,7 +190,7 @@ protected NavigableSet ledgerListToSet(List ledgerNodes, String pa NavigableSet zkActiveLedgers = new TreeSet(); if (!path.startsWith(ledgerRootPath)) { - LOG.warn("Ledger path [{}] is not a valid path name, it should start wth {}", path, ledgerRootPath); + LOG.warn("Ledger path [{}] is not a valid path name, it should start with {}", path, ledgerRootPath); return zkActiveLedgers; } diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/AbstractZkLedgerManager.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/AbstractZkLedgerManager.java index 102c7d7792b..59b17be922b 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/AbstractZkLedgerManager.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/AbstractZkLedgerManager.java @@ -553,7 +553,7 @@ public void processResult(int rc, String path, Object ctx, Stat stat) { * Process ledgers in a single zk node. * *

- * for each ledger found in this zk node, processor#process(ledgerId) will be triggerred + * for each ledger found in this zk node, processor#process(ledgerId) will be triggered * to process a specific ledger. after all ledgers has been processed, the finalCb will * be called with provided context object. The RC passed to finalCb is decided by : *

    diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/LedgerManager.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/LedgerManager.java index 2f08c2e5b7c..db197ce02e6 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/LedgerManager.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/LedgerManager.java @@ -97,7 +97,7 @@ public interface LedgerManager extends Closeable { * @param currentVersion * The version of the metadata we expect to be overwriting. * @return Future which, when completed, contains the newly written metadata. - * Comleted with an exceptione:
      + * Completed with an exception:
        *
      • {@link org.apache.bookkeeper.client.BKException.BKMetadataVersionException} * if version in metadata doesn't match
      • *
      • {@link org.apache.bookkeeper.client.BKException.ZKException} for other issue
      • @@ -130,9 +130,9 @@ CompletableFuture> writeLedgerMetadata(long ledgerId, * Loop to process all ledgers. *

        *

          - * After all ledgers were processed, finalCb will be triggerred: + * After all ledgers were processed, finalCb will be triggered: *
        • if all ledgers are processed done with OK, success rc will be passed to finalCb. - *
        • if some ledgers are prcoessed failed, failure rc will be passed to finalCb. + *
        • if some ledgers are processed failed, failure rc will be passed to finalCb. *
        *

        * @@ -145,7 +145,7 @@ CompletableFuture> writeLedgerMetadata(long ledgerId, * @param successRc * Success RC code passed to finalCb when callback * @param failureRc - * Failure RC code passed to finalCb when exceptions occured. + * Failure RC code passed to finalCb when exceptions occurred. */ void asyncProcessLedgers(Processor processor, AsyncCallback.VoidCallback finalCb, Object context, int successRc, int failureRc); diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/LedgerUnderreplicationManager.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/LedgerUnderreplicationManager.java index 256f7814d73..64548fbd131 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/LedgerUnderreplicationManager.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/LedgerUnderreplicationManager.java @@ -49,7 +49,7 @@ default void markLedgerUnderreplicated(long ledgerId, String missingReplica) thr /** * Mark a ledger as underreplicated with missing bookies. The replication should then - * check which fragements are underreplicated and rereplicate them. + * check which fragments are underreplicated and rereplicate them. * * @param ledgerId ledger id * @param missingReplicas missing replicas diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/MSLedgerManagerFactory.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/MSLedgerManagerFactory.java index fa4776bd286..bc9ae3a35a2 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/MSLedgerManagerFactory.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/MSLedgerManagerFactory.java @@ -488,7 +488,7 @@ public CompletableFuture> writeLedgerMetadata(long led @Override public void complete(int rc, Version version, Object ctx) { if (MSException.Code.BadVersion.getCode() == rc) { - LOG.info("Bad version provided to updat metadata for ledger {}", ledgerId); + LOG.info("Bad version provided to update metadata for ledger {}", ledgerId); promise.completeExceptionally(new BKException.BKMetadataVersionException()); } else if (MSException.Code.NoKey.getCode() == rc) { LOG.warn("Ledger {} doesn't exist when writing its ledger metadata.", ledgerId); @@ -761,7 +761,7 @@ public void format(AbstractConfiguration conf, LayoutManager layoutManager) try { MetastoreUtils.cleanTable(ledgerTable, conf.getMetastoreMaxEntriesPerScan()); } catch (MSException mse) { - throw new IOException("Exception when cleanning up table " + TABLE_NAME, mse); + throw new IOException("Exception when cleaning up table " + TABLE_NAME, mse); } LOG.info("Finished cleaning up table {}.", TABLE_NAME); // Delete and recreate the LAYOUT information. diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/ZkLedgerUnderreplicationManager.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/ZkLedgerUnderreplicationManager.java index fd43fcfa3ef..4118e191319 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/ZkLedgerUnderreplicationManager.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/ZkLedgerUnderreplicationManager.java @@ -73,7 +73,7 @@ /** * ZooKeeper implementation of underreplication manager. - * This is implemented in a heirarchical fashion, so it'll work with + * This is implemented in a hierarchical fashion, so it'll work with * FlatLedgerManagerFactory and HierarchicalLedgerManagerFactory. * *

        Layout is: @@ -82,7 +82,7 @@ * locks/(ledgerId) * *

        The hierarchical path is created by splitting the ledger into 4 2byte - * segments which are represented in hexidecimal. + * segments which are represented in hexadecimal. * e.g. For ledger id 0xcafebeef0000feed, the path is * cafe/beef/0000/feed/ */ diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/metastore/MSException.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/metastore/MSException.java index 3fbcf538d9e..f0d2c3bc74d 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/metastore/MSException.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/metastore/MSException.java @@ -40,7 +40,7 @@ public enum Code { InterruptedException (-100, "Operation interrupted"), IllegalOp (-101, "Illegal operation"), ServiceDown (-102, "Metadata service is down"), - OperationFailure(-103, "Operaion failed on metadata storage server side"); + OperationFailure(-103, "Operation failed on metadata storage server side"); private static final Map codes = new HashMap(); diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/metastore/MetaStore.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/metastore/MetaStore.java index 8d7c5d4a7c8..04eb74f2eb7 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/metastore/MetaStore.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/metastore/MetaStore.java @@ -31,7 +31,7 @@ public interface MetaStore { String getName(); /** - * Get the plugin verison. + * Get the plugin version. * * @return the plugin version. */ 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/net/NodeBase.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/net/NodeBase.java index 46442f50c1f..8e0233ad163 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/net/NodeBase.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/net/NodeBase.java @@ -48,7 +48,7 @@ public NodeBase() { /** * Construct a node from its path. * @param path - * a concatenation of this node's location, the path seperator, and its name + * a concatenation of this node's location, the path separator, and its name */ public NodeBase(String path) { path = normalize(path); diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieProtoEncoding.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieProtoEncoding.java index d8bfb4257a8..0c3b7bf8e8e 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieProtoEncoding.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieProtoEncoding.java @@ -475,7 +475,7 @@ private static ByteBuf serializeProtobuf(MessageLite msg, ByteBufAllocator alloc // a heap buffer while serializing and pass it down to netty library. // In AbstractChannel#filterOutboundMessage(), netty copies that data to a direct buffer if // it is currently in heap (otherwise skips it and uses it directly). - // Allocating a direct buffer reducing unncessary CPU cycles for buffer copies in BK client + // Allocating a direct buffer reducing unnecessary CPU cycles for buffer copies in BK client // and also helps alleviate pressure off the GC, since there is less memory churn. // Bookies aren't usually CPU bound. This change improves READ_ENTRY code paths by a small factor as well. ByteBuf buf = allocator.directBuffer(frameSize, frameSize); diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java index 8485d21b74f..bb61387161f 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java @@ -588,7 +588,7 @@ protected ChannelFuture connect() { } // In the netty pipeline, we need to split packets based on length, so we - // use the {@link LengthFieldBasedFramDecoder}. Other than that all actions + // use the {@link LengthFieldBasedFrameDecoder}. Other than that all actions // are carried out in this class, e.g., making sense of received messages, // prepending the length to outgoing packets etc. bootstrap.handler(new ChannelInitializer() { @@ -2374,7 +2374,7 @@ private void handleResponse(long ledgerId, long entryId, } } - // visable for testing + // visible for testing CompletionKey newCompletionKey(long txnId, OperationType operationType) { return new TxnCompletionKey(txnId, operationType); } diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/ReadEntryProcessorV3.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/ReadEntryProcessorV3.java index fb0b4f62a87..3a85ca0949a 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/ReadEntryProcessorV3.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/ReadEntryProcessorV3.java @@ -200,7 +200,7 @@ protected ReadResponse getReadResponse() { .setLedgerId(ledgerId) .setEntryId(entryId); try { - // handle fence reqest + // handle fence request if (RequestUtils.isFenceRequest(readRequest)) { LOG.info("Ledger fence request received for ledger: {} from address: {}", ledgerId, channel.remoteAddress()); diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/WriteEntryProcessorV3.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/WriteEntryProcessorV3.java index 381b887a169..3aaa9219f9a 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/WriteEntryProcessorV3.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/WriteEntryProcessorV3.java @@ -126,7 +126,7 @@ public void writeComplete(int rc, long ledgerId, long entryId, status = StatusCode.EOK; } catch (OperationRejectedException e) { requestProcessor.getRequestStats().getAddEntryRejectedCounter().inc(); - // Avoid to log each occurence of this exception as this can happen when the ledger storage is + // Avoid to log each occurrence of this exception as this can happen when the ledger storage is // unable to keep up with the write rate. if (logger.isDebugEnabled()) { logger.debug("Operation rejected while writing {}", request, e); diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/ReplicationWorker.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/ReplicationWorker.java index cf1f2f2f598..c32487a30bc 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/ReplicationWorker.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/ReplicationWorker.java @@ -558,7 +558,7 @@ private boolean rereplicate(long ledgerIdToReplicate) throws InterruptedExceptio * *

        To avoid this situation, we need to check if bookies in the final open ensemble * are unavailable, and take action if so. The action to take is to close the ledger, - * after a grace period as the writting client may replace the faulty bookie on its + * after a grace period as the writing client may replace the faulty bookie on its * own. * *

        Missing bookies in closed ledgers are fine, as we know the last confirmed add, so diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/streaming/LedgerOutputStream.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/streaming/LedgerOutputStream.java index ed73293a546..94866877dc8 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/streaming/LedgerOutputStream.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/streaming/LedgerOutputStream.java @@ -89,7 +89,7 @@ public synchronized void flush() { try { lh.addEntry(b); } catch (InterruptedException ie) { - LOG.warn("Interrupted while flusing " + ie); + LOG.warn("Interrupted while flushing " + ie); Thread.currentThread().interrupt(); } catch (BKException bke) { LOG.warn("BookKeeper exception ", bke); diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/tls/TLSContextFactory.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/tls/TLSContextFactory.java index 03f9951d8ca..7570436b952 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/tls/TLSContextFactory.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/tls/TLSContextFactory.java @@ -263,7 +263,7 @@ private synchronized void updateClientContext() // get key-file and trust-file locations and passwords if (!(config instanceof ClientConfiguration)) { - throw new SecurityException("Client configruation not provided"); + throw new SecurityException("Client configuration not provided"); } clientConf = (ClientConfiguration) config; @@ -387,7 +387,7 @@ private synchronized void updateServerContext() throws SecurityException, KeySto // get key-file and trust-file locations and passwords if (!(config instanceof ServerConfiguration)) { - throw new SecurityException("Server configruation not provided"); + throw new SecurityException("Server configuration not provided"); } serverConf = (ServerConfiguration) config; diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/tools/cli/commands/bookie/LedgerCommand.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/tools/cli/commands/bookie/LedgerCommand.java index fa753e9f472..7434706b9fe 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/tools/cli/commands/bookie/LedgerCommand.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/tools/cli/commands/bookie/LedgerCommand.java @@ -136,8 +136,8 @@ private void initLedgerIdFormatter(ServerConfiguration conf, LedgerFlags flags) private boolean dumpLedgerInfo(long ledgerId, ServerConfiguration conf) { try { - DbLedgerStorage.readLedgerIndexEntries(ledgerId, conf, (currentEntry, entryLodId, position) -> System.out - .println("entry " + currentEntry + "\t:\t(log: " + entryLodId + ", pos: " + position + ")")); + DbLedgerStorage.readLedgerIndexEntries(ledgerId, conf, (currentEntry, entryLogId, position) -> System.out + .println("entry " + currentEntry + "\t:\t(log: " + entryLogId + ", pos: " + position + ")")); } catch (IOException e) { System.err.printf("ERROR: initializing dbLedgerStorage %s", e.getMessage()); return false; diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/tools/cli/commands/bookie/ReadLedgerCommand.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/tools/cli/commands/bookie/ReadLedgerCommand.java index 20b4232e314..e07dc9d9d9e 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/tools/cli/commands/bookie/ReadLedgerCommand.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/tools/cli/commands/bookie/ReadLedgerCommand.java @@ -109,7 +109,7 @@ public static class ReadLedgerFlags extends CliFlags { private boolean forceRecovery; @Parameter(names = { "-b", "--bookie" }, description = "Only read from a specific bookie") - private String bookieAddresss; + private String bookieAddress; @Parameter(names = { "-lf", "--ledgeridformatter" }, description = "Set ledger id formatter") private String ledgerIdFormatter; @@ -146,9 +146,9 @@ private boolean readledger(ServerConfiguration serverConf, ReadLedgerFlags flags long lastEntry = flags.lastEntryId; final BookieId bookie; - if (flags.bookieAddresss != null) { + if (flags.bookieAddress != null) { // A particular bookie was specified - bookie = BookieId.parse(flags.bookieAddresss); + bookie = BookieId.parse(flags.bookieAddress); } else { bookie = null; } diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/tools/cli/commands/bookie/RegenerateInterleavedStorageIndexFileCommand.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/tools/cli/commands/bookie/RegenerateInterleavedStorageIndexFileCommand.java index bbf933fda86..c50e808116e 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/tools/cli/commands/bookie/RegenerateInterleavedStorageIndexFileCommand.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/tools/cli/commands/bookie/RegenerateInterleavedStorageIndexFileCommand.java @@ -79,7 +79,7 @@ public static class RISIFFlags extends CliFlags { description = "The password in base64 encoding, for cases where the password is not UTF-8.") private String b64Password = DEFAULT; - @Parameter(names = { "-d", "--dryrun" }, description = "Process the entryLogger, but don't write anthing.") + @Parameter(names = { "-d", "--dryrun" }, description = "Process the entryLogger, but don't write anything.") private boolean dryRun; @Parameter(names = { "-l", "--ledgerids" }, 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/main/java/org/apache/bookkeeper/tools/cli/commands/client/LedgerMetaDataCommand.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/tools/cli/commands/client/LedgerMetaDataCommand.java index 4bbb50e7cc1..430c0dde21d 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/tools/cli/commands/client/LedgerMetaDataCommand.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/tools/cli/commands/client/LedgerMetaDataCommand.java @@ -137,7 +137,7 @@ private boolean handler(ServerConfiguration conf, LedgerMetadataFlag flag) throw be; } m.writeLedgerMetadata(flag.ledgerId, md, new LongVersion(-1L)).join(); - LOG.info("successsfully updated ledger metadata {}", flag.ledgerId); + LOG.info("successfully updated ledger metadata {}", flag.ledgerId); } } else { printLedgerMetadata(flag.ledgerId, m.readLedgerMetadata(flag.ledgerId).get().getValue(), true); diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/AvailabilityOfEntriesOfLedger.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/AvailabilityOfEntriesOfLedger.java index 24361cede97..cf221f5dda7 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/AvailabilityOfEntriesOfLedger.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/AvailabilityOfEntriesOfLedger.java @@ -178,14 +178,14 @@ private boolean isEntryAvailable(long entryId) { public AvailabilityOfEntriesOfLedger(PrimitiveIterator.OfLong entriesOfLedgerItr) { while (entriesOfLedgerItr.hasNext()) { - this.addEntryToAvailabileEntriesOfLedger(entriesOfLedgerItr.nextLong()); + this.addEntryToAvailableEntriesOfLedger(entriesOfLedgerItr.nextLong()); } this.closeStateOfEntriesOfALedger(); } public AvailabilityOfEntriesOfLedger(long[] entriesOfLedger) { for (long entry : entriesOfLedger) { - this.addEntryToAvailabileEntriesOfLedger(entry); + this.addEntryToAvailableEntriesOfLedger(entry); } this.closeStateOfEntriesOfALedger(); } @@ -310,7 +310,7 @@ private void addCurSequenceToSequenceGroup() { } } - private void addEntryToAvailabileEntriesOfLedger(long entryId) { + private void addEntryToAvailableEntriesOfLedger(long entryId) { if (!isCurSequenceInitialized()) { initializeCurSequence(entryId); } else if (isEntryExistingInCurSequence(entryId)) { diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/DiskChecker.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/DiskChecker.java index db8d350c975..0cac7b80433 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/DiskChecker.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/DiskChecker.java @@ -276,7 +276,7 @@ void setDiskSpaceThreshold(float diskSpaceThreshold, float diskUsageWarnThreshol private void validateThreshold(float diskSpaceThreshold, float diskSpaceWarnThreshold) { if (diskSpaceThreshold <= 0 || diskSpaceThreshold >= 1 || diskSpaceWarnThreshold - diskSpaceThreshold > 1e-6) { - throw new IllegalArgumentException("Disk space threashold: " + throw new IllegalArgumentException("Disk space threshold: " + diskSpaceThreshold + " and warn threshold: " + diskSpaceWarnThreshold + " are not valid. Should be > 0 and < 1 and diskSpaceThreshold >= diskSpaceWarnThreshold"); } diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/StringUtils.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/StringUtils.java index 1a752003ef8..edbe49989d2 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/StringUtils.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/StringUtils.java @@ -22,7 +22,7 @@ import org.apache.bookkeeper.proto.BookkeeperProtocol; /** - * Provided utilites for parsing network addresses, ledger-id from node paths + * Provided utilities for parsing network addresses, ledger-id from node paths * etc. * */ @@ -163,7 +163,7 @@ public static long stringToHierarchicalLedgerId(String...levelNodes) throws IOEx } /** - * Builds string representation of teh request without extra (i.e. binary) data + * Builds string representation of the request without extra (i.e. binary) data * * @param request * @return string representation of request diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/ZkUtils.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/ZkUtils.java index 6b8ef86cc3e..48ea04a3f4d 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/ZkUtils.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/ZkUtils.java @@ -41,7 +41,7 @@ import org.slf4j.LoggerFactory; /** - * Provided utilites for zookeeper access, etc. + * Provided utilities for zookeeper access, etc. */ public class ZkUtils { private static final Logger LOG = LoggerFactory.getLogger(ZkUtils.class); diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/SynchronizedHashMultiMap.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/SynchronizedHashMultiMap.java index 942d6da2817..db7bd0bf53e 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/SynchronizedHashMultiMap.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/SynchronizedHashMultiMap.java @@ -33,7 +33,7 @@ * *

        Implementation is aimed at storing PerChannelBookieClient completions when there * are duplicates. If the key is a pooled object, it must not exist once the value - * has been removed from the map, which can happen with guava multimap implemenations. + * has been removed from the map, which can happen with guava multimap implementations. * *

        With this map is implemented with pretty heavy locking, but this shouldn't be an * issue as the multimap only needs to be used in rare cases, i.e. when a user tries 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/StaticDNSResolver.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/StaticDNSResolver.java index 72e61212fbd..07da660a878 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/StaticDNSResolver.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/StaticDNSResolver.java @@ -73,7 +73,7 @@ public static void reset() { @Override public List resolve(List names) { if (getBookieAddressResolver() == null) { - // test that this istance has been properly initialized + // test that this instance has been properly initialized throw new IllegalStateException("bookieAddressResolver was not set"); } List racks = new ArrayList(); 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/conf/bk_server.conf b/conf/bk_server.conf index ebedf206eb3..555e92034c6 100644 --- a/conf/bk_server.conf +++ b/conf/bk_server.conf @@ -419,14 +419,14 @@ journalDirectories=/tmp/bk-txn # @Deprecated - `sortedLedgerStorageEnabled` is deprecated in favor of using `ledgerStorageClass` # Whether sorted-ledger storage enabled (default true) -# sortedLedgerStorageEnabled=ture +# sortedLedgerStorageEnabled=true # Directory Bookkeeper outputs ledger snapshots # could define multi directories to store snapshots, separated by ',' # For example: # ledgerDirectories=/tmp/bk1-data,/tmp/bk2-data # -# Ideally ledger dirs and journal dir are each in a differet device, +# Ideally ledger dirs and journal dir are each in a different device, # which reduce the contention between random i/o and sequential write. # It is possible to run with a single disk, but performance will be significantly lower. ledgerDirectories=/tmp/bk-data @@ -636,7 +636,7 @@ gcEntryLogMetadataCacheEnabled=false # For each ledger dir, maximum disk space which can be used. # Default is 0.95f. i.e. 95% of disk can be used at most after which nothing will -# be written to that partition. If all ledger dir partions are full, then bookie +# be written to that partition. If all ledger dir partitions are full, then bookie # will turn to readonly mode if 'readOnlyModeEnabled=true' is set, else it will # shutdown. Bookie will also suspend the minor and major compaction when usage threshold is exceed # if `isForceGCAllowWhenNoSpace` is disabled. When the usage becomes lower than the threshold, the major and minor @@ -715,7 +715,7 @@ gcEntryLogMetadataCacheEnabled=false # Size of a index page in ledger cache, in bytes # A larger index page can improve performance writing page to disk, -# which is efficent when you have small number of ledgers and these +# which is efficient when you have small number of ledgers and these # ledgers have similar number of entries. # If you have large number of ledgers and each ledger has fewer entries, # smaller index page would improve memory usage. @@ -728,7 +728,7 @@ gcEntryLogMetadataCacheEnabled=false # pageLimit*pageSize should not more than JVM max memory limitation, # otherwise you would got OutOfMemoryException. # In general, incrementing pageLimit, using smaller index page would -# gain bettern performance in lager number of ledgers with fewer entries case +# gain better performance in lager number of ledgers with fewer entries case # If pageLimit is -1, bookie server will use 1/3 of JVM memory to compute # the limitation of number of index pages. # pageLimit=-1 diff --git a/conf/zookeeper.conf b/conf/zookeeper.conf index 89c985194ca..77e3524079a 100644 --- a/conf/zookeeper.conf +++ b/conf/zookeeper.conf @@ -58,7 +58,7 @@ maxClientCnxns=100 electionAlg=3 # Leader accepts client connections. Default value is "yes". The leader -# machine coordinates updates. For higher update throughput at thes slight +# machine coordinates updates. For higher update throughput at these slight # expense of read throughput the leader can be configured to not accept # clients and focus on coordination. leaderServes=yes 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/src/owasp-dependency-check-suppressions.xml b/src/owasp-dependency-check-suppressions.xml index a141bb39bef..337506b241a 100644 --- a/src/owasp-dependency-check-suppressions.xml +++ b/src/owasp-dependency-check-suppressions.xml @@ -20,7 +20,7 @@ --> - + CVE-2021-43045 affects only .NET distro, see https://github.com/apache/avro/pull/1357 diff --git a/stats/bookkeeper-stats-providers/codahale-metrics-provider/src/main/java/org/apache/bookkeeper/stats/codahale/FastTimer.java b/stats/bookkeeper-stats-providers/codahale-metrics-provider/src/main/java/org/apache/bookkeeper/stats/codahale/FastTimer.java index f3a3374f35c..e7a65afb3ae 100644 --- a/stats/bookkeeper-stats-providers/codahale-metrics-provider/src/main/java/org/apache/bookkeeper/stats/codahale/FastTimer.java +++ b/stats/bookkeeper-stats-providers/codahale-metrics-provider/src/main/java/org/apache/bookkeeper/stats/codahale/FastTimer.java @@ -163,7 +163,7 @@ public class FastTimer extends Timer { /* * Buckets for percentiles store response times according to the definition in BUCKET_SPEC in the - * form of { numerOfBuckets , nanosecondResolutionPerBucket }. + * form of { numberOfBuckets , nanosecondResolutionPerBucket }. * * BUCKET_SPEC_FINE: * This bucket definition provides fine-grained timing for small values, and more coarse-grained timing diff --git a/stats/bookkeeper-stats-providers/prometheus-metrics-provider/src/main/java/org/apache/bookkeeper/stats/prometheus/DataSketchesOpStatsLogger.java b/stats/bookkeeper-stats-providers/prometheus-metrics-provider/src/main/java/org/apache/bookkeeper/stats/prometheus/DataSketchesOpStatsLogger.java index 015c3d3b247..921cbc728b7 100644 --- a/stats/bookkeeper-stats-providers/prometheus-metrics-provider/src/main/java/org/apache/bookkeeper/stats/prometheus/DataSketchesOpStatsLogger.java +++ b/stats/bookkeeper-stats-providers/prometheus-metrics-provider/src/main/java/org/apache/bookkeeper/stats/prometheus/DataSketchesOpStatsLogger.java @@ -145,12 +145,12 @@ public void rotateLatencyCollection() { current = replacement; replacement = local; - final DoublesUnion aggregateSuccesss = new DoublesUnionBuilder().build(); + final DoublesUnion aggregateSuccess = new DoublesUnionBuilder().build(); final DoublesUnion aggregateFail = new DoublesUnionBuilder().build(); local.map.forEach((localData, b) -> { long stamp = localData.lock.writeLock(); try { - aggregateSuccesss.update(localData.successSketch); + aggregateSuccess.update(localData.successSketch); localData.successSketch.reset(); aggregateFail.update(localData.failSketch); localData.failSketch.reset(); @@ -159,7 +159,7 @@ public void rotateLatencyCollection() { } }); - successResult = aggregateSuccesss.getResultAndReset(); + successResult = aggregateSuccess.getResultAndReset(); failResult = aggregateFail.getResultAndReset(); } 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/api/src/main/java/org/apache/bookkeeper/api/kv/result/DeleteResult.java b/stream/api/src/main/java/org/apache/bookkeeper/api/kv/result/DeleteResult.java index 5950c7e1e73..e49ed1f2909 100644 --- a/stream/api/src/main/java/org/apache/bookkeeper/api/kv/result/DeleteResult.java +++ b/stream/api/src/main/java/org/apache/bookkeeper/api/kv/result/DeleteResult.java @@ -29,7 +29,7 @@ public interface DeleteResult extends Result { /** * Returns the list of previous kv pairs of the keys - * deleted in ths op. + * deleted in this op. * * @return the list of previous kv pairs. */ diff --git a/stream/clients/java/all/src/main/java/org/apache/bookkeeper/clients/StorageClientBuilder.java b/stream/clients/java/all/src/main/java/org/apache/bookkeeper/clients/StorageClientBuilder.java index f873e88a7c0..572282e74d6 100644 --- a/stream/clients/java/all/src/main/java/org/apache/bookkeeper/clients/StorageClientBuilder.java +++ b/stream/clients/java/all/src/main/java/org/apache/bookkeeper/clients/StorageClientBuilder.java @@ -67,7 +67,7 @@ public StorageClientBuilder withSettings(StorageClientSettings settings) { *

        The namespace name will be used for building the stream client for interacting with streams * within the namespace. * - * @param colName colletion name + * @param colName collection name * @return stream client builder. * @see #build() */ 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/clients/java/kv/src/main/java/org/apache/bookkeeper/clients/impl/kv/PByteBufTableImpl.java b/stream/clients/java/kv/src/main/java/org/apache/bookkeeper/clients/impl/kv/PByteBufTableImpl.java index 1bda9716b3d..8b84d96e141 100644 --- a/stream/clients/java/kv/src/main/java/org/apache/bookkeeper/clients/impl/kv/PByteBufTableImpl.java +++ b/stream/clients/java/kv/src/main/java/org/apache/bookkeeper/clients/impl/kv/PByteBufTableImpl.java @@ -53,7 +53,7 @@ import org.apache.bookkeeper.stream.proto.StreamProperties; /** - * The default implemenation of {@link PTable}. + * The default implementation of {@link PTable}. */ @Slf4j public class PByteBufTableImpl implements PTable { diff --git a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/BKAsyncLogWriter.java b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/BKAsyncLogWriter.java index 31cbab62d3a..da7723a383b 100644 --- a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/BKAsyncLogWriter.java +++ b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/BKAsyncLogWriter.java @@ -98,9 +98,9 @@ public void onFailure(Throwable cause) { } /** - * Last pending record in current log segment. After it is satisified, it would + * Last pending record in current log segment. After it is satisfied, it would * roll log segment. - * This implementation is based on the assumption that all future satisified in same + * This implementation is based on the assumption that all future satisfied in same * order future pool. */ class LastPendingLogRecord extends PendingLogRecord { diff --git a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/BKLogReadHandler.java b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/BKLogReadHandler.java index 777e6b1c762..167915a7f02 100644 --- a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/BKLogReadHandler.java +++ b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/BKLogReadHandler.java @@ -85,7 +85,7 @@ *

      • `readahead_worker`/notification_execution: opstats. stats on executions over the notifications received from * zookeeper. *
      • `readahead_worker`/metadata_reinitialization: opstats. stats on metadata reinitialization after receiving - * notifcation from log segments updates. + * notification from log segments updates. *
      • `readahead_worker`/idle_reader_warn: counter. it increases each time the readahead worker detects itself * becoming idle. *
      diff --git a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/BKLogSegmentWriter.java b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/BKLogSegmentWriter.java index 34c855a78f9..fdf34e275dd 100644 --- a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/BKLogSegmentWriter.java +++ b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/BKLogSegmentWriter.java @@ -1298,7 +1298,7 @@ public Void call() throws Exception { } } - // update last dlsn before satisifying future + // update last dlsn before satisfying future if (BKException.Code.OK == transmitResultUpdater.get(this)) { DLSN lastDLSNInPacket = recordSet.finalizeTransmit( logSegmentSequenceNumber, entryId); diff --git a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/DistributedLogConfiguration.java b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/DistributedLogConfiguration.java index f6d84a908bc..7a98fc0135e 100644 --- a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/DistributedLogConfiguration.java +++ b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/DistributedLogConfiguration.java @@ -782,7 +782,7 @@ public DistributedLogConfiguration setZKClientNumberRetryThreads(int numThreads) // /** - * Get BK's zookeeper session timout in milliseconds. + * Get BK's zookeeper session timeout in milliseconds. * *

      This is the session timeout applied for zookeeper client used by bookkeeper client. * Use {@link #getZKSessionTimeoutMilliseconds()} for zookeeper client used @@ -1399,7 +1399,7 @@ public DistributedLogConfiguration setNumResourceReleaseThreads(int numResourceR * Get timeout for shutting down schedulers in dl manager, in milliseconds. * By default, it is 5 seconds. * - * @return timeout for shutting down schedulers in dl manager, in miliseconds. + * @return timeout for shutting down schedulers in dl manager, in milliseconds. */ public int getSchedulerShutdownTimeoutMs() { return getInt(BKDL_SCHEDULER_SHUTDOWN_TIMEOUT_MS, BKDL_SCHEDULER_SHUTDOWN_TIMEOUT_MS_DEFAULT); @@ -1647,7 +1647,7 @@ public DistributedLogConfiguration setEncodeRegionIDInLogSegmentMetadata(boolean *

    * By default it is 1. * - * @return log segment name verison. + * @return log segment name version. */ public int getLogSegmentNameVersion() { return getInt(BKDL_LOGSEGMENT_NAME_VERSION, BKDL_LOGSEGMENT_NAME_VERSION_DEFAULT); @@ -3264,7 +3264,7 @@ public boolean getFederatedCheckExistenceWhenCacheMiss() { } /** - * Enable check existence of a log if quering local cache of a federated namespace missed. + * Enable check existence of a log if querying local cache of a federated namespace missed. * * @param enabled * flag to enable/disable this feature. @@ -3585,7 +3585,7 @@ public void validate() { long readerIdleWarnThresholdMs = getReaderIdleWarnThresholdMillis(); if (readerIdleWarnThresholdMs > 0) { // NOTE: some test cases set the idle warn threshold to 0 checkArgument(readerIdleWarnThresholdMs > 2 * getReadLACLongPollTimeout(), - "Invalid configuration: ReaderIdleWarnThreshold should be 2x larget than readLACLongPollTimeout"); + "Invalid configuration: ReaderIdleWarnThreshold should be 2x larger than readLACLongPollTimeout"); } } diff --git a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/ZooKeeperClient.java b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/ZooKeeperClient.java index 91af155a469..ff23ff07828 100644 --- a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/ZooKeeperClient.java +++ b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/ZooKeeperClient.java @@ -212,7 +212,7 @@ public synchronized ZooKeeper get() + name + " failed on establishing zookeeper connection", ioe); } - // This indicates that the client was explictly closed + // This indicates that the client was explicitly closed if (closed) { throw new ZooKeeperConnectionException("Client " + name + " has already been closed"); } diff --git a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/ZooKeeperClientBuilder.java b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/ZooKeeperClientBuilder.java index 755cd824662..716cbc6e01a 100644 --- a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/ZooKeeperClientBuilder.java +++ b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/ZooKeeperClientBuilder.java @@ -51,8 +51,8 @@ public static ZooKeeperClientBuilder newBuilder() { private String name = "default"; // sessionTimeoutMs private int sessionTimeoutMs = -1; - // conectionTimeoutMs - private int conectionTimeoutMs = -1; + // connectionTimeoutMs + private int connectionTimeoutMs = -1; // zkServers private String zkServers = null; // retry policy @@ -92,8 +92,8 @@ public synchronized ZooKeeperClientBuilder name(String name) { */ public synchronized ZooKeeperClientBuilder sessionTimeoutMs(int sessionTimeoutMs) { this.sessionTimeoutMs = sessionTimeoutMs; - if (this.conectionTimeoutMs <= 0) { - this.conectionTimeoutMs = 2 * sessionTimeoutMs; + if (this.connectionTimeoutMs <= 0) { + this.connectionTimeoutMs = 2 * sessionTimeoutMs; } return this; } @@ -116,7 +116,7 @@ public synchronized ZooKeeperClientBuilder requestRateLimit(double requestRateLi * @return builder */ public synchronized ZooKeeperClientBuilder connectionTimeoutMs(int connectionTimeoutMs) { - this.conectionTimeoutMs = connectionTimeoutMs; + this.connectionTimeoutMs = connectionTimeoutMs; return this; } @@ -191,8 +191,8 @@ public synchronized ZooKeeperClientBuilder zkAclId(String zkAclId) { private void validateParameters() { checkNotNull(zkServers, "No zk servers provided."); - checkArgument(conectionTimeoutMs > 0, - "Invalid connection timeout : %d", conectionTimeoutMs); + checkArgument(connectionTimeoutMs > 0, + "Invalid connection timeout : %d", connectionTimeoutMs); checkArgument(sessionTimeoutMs > 0, "Invalid session timeout : %d", sessionTimeoutMs); checkNotNull(statsLogger, "No stats logger provided."); @@ -222,7 +222,7 @@ private ZooKeeperClient buildClient() { return new ZooKeeperClient( name, sessionTimeoutMs, - conectionTimeoutMs, + connectionTimeoutMs, zkServers, retryPolicy, statsLogger, diff --git a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/api/namespace/Namespace.java b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/api/namespace/Namespace.java index 1b2a7873e22..f018d8ce0ad 100644 --- a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/api/namespace/Namespace.java +++ b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/api/namespace/Namespace.java @@ -139,7 +139,7 @@ DistributedLogManager openLog(String logName) * *

    This method allows the caller to override global configuration settings by * supplying log configuration overrides. Log config overrides come in two flavors, - * static and dynamic. Static config never changes in the lifecyle of DistributedLogManager, + * static and dynamic. Static config never changes in the lifecycle of DistributedLogManager, * dynamic config changes by reloading periodically and safe to access from any context.

    * * @param logName 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; diff --git a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/impl/acl/ZKAccessControlManager.java b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/impl/acl/ZKAccessControlManager.java index 9ca3efc6cf7..5906226407b 100644 --- a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/impl/acl/ZKAccessControlManager.java +++ b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/impl/acl/ZKAccessControlManager.java @@ -185,7 +185,7 @@ public void processResult(int rc, String path, Object ctx, List children @Override public void onSuccess(ZKAccessControl accessControl) { streamEntries.put(streamName, accessControl); - logger.info("Added overrided access control for stream {} : {}", + logger.info("Added override access control for stream {} : {}", streamName, accessControl.getAccessControlEntry()); complete(); } diff --git a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/impl/federated/FederatedZKLogMetadataStore.java b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/impl/federated/FederatedZKLogMetadataStore.java index 028d329e405..79a746e7430 100644 --- a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/impl/federated/FederatedZKLogMetadataStore.java +++ b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/impl/federated/FederatedZKLogMetadataStore.java @@ -139,7 +139,7 @@ public void onStreamsChanged(Iterator newLogsIter) { try { oldLogs = FutureUtils.result(logsFuture); } catch (Exception e) { - logger.error("Unexpected exception when getting logs from a satisified future of {} : ", + logger.error("Unexpected exception when getting logs from a satisfied future of {} : ", uri, e); } logsFuture = new CompletableFuture>(); diff --git a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/lock/ZKDistributedLock.java b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/lock/ZKDistributedLock.java index 4d4c499eeb8..3fc32d54c35 100644 --- a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/lock/ZKDistributedLock.java +++ b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/lock/ZKDistributedLock.java @@ -313,7 +313,7 @@ public synchronized void checkOwnershipAndReacquire() throws LockingException { /** * Check if lock is held. * If not, error out and do not reacquire. Use this in cases where there are many waiters by default - * and reacquire is unlikley to succeed. + * and reacquire is unlikely to succeed. * * @throws LockingException if the lock attempt fails */ diff --git a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/lock/ZKSessionLock.java b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/lock/ZKSessionLock.java index 7d7a2926816..a0ce6b5b9f1 100644 --- a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/lock/ZKSessionLock.java +++ b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/lock/ZKSessionLock.java @@ -74,7 +74,7 @@ * 1. prepare: create a sequential znode to identify the lock. * 2. check lock waiters: get all lock waiters to check after prepare. if it is the first waiter, claim the ownership; * if it is not the first waiter, but first waiter was itself (same client id and same session id) - * claim the ownership too; otherwise, it would set watcher on its sibling and wait it to disappared. + * claim the ownership too; otherwise, it would set watcher on its sibling and wait it to disappeared. *

    * *
    @@ -187,7 +187,7 @@ enum State {
         }
     
         /**
    -     * Convenience class for state management. Provide debuggability features by tracing unxpected state
    +     * Convenience class for state management. Provide debuggability features by tracing unexpected state
          * transitions.
          */
         static class StateManagement {
    @@ -860,7 +860,7 @@ public CompletableFuture asyncUnlock() {
         CompletableFuture asyncUnlock(final Throwable cause) {
             final CompletableFuture promise = new CompletableFuture();
     
    -        // Use lock executor here rather than lock action, because we want this opertaion to be applied
    +        // Use lock executor here rather than lock action, because we want this operation to be applied
             // whether the epoch has changed or not. The member node is EPHEMERAL_SEQUENTIAL so there's no
             // risk of an ABA problem where we delete and recreate a node and then delete it again here.
             lockStateExecutor.executeOrdered(lockPath, () -> {
    diff --git a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/logsegment/LogSegmentEntryReader.java b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/logsegment/LogSegmentEntryReader.java
    index decae9a850a..2ec7445466f 100644
    --- a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/logsegment/LogSegmentEntryReader.java
    +++ b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/logsegment/LogSegmentEntryReader.java
    @@ -84,7 +84,7 @@ interface StateChangeListener {
          *  

    numEntries will be best-effort. * * @param numEntries num entries to read from current log segment - * @return A promise that when satisified will contain a non-empty list of entries with their content. + * @return A promise that when satisfied will contain a non-empty list of entries with their content. * @throw {@link org.apache.distributedlog.exceptions.EndOfLogSegmentException} when * read entries beyond the end of a closed log segment. */ diff --git a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/namespace/NamespaceWatcher.java b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/namespace/NamespaceWatcher.java index 49da3d4f75d..e977040a46f 100644 --- a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/namespace/NamespaceWatcher.java +++ b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/namespace/NamespaceWatcher.java @@ -53,7 +53,7 @@ public void unregisterListener(NamespaceListener listener) { /** * Watch the namespace changes. It would be triggered each time - * a namspace listener is added. The implementation should handle + * a namespace listener is added. The implementation should handle * this. */ protected abstract void watchNamespaceChanges(); 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/main/java/org/apache/distributedlog/tools/DistributedLogTool.java b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/tools/DistributedLogTool.java index 9af7f6dff3e..6588fc27c8f 100644 --- a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/tools/DistributedLogTool.java +++ b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/tools/DistributedLogTool.java @@ -916,8 +916,8 @@ protected static class ShowCommand extends PerStreamCommand { super("show", "show metadata of a given stream and list segments"); options.addOption("ns", "no-log-segments", false, "Do not list log segment metadata"); options.addOption("lp", "placement-stats", false, "Show ensemble placement stats"); - options.addOption("fl", "first-ledger", true, "First log sement no"); - options.addOption("ll", "last-ledger", true, "Last log sement no"); + options.addOption("fl", "first-ledger", true, "First log segment no"); + options.addOption("ll", "last-ledger", true, "Last log segment no"); } @Override diff --git a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/zk/DefaultZKOp.java b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/zk/DefaultZKOp.java index 22ae7cb9fd5..75dab1650e0 100644 --- a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/zk/DefaultZKOp.java +++ b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/zk/DefaultZKOp.java @@ -24,7 +24,7 @@ /** - * Default zookeeper operation. No action on commiting or aborting. + * Default zookeeper operation. No action on committing or aborting. */ public class DefaultZKOp extends ZKOp { diff --git a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/zk/ZKWatcherManager.java b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/zk/ZKWatcherManager.java index 1aabd596365..afd06c2f2a3 100644 --- a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/zk/ZKWatcherManager.java +++ b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/zk/ZKWatcherManager.java @@ -82,9 +82,9 @@ public ZKWatcherManager build() { private final StatsLogger statsLogger; // Gauges and their labels private final Gauge totalWatchesGauge; - private static final String totalWatchesGauageLabel = "total_watches"; + private static final String totalWatchesGaugeLabel = "total_watches"; private final Gauge numChildWatchesGauge; - private static final String numChildWatchesGauageLabel = "num_child_watches"; + private static final String numChildWatchesGaugeLabel = "num_child_watches"; protected final ConcurrentMap> childWatches; protected final LongAdder allWatchesGauge; @@ -112,7 +112,7 @@ public Number getSample() { return allWatchesGauge.sum(); } }; - this.statsLogger.registerGauge(totalWatchesGauageLabel, totalWatchesGauge); + this.statsLogger.registerGauge(totalWatchesGaugeLabel, totalWatchesGauge); numChildWatchesGauge = new Gauge() { @Override @@ -126,7 +126,7 @@ public Number getSample() { } }; - this.statsLogger.registerGauge(numChildWatchesGauageLabel, numChildWatchesGauge); + this.statsLogger.registerGauge(numChildWatchesGaugeLabel, numChildWatchesGauge); } public Watcher registerChildWatcher(String path, Watcher watcher) { @@ -169,8 +169,8 @@ public void unregisterChildWatcher(String path, Watcher watcher, boolean removeF } public void unregisterGauges() { - this.statsLogger.unregisterGauge(totalWatchesGauageLabel, totalWatchesGauge); - this.statsLogger.unregisterGauge(numChildWatchesGauageLabel, numChildWatchesGauge); + this.statsLogger.unregisterGauge(totalWatchesGaugeLabel, totalWatchesGauge); + this.statsLogger.unregisterGauge(numChildWatchesGaugeLabel, numChildWatchesGauge); } @Override 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/distributedlog/core/src/test/resources/bk_server.conf b/stream/distributedlog/core/src/test/resources/bk_server.conf index 0d3cd56d4cb..f094ef36b75 100644 --- a/stream/distributedlog/core/src/test/resources/bk_server.conf +++ b/stream/distributedlog/core/src/test/resources/bk_server.conf @@ -94,7 +94,7 @@ openFileLimit=20000 # Size of a index page in ledger cache, in bytes # A larger index page can improve performance writing page to disk, -# which is efficent when you have small number of ledgers and these +# which is efficient when you have small number of ledgers and these # ledgers have similar number of entries. # If you have large number of ledgers and each ledger has fewer entries, # smaller index page would improve memory usage. @@ -107,7 +107,7 @@ pageSize=8192 # pageLimit*pageSize should not more than JVM max memory limitation, # otherwise you would got OutOfMemoryException. # In general, incrementing pageLimit, using smaller index page would -# gain bettern performance in lager number of ledgers with fewer entries case +# gain better performance in lager number of ledgers with fewer entries case # If pageLimit is -1, bookie server will use 1/3 of JVM memory to compute # the limitation of number of index pages. pageLimit=131072 diff --git a/stream/distributedlog/protocol/src/main/java/org/apache/distributedlog/LogRecord.java b/stream/distributedlog/protocol/src/main/java/org/apache/distributedlog/LogRecord.java index 4de22496779..7101420675c 100644 --- a/stream/distributedlog/protocol/src/main/java/org/apache/distributedlog/LogRecord.java +++ b/stream/distributedlog/protocol/src/main/java/org/apache/distributedlog/LogRecord.java @@ -509,7 +509,7 @@ public LogRecordWithDLSN readOp() throws IOException { try { long metadata = in.readLong(); // Reading the first 8 bytes positions the record stream on the correct log record - // By this time all components of the DLSN are valid so this is where we shoud + // By this time all components of the DLSN are valid so this is where we should // retrieve the currentDLSN and advance to the next // Given that there are 20 bytes following the read position of the previous call // to readLong, we should not have moved ahead in the stream. 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/proto/src/main/proto/stream.proto b/stream/proto/src/main/proto/stream.proto index b16bd22f295..accab87f2db 100644 --- a/stream/proto/src/main/proto/stream.proto +++ b/stream/proto/src/main/proto/stream.proto @@ -83,7 +83,7 @@ message ParentRangesList { // Stream // -// since stream and table are similar and exchangable, +// since stream and table are similar and exchangeable, // from the beginning, we shared the metadata management // between streams and tables and distinguish them using // a flag that recorded in metadata. diff --git a/stream/server/src/main/java/org/apache/bookkeeper/stream/server/service/RegistrationStateService.java b/stream/server/src/main/java/org/apache/bookkeeper/stream/server/service/RegistrationStateService.java index afe33accc0a..8d5ad8b0074 100644 --- a/stream/server/src/main/java/org/apache/bookkeeper/stream/server/service/RegistrationStateService.java +++ b/stream/server/src/main/java/org/apache/bookkeeper/stream/server/service/RegistrationStateService.java @@ -88,7 +88,7 @@ protected void doStart() { log.info("Successfully register myself under registration path {}/{}", regServiceProvider.getRegistrationPath(), NetUtils.endpointToString(myEndpoint)); } catch (Exception e) { - throw new RuntimeException("Failed to intiailize a registration state service", e); + throw new RuntimeException("Failed to initialize a registration state service", e); } } } diff --git a/stream/statelib/src/main/java/org/apache/bookkeeper/statelib/impl/mvcc/MVCCRecord.java b/stream/statelib/src/main/java/org/apache/bookkeeper/statelib/impl/mvcc/MVCCRecord.java index 4e071c3625f..c8a2c0d983d 100644 --- a/stream/statelib/src/main/java/org/apache/bookkeeper/statelib/impl/mvcc/MVCCRecord.java +++ b/stream/statelib/src/main/java/org/apache/bookkeeper/statelib/impl/mvcc/MVCCRecord.java @@ -33,7 +33,7 @@ import org.apache.bookkeeper.stream.proto.kv.store.ValueType; /** - * An object represents the mvcc metdata and value for a given key. + * An object represents the mvcc metadata and value for a given key. */ @Data @Setter diff --git a/stream/statelib/src/main/java/org/apache/bookkeeper/statelib/impl/rocksdb/checkpoint/CheckpointInfo.java b/stream/statelib/src/main/java/org/apache/bookkeeper/statelib/impl/rocksdb/checkpoint/CheckpointInfo.java index 49d06c956ca..f38bf28b388 100644 --- a/stream/statelib/src/main/java/org/apache/bookkeeper/statelib/impl/rocksdb/checkpoint/CheckpointInfo.java +++ b/stream/statelib/src/main/java/org/apache/bookkeeper/statelib/impl/rocksdb/checkpoint/CheckpointInfo.java @@ -38,7 +38,7 @@ /** - * CheckpointInfo encapsulated information and operatation for a checkpoint. + * CheckpointInfo encapsulated information and operation for a checkpoint. */ @Slf4j public class CheckpointInfo implements Comparable { 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/api/src/main/java/org/apache/bookkeeper/stream/storage/api/cluster/ClusterInitializer.java b/stream/storage/api/src/main/java/org/apache/bookkeeper/stream/storage/api/cluster/ClusterInitializer.java index 5808186bbe5..f938dee7f75 100644 --- a/stream/storage/api/src/main/java/org/apache/bookkeeper/stream/storage/api/cluster/ClusterInitializer.java +++ b/stream/storage/api/src/main/java/org/apache/bookkeeper/stream/storage/api/cluster/ClusterInitializer.java @@ -31,10 +31,10 @@ public interface ClusterInitializer { * return true if they understand the subprotocol specified in the URI and * false if they do not. * - * @param metatadataServiceUri the metadata service uri + * @param metadataServiceUri the metadata service uri * @return true if the implementation understands the given URI; false otherwise. */ - boolean acceptsURI(URI metatadataServiceUri); + boolean acceptsURI(URI metadataServiceUri); /** * Create a new cluster under metadata service specified by {@code metadataServiceUri}. 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/main/java/org/apache/bookkeeper/stream/storage/impl/cluster/ZkClusterMetadataStore.java b/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/cluster/ZkClusterMetadataStore.java index 676da4e3391..0d2fd45c47d 100644 --- a/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/cluster/ZkClusterMetadataStore.java +++ b/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/cluster/ZkClusterMetadataStore.java @@ -98,7 +98,7 @@ public boolean initializeCluster(int numStorageContainers, Optional segm ClusterMetadata metadata = ClusterMetadata.newBuilder() .setNumStorageContainers(numStorageContainers) .build(); - ClusterAssignmentData assigmentData = ClusterAssignmentData.newBuilder() + ClusterAssignmentData assignmentData = ClusterAssignmentData.newBuilder() .build(); try { // we are using dlog for the storage backend, so we need to initialize the dlog namespace @@ -110,7 +110,7 @@ public boolean initializeCluster(int numStorageContainers, Optional segm .forOperations( client.transactionOp().create().forPath(zkRootPath), client.transactionOp().create().forPath(zkClusterMetadataPath, metadata.toByteArray()), - client.transactionOp().create().forPath(zkClusterAssignmentPath, assigmentData.toByteArray()), + client.transactionOp().create().forPath(zkClusterAssignmentPath, assignmentData.toByteArray()), client.transactionOp().create().forPath(getServersPath(zkRootPath)), client.transactionOp().create().forPath(getWritableServersPath(zkRootPath)), client.transactionOp().create().forPath(getStoragePath(zkRootPath), dlogMetadata.serialize())); @@ -141,8 +141,8 @@ public ClusterAssignmentData getClusterAssignmentData() { } @Override - public void updateClusterAssignmentData(ClusterAssignmentData assigmentData) { - byte[] data = assigmentData.toByteArray(); + public void updateClusterAssignmentData(ClusterAssignmentData assignmentData) { + byte[] data = assignmentData.toByteArray(); try { client.setData().forPath(zkClusterAssignmentPath, data); } catch (Exception e) { 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..1e80c79989f 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 indicesDir = "/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(indicesDir.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", indicesDir, "-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/indices,/path/to/more/indices"; String instanceId = "test-instance-id"; when(rm.getClusterInstanceId()).thenReturn(instanceId); diff --git a/tools/perf/src/main/java/org/apache/bookkeeper/tools/perf/table/PerfClient.java b/tools/perf/src/main/java/org/apache/bookkeeper/tools/perf/table/PerfClient.java index f8d7c2d02d7..20b9422f213 100644 --- a/tools/perf/src/main/java/org/apache/bookkeeper/tools/perf/table/PerfClient.java +++ b/tools/perf/src/main/java/org/apache/bookkeeper/tools/perf/table/PerfClient.java @@ -144,7 +144,7 @@ public static class Flags extends CliFlags { names = { "-b", "--benchmarks" }, - description = "List of benchamrks to run") + description = "List of benchmarks to run") public List benchmarks; }