use of com.bakdata.quick.common.api.model.mirror.MirrorHost in project quick by bakdata.
the class KafkaQueryService method fetch.
private V fetch(final HostInfo replicaHostInfo, final K key) {
final String host = String.format("%s:%s", replicaHostInfo.host(), replicaHostInfo.port());
final MirrorHost mirrorHost = new MirrorHost(host, MirrorConfig.directAccess());
final DefaultMirrorClient<K, V> client = new DefaultMirrorClient<>(mirrorHost, this.client, this.valueResolver.getElementType());
final V value = client.fetchValue(key);
if (value == null) {
throw new NotFoundException("Key not found");
}
return value;
}
Aggregations