Merge 7daae980c0 into 6fc148740d
This commit is contained in:
commit
a73bcffc9d
1 changed files with 10 additions and 2 deletions
|
|
@ -103,6 +103,8 @@ public class Worker implements Runnable {
|
||||||
private volatile long shutdownStartTimeMillis;
|
private volatile long shutdownStartTimeMillis;
|
||||||
private volatile boolean shutdownComplete = false;
|
private volatile boolean shutdownComplete = false;
|
||||||
|
|
||||||
|
private volatile boolean initialized = false;
|
||||||
|
|
||||||
// Holds consumers for shards the worker is currently tracking. Key is shard
|
// Holds consumers for shards the worker is currently tracking. Key is shard
|
||||||
// info, value is ShardConsumer.
|
// info, value is ShardConsumer.
|
||||||
private ConcurrentMap<ShardInfo, ShardConsumer> shardInfoShardConsumerMap = new ConcurrentHashMap<ShardInfo, ShardConsumer>();
|
private ConcurrentMap<ShardInfo, ShardConsumer> shardInfoShardConsumerMap = new ConcurrentHashMap<ShardInfo, ShardConsumer>();
|
||||||
|
|
@ -543,6 +545,7 @@ public class Worker implements Runnable {
|
||||||
if (!isDone) {
|
if (!isDone) {
|
||||||
throw new RuntimeException(lastException);
|
throw new RuntimeException(lastException);
|
||||||
}
|
}
|
||||||
|
initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -751,6 +754,10 @@ public class Worker implements Runnable {
|
||||||
return shutdownComplete;
|
return shutdownComplete;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isInitialized() {
|
||||||
|
return initialized;
|
||||||
|
}
|
||||||
|
|
||||||
ConcurrentMap<ShardInfo, ShardConsumer> getShardInfoShardConsumerMap() {
|
ConcurrentMap<ShardInfo, ShardConsumer> getShardInfoShardConsumerMap() {
|
||||||
return shardInfoShardConsumerMap;
|
return shardInfoShardConsumerMap;
|
||||||
}
|
}
|
||||||
|
|
@ -801,6 +808,7 @@ public class Worker implements Runnable {
|
||||||
if (metricsFactory instanceof WorkerCWMetricsFactory) {
|
if (metricsFactory instanceof WorkerCWMetricsFactory) {
|
||||||
((CWMetricsFactory) metricsFactory).shutdown();
|
((CWMetricsFactory) metricsFactory).shutdown();
|
||||||
}
|
}
|
||||||
|
initialized = false;
|
||||||
shutdownComplete = true;
|
shutdownComplete = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue