|
@@ -22,15 +22,18 @@ public class MergeUtils {
|
|
|
public static final Logger LOGGER = LoggerFactory.getLogger(MergeUtils.class);
|
|
|
|
|
|
// mergeConfFile_topQueueName 对应的 StrategyQueue 缓存
|
|
|
- private static final Map<String, StrategyQueue> topQueueMap = new HashMap<>();
|
|
|
+ private static final Map<String, Config> queueConfigMap = new HashMap<>();
|
|
|
|
|
|
public static StrategyQueue createTopQueue(String mergeConfFile, String topQueueName) {
|
|
|
String key = mergeConfFile + "_" + topQueueName;
|
|
|
- if (topQueueMap.containsKey(key)) {
|
|
|
- return topQueueMap.get(key);
|
|
|
+ Config mergeQueueConf;
|
|
|
+ if (queueConfigMap.containsKey(key)) {
|
|
|
+ mergeQueueConf = queueConfigMap.get(key);
|
|
|
+ } else {
|
|
|
+ mergeQueueConf = ConfigFactory.parseResources(mergeConfFile);
|
|
|
+ queueConfigMap.put(key, mergeQueueConf);
|
|
|
}
|
|
|
StrategyQueueConfig strategyQueueConfig = new StrategyQueueConfig();
|
|
|
- Config mergeQueueConf = ConfigFactory.parseResources(mergeConfFile);
|
|
|
if (strategyQueueConfig.load(mergeQueueConf)) {
|
|
|
LOGGER.debug("Merger config init succ");
|
|
|
} else {
|
|
@@ -51,7 +54,6 @@ public class MergeUtils {
|
|
|
} catch (InvocationTargetException e) {
|
|
|
LOGGER.error("construct top StrategyQueue: [{}]", e);
|
|
|
}
|
|
|
- topQueueMap.put(key, topQueue);
|
|
|
return topQueue;
|
|
|
}
|
|
|
|