use of org.apache.kafka.common.message.FindCoordinatorResponseData in project kafka by apache.
the class CoordinatorStrategyTest method assertFatalOldLookup.
public Throwable assertFatalOldLookup(CoordinatorKey key, Errors error) {
FindCoordinatorResponseData responseData = new FindCoordinatorResponseData().setErrorCode(error.code());
AdminApiLookupStrategy.LookupResult<CoordinatorKey> result = runOldLookup(key, responseData);
assertEquals(emptyMap(), result.mappedKeys);
assertEquals(singleton(key), result.failedKeys.keySet());
Throwable throwable = result.failedKeys.get(key);
assertTrue(error.exception().getClass().isInstance(throwable));
return throwable;
}
use of org.apache.kafka.common.message.FindCoordinatorResponseData in project kafka by apache.
the class FindCoordinatorResponse method prepareResponse.
public static FindCoordinatorResponse prepareResponse(Errors error, String key, Node node) {
FindCoordinatorResponseData data = new FindCoordinatorResponseData();
data.setCoordinators(Collections.singletonList(new FindCoordinatorResponseData.Coordinator().setErrorCode(error.code()).setErrorMessage(error.message()).setKey(key).setHost(node.host()).setPort(node.port()).setNodeId(node.id())));
return new FindCoordinatorResponse(data);
}
Aggregations