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 @@ -140,6 +140,7 @@ public class ClientConfiguration extends AbstractConfiguration<ClientConfigurati
protected static final String BOOKIE_ERROR_THRESHOLD_PER_INTERVAL = "bookieErrorThresholdPerInterval";
protected static final String BOOKIE_QUARANTINE_TIME_SECONDS = "bookieQuarantineTimeSeconds";
protected static final String BOOKIE_QUARANTINE_RATIO = "bookieQuarantineRatio";
protected static final String BOOKIE_CONNECTION_ERROR_QUARANTINE_ENABLED = "bookieConnectionErrorQuarantineEnabled";

// Bookie info poll interval
protected static final String DISK_WEIGHT_BASED_PLACEMENT_ENABLED = "diskWeightBasedPlacementEnabled";
Expand Down Expand Up @@ -1456,6 +1457,28 @@ public ClientConfiguration setBookieErrorThresholdPerInterval(long thresholdPerI
return this;
}


/**
* Set if count the bookie connecting error into the quarantine condition. If this is enabled, the connection
* error will be counted into the BookieErrorThresholdPerInterval. So be careful to set the quarantine time.
*
* @param enabled
* @return
*/
public ClientConfiguration setBookieConnectionErrorQuarantineEnabled(boolean enabled) {
setProperty(BOOKIE_CONNECTION_ERROR_QUARANTINE_ENABLED, enabled);
return this;
}

/**
* Get if count the bookie connecting error into the quarantine condition.
*
* @return
*/
public boolean getBookieConnectionErrorQuarantineEnabled() {
return getBoolean(BOOKIE_CONNECTION_ERROR_QUARANTINE_ENABLED, false);
}

/**
* Get the time for which a bookie will be quarantined.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1818,6 +1818,9 @@ public void operationComplete(ChannelFuture future) {
if (state != ConnectionState.CLOSED) {
state = ConnectionState.DISCONNECTED;
}
if (conf.getBookieConnectionErrorQuarantineEnabled()) {
recordError();
}
failedConnectionCounter.inc();
}

Expand Down
Loading