From 0431f1252ddf1e11bf5e5b3aa5d7decc2ad51f39 Mon Sep 17 00:00:00 2001 From: Jorge Esteban Quilcate Otoya Date: Tue, 8 Oct 2019 11:05:43 +0200 Subject: [PATCH] fix: metadata getter/setters for jackson to work --- .../storage/kafka/KafkaStreamsMetadata.java | 54 +++++++++++++++++-- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/storage/src/main/java/zipkin2/storage/kafka/KafkaStreamsMetadata.java b/storage/src/main/java/zipkin2/storage/kafka/KafkaStreamsMetadata.java index a5bad486..53e6fdb3 100644 --- a/storage/src/main/java/zipkin2/storage/kafka/KafkaStreamsMetadata.java +++ b/storage/src/main/java/zipkin2/storage/kafka/KafkaStreamsMetadata.java @@ -19,7 +19,7 @@ final class KafkaStreamsMetadata { static KafkaStreamsMetadata create( - Collection other) { + Collection other) { KafkaStreamsMetadata metadata = new KafkaStreamsMetadata(); metadata.metadata = other.stream().map(StreamsMetadata::create).collect(Collectors.toSet()); return metadata; @@ -27,7 +27,15 @@ static KafkaStreamsMetadata create( Set metadata; - Set getMetadata() { + KafkaStreamsMetadata() { + } + + public void setMetadata( + Set metadata) { + this.metadata = metadata; + } + + public Set getMetadata() { return metadata; } @@ -37,8 +45,8 @@ static StreamsMetadata create(org.apache.kafka.streams.state.StreamsMetadata oth metadata.hostInfo = HostInfo.create(other.hostInfo()); metadata.storeNames = other.stateStoreNames(); metadata.topicPartitions = other.topicPartitions().stream() - .map(TopicPartition::create) - .collect(Collectors.toSet()); + .map(TopicPartition::create) + .collect(Collectors.toSet()); return metadata; } @@ -46,6 +54,22 @@ static StreamsMetadata create(org.apache.kafka.streams.state.StreamsMetadata oth Set storeNames; Set topicPartitions; + StreamsMetadata() { + } + + public void setHostInfo(HostInfo hostInfo) { + this.hostInfo = hostInfo; + } + + public void setStoreNames(Set storeNames) { + this.storeNames = storeNames; + } + + public void setTopicPartitions( + Set topicPartitions) { + this.topicPartitions = topicPartitions; + } + public HostInfo getHostInfo() { return hostInfo; } @@ -69,6 +93,17 @@ static HostInfo create(org.apache.kafka.streams.state.HostInfo other) { String host; Integer port; + HostInfo() { + } + + public void setHost(String host) { + this.host = host; + } + + public void setPort(Integer port) { + this.port = port; + } + public String getHost() { return host; } @@ -86,9 +121,20 @@ static TopicPartition create(org.apache.kafka.common.TopicPartition other) { return topicPartition; } + TopicPartition() { + } + String topic; Integer partition; + public void setTopic(String topic) { + this.topic = topic; + } + + public void setPartition(Integer partition) { + this.partition = partition; + } + public String getTopic() { return topic; }