{
@Id
public String id;
- public String topic;
- public Integer partition;
+ public long offset = -1l;
public Map<String, Long> statistics;
public StatisticsDocument()
{
}
- public StatisticsDocument(String topic, Integer partition, Map<String, Long> statistics)
+ public StatisticsDocument(Integer partition)
{
- this.partition = partition;
- this.statistics = statistics;
+ this.id = Integer.toString(partition);
+ this.statistics = new HashMap<>();
}
- public StatisticsDocument(PartitionStatistics statistics)
+ public StatisticsDocument(Integer partition, Map<String, Long> statistics, long offset)
{
- this.topic = statistics.getPartition().topic();
- this.id = statistics.toString();
- this.partition = statistics.getPartition().partition();
- this.statistics = new HashMap<>();
- statistics.getStatistics().forEach(counter -> this.statistics.put(counter.getKey(), counter.getResult()));
+ this.id = Integer.toString(partition);
+ this.statistics = statistics;
+ this.offset = offset;
}
}