Search in sources :

Example 1 with FeedbackDataAdpater

use of com.creditease.uav.feature.apphubmanager.datastore.adaptors.FeedbackDataAdpater 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);
}
Also used : AppHubManagerServerWorker(com.creditease.uav.feature.apphubmanager.AppHubManagerServerWorker) ArrayBlockingQueue(java.util.concurrent.ArrayBlockingQueue) AppDataAdpater(com.creditease.uav.feature.apphubmanager.datastore.adaptors.AppDataAdpater) ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor) GroupDataAdpater(com.creditease.uav.feature.apphubmanager.datastore.adaptors.GroupDataAdpater) FeedbackDataAdpater(com.creditease.uav.feature.apphubmanager.datastore.adaptors.FeedbackDataAdpater)

Aggregations

AppHubManagerServerWorker (com.creditease.uav.feature.apphubmanager.AppHubManagerServerWorker)1 AppDataAdpater (com.creditease.uav.feature.apphubmanager.datastore.adaptors.AppDataAdpater)1 FeedbackDataAdpater (com.creditease.uav.feature.apphubmanager.datastore.adaptors.FeedbackDataAdpater)1 GroupDataAdpater (com.creditease.uav.feature.apphubmanager.datastore.adaptors.GroupDataAdpater)1 ArrayBlockingQueue (java.util.concurrent.ArrayBlockingQueue)1 ThreadPoolExecutor (java.util.concurrent.ThreadPoolExecutor)1