Skip to content

Commit

Permalink
chore: fix some typos in package org.apache.bookkeeper.bookie.storage (
Browse files Browse the repository at this point in the history
  • Loading branch information
hanmz authored Apr 24, 2024
1 parent b812912 commit 01c9149
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void writeByteBuf(ByteBuf bytebuf) throws IOException {
*/
int readInt(int offset) throws IOException {
if (!hasData(offset, Integer.BYTES)) {
throw new IOException(exMsg("Buffer cannot satify int read")
throw new IOException(exMsg("Buffer cannot satisfy int read")
.kv("offset", offset)
.kv("bufferSize", bufferSize).toString());
}
Expand All @@ -150,7 +150,7 @@ int readInt(int offset) throws IOException {
*/
long readLong(int offset) throws IOException {
if (!hasData(offset, Long.BYTES)) {
throw new IOException(exMsg("Buffer cannot satify long read")
throw new IOException(exMsg("Buffer cannot satisfy long read")
.kv("offset", offset)
.kv("bufferSize", bufferSize).toString());
}
Expand All @@ -166,7 +166,7 @@ long readLong(int offset) throws IOException {

/**
* Read a bytebuf of size from the buffer at the given offset.
* If there are not enough bytes in the buffer to satify the read, some of the bytes are read
* If there are not enough bytes in the buffer to satisfy the read, some of the bytes are read
* into the byte buffer and the number of bytes read is returned.
*/
int readByteBuf(ByteBuf buffer, int offset, int size) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public void flush() throws IOException {
f.get();
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
throw new IOException("Interruped while flushing", ie);
throw new IOException("Interrupted while flushing", ie);
} catch (ExecutionException ee) {
if (ee.getCause() instanceof IOException) {
throw (IOException) ee.getCause();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ public static void readLedgerIndexEntries(long ledgerId, ServerConfiguration ser
LedgerLoggerProcessor processor) throws IOException {

checkNotNull(serverConf, "ServerConfiguration can't be null");
checkNotNull(processor, "LedgerLoggger info processor can't null");
checkNotNull(processor, "LedgerLogger info processor can't null");

DiskChecker diskChecker = new DiskChecker(serverConf.getDiskUsageThreshold(),
serverConf.getDiskUsageWarnThreshold());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ private ByteBuf doGetEntry(long ledgerId, long entryId) throws IOException, Book
return entry;
}

private void fillReadAheadCache(long orginalLedgerId, long firstEntryId, long firstEntryLocation) {
private void fillReadAheadCache(long originalLedgerId, long firstEntryId, long firstEntryLocation) {
long readAheadStartNano = MathUtils.nowInNano();
int count = 0;
long size = 0;
Expand All @@ -663,20 +663,20 @@ private void fillReadAheadCache(long orginalLedgerId, long firstEntryId, long fi
long currentEntryLocation = firstEntryLocation;

while (chargeReadAheadCache(count, size) && currentEntryLogId == firstEntryLogId) {
ByteBuf entry = entryLogger.readEntry(orginalLedgerId,
ByteBuf entry = entryLogger.readEntry(originalLedgerId,
firstEntryId, currentEntryLocation);

try {
long currentEntryLedgerId = entry.getLong(0);
long currentEntryId = entry.getLong(8);

if (currentEntryLedgerId != orginalLedgerId) {
if (currentEntryLedgerId != originalLedgerId) {
// Found an entry belonging to a different ledger, stopping read-ahead
break;
}

// Insert entry in read cache
readCache.put(orginalLedgerId, currentEntryId, entry);
readCache.put(originalLedgerId, currentEntryId, entry);

count++;
firstEntryId++;
Expand All @@ -690,7 +690,7 @@ private void fillReadAheadCache(long orginalLedgerId, long firstEntryId, long fi
}
} catch (Exception e) {
if (log.isDebugEnabled()) {
log.debug("Exception during read ahead for ledger: {}: e", orginalLedgerId, e);
log.debug("Exception during read ahead for ledger: {}: e", originalLedgerId, e);
}
} finally {
dbLedgerStorageStats.getReadAheadBatchCountStats().registerSuccessfulValue(count);
Expand Down Expand Up @@ -720,7 +720,7 @@ public ByteBuf getLastEntry(long ledgerId) throws IOException, BookieException {
ByteBuf entry = writeCache.getLastEntry(ledgerId);
if (entry != null) {
if (log.isDebugEnabled()) {
long foundLedgerId = entry.readLong(); // ledgedId
long foundLedgerId = entry.readLong(); // ledgerId
long entryId = entry.readLong();
entry.resetReaderIndex();
if (log.isDebugEnabled()) {
Expand All @@ -737,7 +737,7 @@ public ByteBuf getLastEntry(long ledgerId) throws IOException, BookieException {
entry = writeCacheBeingFlushed.getLastEntry(ledgerId);
if (entry != null) {
if (log.isDebugEnabled()) {
entry.readLong(); // ledgedId
entry.readLong(); // ledgerId
long entryId = entry.readLong();
entry.resetReaderIndex();
if (log.isDebugEnabled()) {
Expand Down Expand Up @@ -856,7 +856,7 @@ public void checkpoint(Checkpoint checkpoint) throws IOException {
dbLedgerStorageStats.getFlushSizeStats().registerSuccessfulValue(sizeToFlush);
} catch (IOException e) {
recordFailedEvent(dbLedgerStorageStats.getFlushStats(), startTime);
// Leave IOExecption as it is
// Leave IOException as it is
throw e;
} finally {
try {
Expand Down

0 comments on commit 01c9149

Please sign in to comment.