Update KafkaStreamsInteractiveQuerySample.java

Avro generates primitive long in the later versions
This commit is contained in:
Jay Ehsaniara
2021-06-19 18:01:39 -07:00
committed by Soby Chacko
parent ee0ee47dc7
commit 2447b7c167

View File

@@ -322,11 +322,11 @@ public class KafkaStreamsInteractiveQuerySample {
static class TopFiveSongs implements Iterable<SongPlayCount> {
private final Map<Long, SongPlayCount> currentSongs = new HashMap<>();
private final TreeSet<SongPlayCount> topFive = new TreeSet<>((o1, o2) -> {
final int result = o2.getPlays().compareTo(o1.getPlays());
final int result = Long.compare(o2.getPlays(), o1.getPlays());
if (result != 0) {
return result;
}
return o1.getSongId().compareTo(o2.getSongId());
return Long.compare(o1.getSongId(), o2.getSongId());
});
public void add(final SongPlayCount songPlayCount) {