Skip to content

Commit 2eb70b1

Browse files
author
ZhangJian He
authored
ci: add typo ci check and fix typos (#4375)
### Motivation Introduce typos ci to avoid typos. See https://lists.apache.org/thread/04hqqcnkfc5189zsxj0s5wm37t2x7bky Signed-off-by: ZhangJian He <shoothzj@gmail.com>
1 parent 45e4328 commit 2eb70b1

84 files changed

Lines changed: 222 additions & 158 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/bk-ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,14 @@ jobs:
483483
if: cancelled()
484484
run: ./dev/ci-tool print_thread_dumps
485485

486+
typo-check:
487+
name: Typo Check
488+
runs-on: ubuntu-latest
489+
steps:
490+
- uses: actions/checkout@v4
491+
- name: Check typos
492+
uses: crate-ci/typos@master
493+
486494
owasp-dependency-check:
487495
name: OWASP Dependency Check
488496
runs-on: ubuntu-latest

.typos.toml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
[default.extend-words]
21+
# abbr
22+
"ba" = "ba"
23+
"bve" = "bve"
24+
"cace" = "cace"
25+
"cann" = "cann"
26+
"dbe" = "dbe"
27+
"entrys" = "entrys"
28+
"fo" = "fo"
29+
"ine" = "ine"
30+
"isse" = "isse"
31+
"mor" = "mor"
32+
"nwe" = "nwe"
33+
"nd" = "nd"
34+
"nin" = "nin"
35+
"oce" = "oce"
36+
"ot" = "ot"
37+
"ser" = "ser"
38+
"shouldnot" = "shouldnot"
39+
"tio" = "tio"
40+
"ue" = "ue"
41+
# keep for comptability
42+
"deleteable" = "deleteable"
43+
"infinit" = "infinit"
44+
"explict" = "explict"
45+
"uninitalize" = "uninitalize"
46+
# keyword fp
47+
"guage" = "guage"
48+
"passin" = "passin"
49+
"testng" = "testng"
50+
"vertx" = "vertx"
51+
"verticle" = "verticle"
52+
53+
[files]
54+
extend-exclude = [
55+
"bookkeeper-server/src/test/java/org/apache/bookkeeper/meta/TestLedgerMetadataSerDe.java",
56+
]

bookkeeper-common/src/main/java/org/apache/bookkeeper/common/util/Retries.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public static <ReturnT> CompletableFuture<ReturnT> run(
7575
* @param task a task to execute.
7676
* @param scheduler scheduler to schedule the task and complete the futures.
7777
* @param key the submit key for the scheduler.
78-
* @param <ReturnT> the return tye.
78+
* @param <ReturnT> the return type.
7979
* @return future represents the result of the task with retries.
8080
*/
8181
public static <ReturnT> CompletableFuture<ReturnT> run(

bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieShell.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ int runCmd(CommandLine cmdLine) throws Exception {
323323
}
324324

325325
/**
326-
* Intializes new cluster by creating required znodes for the cluster. If
326+
* Initializes new cluster by creating required znodes for the cluster. If
327327
* ledgersrootpath is already existing then it will error out. If for any
328328
* reason it errors out while creating znodes for the cluster, then before
329329
* running initnewcluster again, try nuking existing cluster by running
@@ -704,7 +704,7 @@ int runCmd(CommandLine cmdLine) throws Exception {
704704

705705
ReadLedgerCommand cmd = new ReadLedgerCommand(entryFormatter, ledgerIdFormatter);
706706
ReadLedgerCommand.ReadLedgerFlags flags = new ReadLedgerCommand.ReadLedgerFlags();
707-
flags.bookieAddresss(bookieAddress);
707+
flags.bookieAddress(bookieAddress);
708708
flags.firstEntryId(firstEntry);
709709
flags.forceRecovery(forceRecovery);
710710
flags.lastEntryId(lastEntry);

bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogManagerForEntryLogPerLedger.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class EntryLogsPerLedgerCounter {
152152
* 'expiry duration' and 'maximumSize' will be set to
153153
* entryLogPerLedgerCounterLimitsMultFactor times of
154154
* 'ledgerIdEntryLogMap' cache limits. This is needed because entries
155-
* from 'ledgerIdEntryLogMap' can be removed from cache becasue of
155+
* from 'ledgerIdEntryLogMap' can be removed from cache because of
156156
* accesstime expiry or cache size limits, but to know the actual number
157157
* of entrylogs per ledger, we should maintain this count for long time.
158158
*/

bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLoggerAllocator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ BufferedLogChannel createNewLogForCompaction(File dirForNextEntryLog) throws IOE
137137
}
138138
}
139139

140-
void setWritingLogId(long lodId) {
141-
this.writingLogId = lodId;
140+
void setWritingLogId(long logId) {
141+
this.writingLogId = logId;
142142
}
143143

144144
void setWritingCompactingLogId(long logId) {

bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/InterleavedLedgerStorage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ public void onRotateEntryLog() {
569569
// for interleaved ledger storage, we request a checkpoint when rotating a entry log file.
570570
// the checkpoint represent the point that all the entries added before this point are already
571571
// in ledger storage and ready to be synced to disk.
572-
// TODO: we could consider remove checkpointSource and checkpointSouce#newCheckpoint
572+
// TODO: we could consider remove checkpointSource and checkpointSource#newCheckpoint
573573
// later if we provide kind of LSN (Log/Journal Squeuence Number)
574574
// mechanism when adding entry. {@link https://github.com/apache/bookkeeper/issues/279}
575575
Checkpoint checkpoint = checkpointSource.newCheckpoint();

bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDirsManager.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,20 +200,20 @@ public List<File> getWritableLedgerDirsForNewLog() throws NoWritableLedgerDirExc
200200

201201
List<File> getDirsAboveUsableThresholdSize(long thresholdSize, boolean loggingNoWritable)
202202
throws NoWritableLedgerDirException {
203-
List<File> fullLedgerDirsToAccomodate = new ArrayList<File>();
203+
List<File> fullLedgerDirsToAccommodate = new ArrayList<File>();
204204
for (File dir: this.ledgerDirectories) {
205205
// Pick dirs which can accommodate little more than thresholdSize
206206
if (dir.getUsableSpace() > thresholdSize) {
207-
fullLedgerDirsToAccomodate.add(dir);
207+
fullLedgerDirsToAccommodate.add(dir);
208208
}
209209
}
210210

211-
if (!fullLedgerDirsToAccomodate.isEmpty()) {
211+
if (!fullLedgerDirsToAccommodate.isEmpty()) {
212212
if (loggingNoWritable) {
213213
LOG.info("No writable ledger dirs below diskUsageThreshold. "
214-
+ "But Dirs that can accommodate {} are: {}", thresholdSize, fullLedgerDirsToAccomodate);
214+
+ "But Dirs that can accommodate {} are: {}", thresholdSize, fullLedgerDirsToAccommodate);
215215
}
216-
return fullLedgerDirsToAccomodate;
216+
return fullLedgerDirsToAccommodate;
217217
}
218218

219219
// We will reach here when we find no ledgerDir which has atleast

bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDirsMonitor.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ private void check(final LedgerDirsManager ldm) {
124124
}
125125
}
126126

127-
List<File> fullfilledDirs = new ArrayList<File>(ldm.getFullFilledLedgerDirs());
127+
List<File> fulfilledDirs = new ArrayList<File>(ldm.getFullFilledLedgerDirs());
128128
boolean makeWritable = ldm.hasWritableLedgerDirs();
129129

130130
// When bookie is in READONLY mode, i.e there are no writableLedgerDirs:
131-
// - Update fullfilledDirs disk usage.
131+
// - Update fulfilledDirs disk usage.
132132
// - If the total disk usage is below DiskLowWaterMarkUsageThreshold
133-
// add fullfilledDirs back to writableLedgerDirs list if their usage is < conf.getDiskUsageThreshold.
133+
// add fulfilledDirs back to writableLedgerDirs list if their usage is < conf.getDiskUsageThreshold.
134134
try {
135135
if (!makeWritable) {
136136
float totalDiskUsage = diskChecker.getTotalDiskUsage(ldm.getAllLedgerDirs());
@@ -144,7 +144,7 @@ private void check(final LedgerDirsManager ldm) {
144144
}
145145
}
146146
// Update all full-filled disk space usage
147-
for (File dir : fullfilledDirs) {
147+
for (File dir : fulfilledDirs) {
148148
try {
149149
diskUsages.put(dir, diskChecker.checkDir(dir));
150150
if (makeWritable) {
@@ -254,7 +254,7 @@ private void checkDirs(final LedgerDirsManager ldm)
254254

255255
private void validateThreshold(float diskSpaceThreshold, float diskSpaceLwmThreshold) {
256256
if (diskSpaceThreshold <= 0 || diskSpaceThreshold >= 1 || diskSpaceLwmThreshold - diskSpaceThreshold > 1e-6) {
257-
throw new IllegalArgumentException("Disk space threashold: "
257+
throw new IllegalArgumentException("Disk space threshold: "
258258
+ diskSpaceThreshold + " and lwm threshold: " + diskSpaceLwmThreshold
259259
+ " are not valid. Should be > 0 and < 1 and diskSpaceThreshold >= diskSpaceLwmThreshold");
260260
}

bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/ReadCache.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
*
4242
* <p>Uses the specified amount of memory and pairs it with a hashmap.
4343
*
44-
* <p>The memory is splitted in multiple segments that are used in a
44+
* <p>The memory is split in multiple segments that are used in a
4545
* ring-buffer fashion. When the read cache is full, the oldest segment
4646
* is cleared and rotated to make space for new entries to be added to
4747
* the read cache.

0 commit comments

Comments
 (0)