Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executors;
Expand Down Expand Up @@ -447,7 +448,7 @@ public BookKeeper(ClientConfiguration conf, ZooKeeper zk, EventLoopGroup eventLo
conf,
scheduler,
rootStatsLogger,
java.util.Optional.ofNullable(zkc));
Optional.ofNullable(zkc));
} catch (ConfigurationException ce) {
LOG.error("Failed to initialize metadata client driver using invalid metadata service uri", ce);
throw new IOException("Failed to initialize metadata client driver", ce);
Expand Down Expand Up @@ -569,7 +570,7 @@ private EnsemblePlacementPolicy initializeEnsemblePlacementPolicy(ClientConfigur
throws IOException {
try {
Class<? extends EnsemblePlacementPolicy> policyCls = conf.getEnsemblePlacementPolicy();
return ReflectionUtils.newInstance(policyCls).initialize(conf, java.util.Optional.ofNullable(dnsResolver),
return ReflectionUtils.newInstance(policyCls).initialize(conf, Optional.ofNullable(dnsResolver),
timer, featureProvider, statsLogger, bookieAddressResolver);
} catch (ConfigurationException e) {
throw new IOException("Failed to initialize ensemble placement policy : ", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public void forceLedgerComplete(int rc, long ledgerId, BookieId addr, Object ctx
if (ackSet.completeBookieAndCheck(bookieIndex)) {
completed = true;
// we are able to say that every bookie sync'd its own journal
// for every ackknowledged entry before issuing the force() call
// for every acknowledged entry before issuing the force() call
if (LOG.isDebugEnabled()) {
LOG.debug("After force on ledger {} updating LastAddConfirmed to {} ",
ledgerId, currentNonDurableLastAddConfirmed);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private enum HandleState {

/**
* Next entryId which is expected to move forward during {@link #sendAddSuccessCallbacks() }. This is important
* in order to have an ordered sequence of addEntry ackknowledged to the writer
* in order to have an ordered sequence of addEntry acknowledged to the writer
*/
volatile long pendingAddsSequenceHead;

Expand Down Expand Up @@ -1212,7 +1212,7 @@ void asyncRecoveryAddEntry(final byte[] data, final int offset, final int length
doAsyncAddEntry(op);
}

private boolean isWritesetWritable(DistributionSchedule.WriteSet writeSet,
private boolean isWriteSetWritable(DistributionSchedule.WriteSet writeSet,
long key, int allowedNonWritableCount) {
if (allowedNonWritableCount < 0) {
allowedNonWritableCount = 0;
Expand Down Expand Up @@ -1246,14 +1246,14 @@ protected boolean waitForWritable(DistributionSchedule.WriteSet writeSet, long k
}

final long startTime = MathUtils.nowInNano();
boolean success = isWritesetWritable(writeSet, key, allowedNonWritableCount);
boolean success = isWriteSetWritable(writeSet, key, allowedNonWritableCount);

if (!success && durationMs > 0) {
int backoff = 1;
final int maxBackoff = 4;
final long deadline = startTime + TimeUnit.MILLISECONDS.toNanos(durationMs);

while (!isWritesetWritable(writeSet, key, allowedNonWritableCount)) {
while (!isWriteSetWritable(writeSet, key, allowedNonWritableCount)) {
if (MathUtils.nowInNano() < deadline) {
long maxSleep = MathUtils.elapsedMSec(startTime);
if (maxSleep < 0) {
Expand All @@ -1265,7 +1265,7 @@ protected boolean waitForWritable(DistributionSchedule.WriteSet writeSet, long k
TimeUnit.MILLISECONDS.sleep(sleepMs);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
success = isWritesetWritable(writeSet, key, allowedNonWritableCount);
success = isWriteSetWritable(writeSet, key, allowedNonWritableCount);
break;
}
if (backoff <= maxBackoff) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public void safeRun() {
payload = null;

// We are about to send. Check if we need to make an ensemble change
// becasue of delayed write errors
// because of delayed write errors
lh.maybeHandleDelayedWriteBookieFailure();

// Iterate over set and trigger the sendWriteRequests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
@ToString
public class LedgerLayout {

// version of compability layout version
// version of compatibility layout version
public static final int LAYOUT_MIN_COMPAT_VERSION = 1;
// version of ledger layout metadata
public static final int LAYOUT_FORMAT_VERSION = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public PerChannelBookieClientPool lookupClient(BookieId addr) {
if (null == oldClientPool) {
clientPool = newClientPool;
// initialize the pool only after we put the pool into the map
clientPool.intialize();
clientPool.initialize();
} else {
clientPool = oldClientPool;
newClientPool.close(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void operationComplete(int rc, PerChannelBookieClient pcbc) {
}

@Override
public void intialize() {
public void initialize() {
for (PerChannelBookieClient pcbc : this.clients) {
pcbc.connectIfNeededAndDoOp(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
public interface PerChannelBookieClientPool {

/**
* intialize the pool. the implementation should not be blocked.
* initialize the pool. the implementation should not be blocked.
*/
void intialize();
void initialize();

/**
* Obtain a channel from channel pool to execute operations.
Expand Down
2 changes: 1 addition & 1 deletion site/docs/4.10.0/api/ledger-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ writing the entry to SO buffers without waiting for an fsync.
In this case the LastAddConfirmed pointer is not advanced to the writer side neither is updated on the reader's side, this is because **there is some chance to lose the entry**.
Such entries will be still readable using readUnconfirmed() API, but they won't be readable using Long Poll reads or regular read() API.

In order to get guarantees of durability the writer must use explicitly the [force()](../javadoc/org/apache/bookkeeper/client/api/ForceableHandle) API which will return only after all the bookies in the ensemble ackknowledge the call after
In order to get guarantees of durability the writer must use explicitly the [force()](../javadoc/org/apache/bookkeeper/client/api/ForceableHandle) API which will return only after all the bookies in the ensemble acknowledge the call after
performing an fsync to the disk which is storing the journal.
This way the LastAddConfirmed pointer is advanced on the writer side and it will be eventually available to the readers.

Expand Down
2 changes: 1 addition & 1 deletion site/docs/4.11.0/api/ledger-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ writing the entry to SO buffers without waiting for an fsync.
In this case the LastAddConfirmed pointer is not advanced to the writer side neither is updated on the reader's side, this is because **there is some chance to lose the entry**.
Such entries will be still readable using readUnconfirmed() API, but they won't be readable using Long Poll reads or regular read() API.

In order to get guarantees of durability the writer must use explicitly the [force()](../javadoc/org/apache/bookkeeper/client/api/ForceableHandle) API which will return only after all the bookies in the ensemble ackknowledge the call after
In order to get guarantees of durability the writer must use explicitly the [force()](../javadoc/org/apache/bookkeeper/client/api/ForceableHandle) API which will return only after all the bookies in the ensemble acknowledge the call after
performing an fsync to the disk which is storing the journal.
This way the LastAddConfirmed pointer is advanced on the writer side and it will be eventually available to the readers.

Expand Down
2 changes: 1 addition & 1 deletion site/docs/4.11.1/api/ledger-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ writing the entry to SO buffers without waiting for an fsync.
In this case the LastAddConfirmed pointer is not advanced to the writer side neither is updated on the reader's side, this is because **there is some chance to lose the entry**.
Such entries will be still readable using readUnconfirmed() API, but they won't be readable using Long Poll reads or regular read() API.

In order to get guarantees of durability the writer must use explicitly the [force()](../javadoc/org/apache/bookkeeper/client/api/ForceableHandle) API which will return only after all the bookies in the ensemble ackknowledge the call after
In order to get guarantees of durability the writer must use explicitly the [force()](../javadoc/org/apache/bookkeeper/client/api/ForceableHandle) API which will return only after all the bookies in the ensemble acknowledge the call after
performing an fsync to the disk which is storing the journal.
This way the LastAddConfirmed pointer is advanced on the writer side and it will be eventually available to the readers.

Expand Down
2 changes: 1 addition & 1 deletion site/docs/4.8.0/api/ledger-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ writing the entry to SO buffers without waiting for an fsync.
In this case the LastAddConfirmed pointer is not advanced to the writer side neither is updated on the reader's side, this is because **there is some chance to lose the entry**.
Such entries will be still readable using readUnconfirmed() API, but they won't be readable using Long Poll reads or regular read() API.

In order to get guarantees of durability the writer must use explicitly the [force()](../javadoc/org/apache/bookkeeper/client/api/ForceableHandle) API which will return only after all the bookies in the ensemble ackknowledge the call after
In order to get guarantees of durability the writer must use explicitly the [force()](../javadoc/org/apache/bookkeeper/client/api/ForceableHandle) API which will return only after all the bookies in the ensemble acknowledge the call after
performing an fsync to the disk which is storing the journal.
This way the LastAddConfirmed pointer is advanced on the writer side and it will be eventually available to the readers.

Expand Down
2 changes: 1 addition & 1 deletion site/docs/4.8.1/api/ledger-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ writing the entry to SO buffers without waiting for an fsync.
In this case the LastAddConfirmed pointer is not advanced to the writer side neither is updated on the reader's side, this is because **there is some chance to lose the entry**.
Such entries will be still readable using readUnconfirmed() API, but they won't be readable using Long Poll reads or regular read() API.

In order to get guarantees of durability the writer must use explicitly the [force()](../javadoc/org/apache/bookkeeper/client/api/ForceableHandle) API which will return only after all the bookies in the ensemble ackknowledge the call after
In order to get guarantees of durability the writer must use explicitly the [force()](../javadoc/org/apache/bookkeeper/client/api/ForceableHandle) API which will return only after all the bookies in the ensemble acknowledge the call after
performing an fsync to the disk which is storing the journal.
This way the LastAddConfirmed pointer is advanced on the writer side and it will be eventually available to the readers.

Expand Down
2 changes: 1 addition & 1 deletion site/docs/4.8.2/api/ledger-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ writing the entry to SO buffers without waiting for an fsync.
In this case the LastAddConfirmed pointer is not advanced to the writer side neither is updated on the reader's side, this is because **there is some chance to lose the entry**.
Such entries will be still readable using readUnconfirmed() API, but they won't be readable using Long Poll reads or regular read() API.

In order to get guarantees of durability the writer must use explicitly the [force()](../javadoc/org/apache/bookkeeper/client/api/ForceableHandle) API which will return only after all the bookies in the ensemble ackknowledge the call after
In order to get guarantees of durability the writer must use explicitly the [force()](../javadoc/org/apache/bookkeeper/client/api/ForceableHandle) API which will return only after all the bookies in the ensemble acknowledge the call after
performing an fsync to the disk which is storing the journal.
This way the LastAddConfirmed pointer is advanced on the writer side and it will be eventually available to the readers.

Expand Down
2 changes: 1 addition & 1 deletion site/docs/4.9.0/api/ledger-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ writing the entry to SO buffers without waiting for an fsync.
In this case the LastAddConfirmed pointer is not advanced to the writer side neither is updated on the reader's side, this is because **there is some chance to lose the entry**.
Such entries will be still readable using readUnconfirmed() API, but they won't be readable using Long Poll reads or regular read() API.

In order to get guarantees of durability the writer must use explicitly the [force()](../javadoc/org/apache/bookkeeper/client/api/ForceableHandle) API which will return only after all the bookies in the ensemble ackknowledge the call after
In order to get guarantees of durability the writer must use explicitly the [force()](../javadoc/org/apache/bookkeeper/client/api/ForceableHandle) API which will return only after all the bookies in the ensemble acknowledge the call after
performing an fsync to the disk which is storing the journal.
This way the LastAddConfirmed pointer is advanced on the writer side and it will be eventually available to the readers.

Expand Down
2 changes: 1 addition & 1 deletion site/docs/4.9.1/api/ledger-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ writing the entry to SO buffers without waiting for an fsync.
In this case the LastAddConfirmed pointer is not advanced to the writer side neither is updated on the reader's side, this is because **there is some chance to lose the entry**.
Such entries will be still readable using readUnconfirmed() API, but they won't be readable using Long Poll reads or regular read() API.

In order to get guarantees of durability the writer must use explicitly the [force()](../javadoc/org/apache/bookkeeper/client/api/ForceableHandle) API which will return only after all the bookies in the ensemble ackknowledge the call after
In order to get guarantees of durability the writer must use explicitly the [force()](../javadoc/org/apache/bookkeeper/client/api/ForceableHandle) API which will return only after all the bookies in the ensemble acknowledge the call after
performing an fsync to the disk which is storing the journal.
This way the LastAddConfirmed pointer is advanced on the writer side and it will be eventually available to the readers.

Expand Down
2 changes: 1 addition & 1 deletion site/docs/4.9.2/api/ledger-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ writing the entry to SO buffers without waiting for an fsync.
In this case the LastAddConfirmed pointer is not advanced to the writer side neither is updated on the reader's side, this is because **there is some chance to lose the entry**.
Such entries will be still readable using readUnconfirmed() API, but they won't be readable using Long Poll reads or regular read() API.

In order to get guarantees of durability the writer must use explicitly the [force()](../javadoc/org/apache/bookkeeper/client/api/ForceableHandle) API which will return only after all the bookies in the ensemble ackknowledge the call after
In order to get guarantees of durability the writer must use explicitly the [force()](../javadoc/org/apache/bookkeeper/client/api/ForceableHandle) API which will return only after all the bookies in the ensemble acknowledge the call after
performing an fsync to the disk which is storing the journal.
This way the LastAddConfirmed pointer is advanced on the writer side and it will be eventually available to the readers.

Expand Down
2 changes: 1 addition & 1 deletion site/docs/latest/api/ledger-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ writing the entry to SO buffers without waiting for an fsync.
In this case the LastAddConfirmed pointer is not advanced to the writer side neither is updated on the reader's side, this is because **there is some chance to lose the entry**.
Such entries will be still readable using readUnconfirmed() API, but they won't be readable using Long Poll reads or regular read() API.

In order to get guarantees of durability the writer must use explicitly the [force()](../javadoc/org/apache/bookkeeper/client/api/ForceableHandle) API which will return only after all the bookies in the ensemble ackknowledge the call after
In order to get guarantees of durability the writer must use explicitly the [force()](../javadoc/org/apache/bookkeeper/client/api/ForceableHandle) API which will return only after all the bookies in the ensemble acknowledge the call after
performing an fsync to the disk which is storing the journal.
This way the LastAddConfirmed pointer is advanced on the writer side and it will be eventually available to the readers.

Expand Down