Skip to content

Commit 034ef85

Browse files
hezhangjianshoothzj
andauthored
Fix logger member not correct; (apache#2605)
Fix java doc problem Co-authored-by: shoothzj <shooothzj@gmail.com>
1 parent b824a60 commit 034ef85

12 files changed

+31
-21
lines changed

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

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,21 @@
3535
* Provides a buffering layer in front of a FileChannel.
3636
*/
3737
public class BufferedChannel extends BufferedReadChannel implements Closeable {
38-
// The capacity of the write buffer.
38+
/**
39+
* The capacity of the write buffer.
40+
*/
3941
protected final int writeCapacity;
40-
// The position of the file channel's write pointer.
42+
/**
43+
* The position of the file channel's write pointer.
44+
*/
4145
protected AtomicLong writeBufferStartPosition = new AtomicLong(0);
42-
// The buffer used to write operations.
46+
/**
47+
* The buffer used to write operations.
48+
*/
4349
protected final ByteBuf writeBuffer;
44-
// The absolute position of the next write operation.
50+
/**
51+
* The absolute position of the next write operation.
52+
*/
4553
protected volatile long position;
4654

4755
/*
@@ -197,8 +205,11 @@ public synchronized void flush() throws IOException {
197205
writeBufferStartPosition.set(fileChannel.position());
198206
}
199207

200-
/*
208+
/**
201209
* force a sync operation so that data is persisted to the disk.
210+
* @param forceMetadata
211+
* @return
212+
* @throws IOException
202213
*/
203214
public long forceWrite(boolean forceMetadata) throws IOException {
204215
// This is the point up to which we had flushed to the file system page cache

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class EntryLogManagerForSingleEntryLog extends EntryLogManagerBase {
4444
private volatile BufferedLogChannel activeLogChannel;
4545
private long logIdBeforeFlush = INVALID_LID;
4646
private final AtomicBoolean shouldCreateNewEntryLog = new AtomicBoolean(false);
47-
private EntryLogger.RecentEntryLogsStatus recentlyCreatedEntryLogsStatus;
47+
private final EntryLogger.RecentEntryLogsStatus recentlyCreatedEntryLogsStatus;
4848

4949
EntryLogManagerForSingleEntryLog(ServerConfiguration conf, LedgerDirsManager ledgerDirsManager,
5050
EntryLoggerAllocator entryLoggerAllocator, List<EntryLogger.EntryLogListener> listeners,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ private void validateEntry(long ledgerId, long entryId, long entryLogId, long po
814814
}
815815

816816
public ByteBuf internalReadEntry(long ledgerId, long entryId, long location, boolean validateEntry)
817-
throws IOException, Bookie.NoEntryException {
817+
throws IOException {
818818
long entryLogId = logIdForOffset(location);
819819
long pos = posForOffset(location);
820820

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ private int getNumUsedPages() {
394394
return pageCount.get();
395395
}
396396

397-
/**
397+
/**
398398
* Get the ledger entry page for a given <i>pageEntry</i>.
399399
*
400400
* @param ledger

bookkeeper-server/src/main/java/org/apache/bookkeeper/client/DefaultBookieAddressResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public BookieSocketAddress resolve(BookieId bookieId) {
5959
log.debug("Resolving dummy bookie Id {} using legacy bookie resolver", bookieId);
6060
return BookieSocketAddress.resolveDummyBookieId(bookieId);
6161
}
62-
log.info("Cannot resolve {}, bookie is unknown", bookieId, ex.toString());
62+
log.info("Cannot resolve {}, bookie is unknown {}", bookieId, ex.toString());
6363
throw new BookieIdNotResolvedException(bookieId, ex);
6464
} catch (Exception ex) {
6565
if (ex instanceof InterruptedException) {

bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerFragmentReplicator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ private static void updateEnsembleInfo(
437437

438438
updateLoop.run().whenComplete((result, ex) -> {
439439
if (ex == null) {
440-
LOG.info("Updated ZK for ledgerId: ({}:{}) to point ledger fragments"
440+
LOG.info("Updated ZK to point ledger fragments"
441441
+ " from old bookies to new bookies: {}", oldBookie2NewBookie);
442442

443443
ensembleUpdatedCb.processResult(BKException.Code.OK, null, null);

bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,9 @@ public RackawareEnsemblePlacementPolicyImpl initialize(ClientConfiguration conf,
269269
}
270270
} catch (RuntimeException re) {
271271
if (!conf.getEnforceMinNumRacksPerWriteQuorum()) {
272-
LOG.error("Failed to initialize DNS Resolver {}, used default subnet resolver : {}",
272+
LOG.error("Failed to initialize DNS Resolver {}, used default subnet resolver : {} {}",
273273
dnsResolverName, re, re.getMessage());
274-
dnsResolver = new DefaultResolver(() -> this.getDefaultRack());
274+
dnsResolver = new DefaultResolver(this::getDefaultRack);
275275
} else {
276276
/*
277277
* if minNumRacksPerWriteQuorum is enforced, then it

bookkeeper-server/src/main/java/org/apache/bookkeeper/discover/ZKRegistrationClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ private CompletableFuture<Versioned<BookieServiceInfo>> readBookieServiceInfoAsy
271271
bookieServiceInfoCache.put(bookieId, result);
272272
promise.complete(result);
273273
} catch (IOException ex) {
274-
log.error("Cannot update BookieInfo for {}", ex);
274+
log.error("Cannot update BookieInfo for ", ex);
275275
promise.completeExceptionally(KeeperException.create(KeeperException.Code.get(rc), path)
276276
.initCause(ex));
277277
return;
@@ -289,7 +289,7 @@ private CompletableFuture<Versioned<BookieServiceInfo>> readBookieServiceInfoAsy
289289
bookieServiceInfoCache.put(bookieId, result);
290290
promise.complete(result);
291291
} catch (IOException ex) {
292-
log.error("Cannot update BookieInfo for {}", ex);
292+
log.error("Cannot update BookieInfo for ", ex);
293293
promise.completeExceptionally(KeeperException.create(KeeperException.Code.get(rc2), path2)
294294
.initCause(ex));
295295
return;

bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieNettyServer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ protected Queue<Runnable> newTaskQueue(int maxPendingTasks) {
152152
try {
153153
CpuAffinity.acquireCore();
154154
} catch (Throwable t) {
155-
LOG.warn("Failed to acquire CPU core for thread {}", Thread.currentThread().getName(),
156-
t.getMessage(), t);
155+
LOG.warn("Failed to acquire CPU core for thread {} {}",
156+
Thread.currentThread().getName(), t.getMessage(), t);
157157
}
158158
});
159159
}

bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieRequestProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ public void operationComplete(Future<Channel> future) throws Exception {
578578
if (future.isSuccess()) {
579579
LOG.error("TLS Handshake failed: Could not authenticate.");
580580
} else {
581-
LOG.error("TLS Handshake failure: {} ", future.cause());
581+
LOG.error("TLS Handshake failure: ", future.cause());
582582
}
583583
BookkeeperProtocol.Response.Builder errResponse = BookkeeperProtocol.Response.newBuilder()
584584
.setHeader(r.getHeader()).setStatus(BookkeeperProtocol.StatusCode.EIO);

0 commit comments

Comments
 (0)