use of com.bakdata.conquery.models.worker.Workers in project conquery by bakdata.
the class ShardNode method run.
@Override
protected void run(Environment environment, Namespace namespace, ConqueryConfig config) throws Exception {
this.environment = environment;
connector = new NioSocketConnector();
jobManager = new JobManager(getName(), config.isFailOnError());
synchronized (environment) {
environment.lifecycle().manage(this);
validator = environment.getValidator();
scheduler = environment.lifecycle().scheduledExecutorService("Scheduled Messages").build();
}
this.config = config;
config.initialize(this);
scheduler.scheduleAtFixedRate(this::reportJobManagerStatus, 30, 1, TimeUnit.SECONDS);
final ObjectMapper binaryMapper = config.configureObjectMapper(Jackson.copyMapperAndInjectables(Jackson.BINARY_MAPPER));
((MutableInjectableValues) binaryMapper.getInjectableValues()).add(Validator.class, environment.getValidator());
workers = new Workers(getConfig().getQueries().getExecutionPool(), binaryMapper, getConfig().getCluster().getEntityBucketSize());
final Collection<WorkerStorage> workerStorages = config.getStorage().loadWorkerStorages();
for (WorkerStorage workerStorage : workerStorages) {
workers.createWorker(workerStorage, config.isFailOnError());
}
log.info("All Worker Storages loaded: {}", workers.getWorkers().size());
}
Aggregations