use of org.agrona.DirectBuffer in project zeebe by zeebe-io.
the class ClusterMemberListManager method onOpenLogStreamService.
@Override
public void onOpenLogStreamService(LogStream logStream) {
final int partitionId = logStream.getPartitionId();
final DirectBuffer savedTopicName = BufferUtil.cloneBuffer(logStream.getTopicName());
actor.call(() -> updateTopologyOnRaftStateChangeForPartition(LEADER, partitionId, savedTopicName));
}
use of org.agrona.DirectBuffer in project zeebe by zeebe-io.
the class ClusterMemberListManager method publishNodeAPIAddresses.
public void publishNodeAPIAddresses() {
final Gossip gossip = context.getGossip();
final String defaultHost = transportComponentCfg.host;
final DirectBuffer payload = writeAPIAddressesIntoBuffer(transportComponentCfg.managementApi.toSocketAddress(defaultHost), transportComponentCfg.replicationApi.toSocketAddress(defaultHost), transportComponentCfg.clientApi.toSocketAddress(defaultHost), apiAddressBuffer);
gossip.publishEvent(API_EVENT_TYPE, payload);
}
use of org.agrona.DirectBuffer in project zeebe by zeebe-io.
the class RemoveTopicSubscriptionHandler method handle.
@Override
public void handle(final ActorControl actor, final int partitionId, final DirectBuffer buffer, final BrokerEventMetadata metadata) {
final int requestStreamId = metadata.getRequestStreamId();
final long requestId = metadata.getRequestId();
final CloseSubscriptionRequest request = new CloseSubscriptionRequest();
request.wrap(cloneBuffer(buffer));
final ActorFuture<Void> future = subscriptionService.closeSubscriptionAsync(partitionId, request.getSubscriberKey());
actor.runOnCompletion(future, ((aVoid, throwable) -> {
if (throwable == null) {
sendResponse(actor, requestStreamId, requestId, request);
} else {
sendErrorResponse(actor, requestStreamId, requestId, "Cannot close topic subscription. %s", throwable.getMessage());
}
}));
}
use of org.agrona.DirectBuffer in project zeebe by zeebe-io.
the class ControlMessageRequest method await.
public ControlMessageResponse await() {
try (ClientResponse response = responseFuture.join()) {
final DirectBuffer responseBuffer = response.getResponseBuffer();
final ControlMessageResponse result = new ControlMessageResponse(msgPackHelper);
result.wrap(responseBuffer, 0, responseBuffer.capacity());
return result;
}
}
use of org.agrona.DirectBuffer in project zeebe by zeebe-io.
the class ExecuteCommandRequest method await.
public ExecuteCommandResponse await() {
try (ClientResponse response = responseFuture.join()) {
final DirectBuffer responseBuffer = response.getResponseBuffer();
final ExecuteCommandResponse result = new ExecuteCommandResponse(msgPackHelper);
result.wrap(responseBuffer, 0, responseBuffer.capacity());
return result;
}
}
Aggregations