HBASE-8525 Use sleep multilier when choosing sinks in ReplicationSource
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1485316 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8bd59042ba
commit
ba653fb8e4
|
@ -170,9 +170,9 @@ public class ReplicationSource extends Thread
|
||||||
for (int i = 0; i < this.replicationQueueNbCapacity; i++) {
|
for (int i = 0; i < this.replicationQueueNbCapacity; i++) {
|
||||||
this.entriesArray[i] = new HLog.Entry();
|
this.entriesArray[i] = new HLog.Entry();
|
||||||
}
|
}
|
||||||
this.maxRetriesMultiplier =
|
this.maxRetriesMultiplier = this.conf.getInt("replication.source.maxretriesmultiplier", 10);
|
||||||
this.conf.getInt("replication.source.maxretriesmultiplier", 10);
|
this.socketTimeoutMultiplier = this.conf.getInt("replication.source.socketTimeoutMultiplier",
|
||||||
this.socketTimeoutMultiplier = maxRetriesMultiplier * maxRetriesMultiplier;
|
maxRetriesMultiplier * maxRetriesMultiplier);
|
||||||
this.queue =
|
this.queue =
|
||||||
new PriorityBlockingQueue<Path>(
|
new PriorityBlockingQueue<Path>(
|
||||||
conf.getInt("hbase.regionserver.maxlogs", 32),
|
conf.getInt("hbase.regionserver.maxlogs", 32),
|
||||||
|
@ -452,14 +452,16 @@ public class ReplicationSource extends Thread
|
||||||
}
|
}
|
||||||
|
|
||||||
private void connectToPeers() {
|
private void connectToPeers() {
|
||||||
|
int sleepMultiplier = 1;
|
||||||
|
|
||||||
// Connect to peer cluster first, unless we have to stop
|
// Connect to peer cluster first, unless we have to stop
|
||||||
while (this.isActive() && this.currentPeers.size() == 0) {
|
while (this.isActive() && this.currentPeers.size() == 0) {
|
||||||
|
|
||||||
try {
|
chooseSinks();
|
||||||
chooseSinks();
|
if (this.isActive() && this.currentPeers.size() == 0) {
|
||||||
Thread.sleep(this.sleepForRetries);
|
if (sleepForRetries("Waiting for peers", sleepMultiplier)) {
|
||||||
} catch (InterruptedException e) {
|
sleepMultiplier++;
|
||||||
LOG.error("Interrupted while trying to connect to sinks", e);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue