use of com.creditease.uav.feature.apphubmanager.datastore.adaptors.GroupDataAdpater in project uavstack by uavorg.
the class AppHubManager method start.
@Override
public void start() {
// start AppHubMangerServerWorker
int port = Integer.parseInt(this.getConfigManager().getFeatureConfiguration(this.feature, "http.port"));
int backlog = Integer.parseInt(this.getConfigManager().getFeatureConfiguration(this.feature, "http.backlog"));
int core = Integer.parseInt(this.getConfigManager().getFeatureConfiguration(this.feature, "http.core"));
int max = Integer.parseInt(this.getConfigManager().getFeatureConfiguration(this.feature, "http.max"));
int bqsize = Integer.parseInt(this.getConfigManager().getFeatureConfiguration(this.feature, "http.bqsize"));
apphubManagerServerListenWorker = new AppHubManagerServerWorker("ApphubMangerServerWorker", this.feature, "appHubManagerHandlers");
@SuppressWarnings({ "rawtypes", "unchecked" }) ThreadPoolExecutor exe = new ThreadPoolExecutor(core, max, 30000, TimeUnit.MILLISECONDS, new ArrayBlockingQueue(bqsize));
// 调用线程执行多余任务
exe.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
apphubManagerServerListenWorker.start(exe, port, backlog);
if (log.isTraceEnable()) {
log.info(this, "AppHubManager DataStore HttpServer started");
}
buildDBService("AppHub.app", new AppDataAdpater());
buildDBService("AppHub.group", new GroupDataAdpater());
buildDBService("AppHub.feedback", new FeedbackDataAdpater());
// start datastore
DataStoreFactory.getInstance().startAll(this.feature);
}
Aggregations