use of com.sequenceiq.cloudbreak.reactor.api.event.resource.ExtendHostMetadataRequest in project cloudbreak by hortonworks.
the class StackUpscaleActions method extendHostMetadata.
@Bean(name = "EXTEND_HOST_METADATA_STATE")
public Action<?, ?> extendHostMetadata() {
return new AbstractStackUpscaleAction<BootstrapNewNodesResult>(BootstrapNewNodesResult.class) {
@Override
protected void doExecute(StackScalingFlowContext context, BootstrapNewNodesResult payload, Map<Object, Object> variables) {
stackUpscaleService.extendingHostMetadata(context.getStack());
Selectable request = new ExtendHostMetadataRequest(context.getStack().getId(), payload.getRequest().getUpscaleCandidateAddresses());
sendEvent(context.getFlowId(), request);
}
};
}
use of com.sequenceiq.cloudbreak.reactor.api.event.resource.ExtendHostMetadataRequest in project cloudbreak by hortonworks.
the class ExtendHostMetadataHandler method accept.
@Override
public void accept(Event<ExtendHostMetadataRequest> event) {
ExtendHostMetadataRequest request = event.getData();
ExtendHostMetadataResult result;
try {
hostMetadataSetup.setupNewHostMetadata(request.getStackId(), request.getUpscaleCandidateAddresses());
result = new ExtendHostMetadataResult(request);
} catch (Exception e) {
result = new ExtendHostMetadataResult(e.getMessage(), e, request);
}
eventBus.notify(result.selector(), new Event<>(event.getHeaders(), result));
}
Aggregations