Search in sources :

Example 1 with RequestConsistency

use of com.bakdata.conquery.models.messages.namespaces.specific.RequestConsistency in project conquery by bakdata.

the class RegisterWorker method react.

@Override
public void react(ManagerNodeNetworkContext context) throws Exception {
    ShardNodeInformation node = getShardNode(context);
    Wait.builder().stepTime(Duration.ofMillis(5)).total(Duration.ofSeconds(10)).build().until(() -> getShardNode(context) != null);
    if (node == null) {
        throw new IllegalStateException("Could not find the slave " + context.getRemoteAddress() + " to register worker " + info.getId());
    }
    info.setConnectedShardNode(node);
    context.getNamespaces().register(node, info);
    // Request consistency report
    context.getNamespaces().getWorkers().get(info.getId()).send(new RequestConsistency());
}
Also used : ShardNodeInformation(com.bakdata.conquery.models.worker.ShardNodeInformation) RequestConsistency(com.bakdata.conquery.models.messages.namespaces.specific.RequestConsistency)

Aggregations

RequestConsistency (com.bakdata.conquery.models.messages.namespaces.specific.RequestConsistency)1 ShardNodeInformation (com.bakdata.conquery.models.worker.ShardNodeInformation)1