mirror of https://github.com/apache/activemq.git
Don't display leveldb replication recovery progress on slave nodes.
This commit is contained in:
parent
c643e7f631
commit
e90ce1aabb
|
@ -674,7 +674,7 @@ class LevelDBClient(store: LevelDBStore) {
|
|||
}
|
||||
}
|
||||
|
||||
def replay_from(from:Long, limit:Long) = {
|
||||
def replay_from(from:Long, limit:Long, print_progress:Boolean=true) = {
|
||||
might_fail {
|
||||
try {
|
||||
// Update the index /w what was stored on the logs..
|
||||
|
@ -684,6 +684,8 @@ class LevelDBClient(store: LevelDBStore) {
|
|||
var last_reported_pos = 0L
|
||||
try {
|
||||
while (pos < limit) {
|
||||
|
||||
if( print_progress ) {
|
||||
val now = System.currentTimeMillis();
|
||||
if( now > last_reported_at+1000 ) {
|
||||
val at = pos-from
|
||||
|
@ -704,6 +706,7 @@ class LevelDBClient(store: LevelDBStore) {
|
|||
last_reported_at = now
|
||||
last_reported_pos = pos
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
log.read(pos).map {
|
||||
|
@ -774,7 +777,7 @@ class LevelDBClient(store: LevelDBStore) {
|
|||
case e:Throwable => e.printStackTrace()
|
||||
}
|
||||
if(showing_progress) {
|
||||
System.out.print(" \r");
|
||||
System.out.println("Replaying recovery log: 100% done ");
|
||||
}
|
||||
|
||||
} catch {
|
||||
|
|
|
@ -146,7 +146,7 @@ class SlaveLevelDBStore extends LevelDBStore with ReplicatedLevelDBStoreTrait {
|
|||
val old_replay_from = replay_from
|
||||
replay_from = ack.position
|
||||
client.writeExecutor {
|
||||
client.replay_from(old_replay_from, ack.position)
|
||||
client.replay_from(old_replay_from, ack.position, false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue