/**
* @deprecated This method is only used from configuration modules and thus callers of it
* should use service injection to make the executor configurable.
*/
@Deprecated
public static synchronized ListeningExecutorService getDefaultCommitExecutor() {
if (COMMIT_EXECUTOR == null) {
final ThreadFactory factory = new ThreadFactoryBuilder().setDaemon(true).setNameFormat("md-sal-binding-commit-%d").build();
/*
* FIXME: this used to be newCacheThreadPool(), but MD-SAL does not have transaction
* ordering guarantees, which means that using a concurrent threadpool results
* in application data being committed in random order, potentially resulting
* in inconsistent data being present. Once proper primitives are introduced,
* concurrency can be reintroduced.
*/
final ExecutorService executor = Executors.newSingleThreadExecutor(factory);
COMMIT_EXECUTOR = MoreExecutors.listeningDecorator(executor);
}
return COMMIT_EXECUTOR;
}
SingletonHolder.java 文件源码
java
阅读 41
收藏 0
点赞 0
评论 0
项目:hashsdn-controller
作者:
评论列表
文章目录