Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions topic/src/main/java/tech/ydb/topic/description/Consumer.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;

import javax.annotation.Nonnull;
Expand Down Expand Up @@ -140,4 +141,26 @@ public Consumer build() {
return new Consumer(this);
}
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Consumer consumer = (Consumer) o;
return important == consumer.important &&
Objects.equals(name, consumer.name) &&
Objects.equals(readFrom, consumer.readFrom) &&
Objects.equals(supportedCodecs, consumer.supportedCodecs) &&
Objects.equals(attributes, consumer.attributes) &&
Objects.equals(stats, consumer.stats);
}

@Override
public int hashCode() {
return Objects.hash(name, important, readFrom, supportedCodecs, attributes, stats);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@


import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

import tech.ydb.proto.topic.YdbTopic;
Expand All @@ -28,4 +29,21 @@ public Consumer getConsumer() {
public List<ConsumerPartitionInfo> getPartitions() {
return partitions;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ConsumerDescription that = (ConsumerDescription) o;
return Objects.equals(consumer, that.consumer) && Objects.equals(partitions, that.partitions);
}

@Override
public int hashCode() {
return Objects.hash(consumer, partitions);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.time.Duration;
import java.time.Instant;
import java.util.List;
import java.util.Objects;

import tech.ydb.core.utils.ProtobufUtils;
import tech.ydb.proto.topic.YdbTopic;
Expand Down Expand Up @@ -178,4 +179,35 @@ public int getConnectionNodeId() {
return connectionNodeId;
}
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ConsumerPartitionInfo that = (ConsumerPartitionInfo) o;
return partitionId == that.partitionId &&
active == that.active &&
Objects.equals(childPartitionIds, that.childPartitionIds) &&
Objects.equals(parentPartitionIds, that.parentPartitionIds) &&
Objects.equals(partitionStats, that.partitionStats) &&
Objects.equals(consumerStats, that.consumerStats) &&
Objects.equals(location, that.location);
}

@Override
public int hashCode() {
return Objects.hash(
partitionId,
active,
childPartitionIds,
parentPartitionIds,
partitionStats,
consumerStats,
location
);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package tech.ydb.topic.description;

import java.util.Objects;

import tech.ydb.proto.topic.YdbTopic;

/**
Expand Down Expand Up @@ -33,4 +35,21 @@ public long getPerHour() {
public long getPerDay() {
return perDay;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
MultipleWindowsStat that = (MultipleWindowsStat) o;
return perMinute == that.perMinute && perHour == that.perHour && perDay == that.perDay;
}

@Override
public int hashCode() {
return Objects.hash(perMinute, perHour, perDay);
}
}
22 changes: 22 additions & 0 deletions topic/src/main/java/tech/ydb/topic/description/PartitionInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

import com.google.common.collect.ImmutableList;

Expand Down Expand Up @@ -86,4 +87,25 @@ public PartitionInfo build() {
return new PartitionInfo(this);
}
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PartitionInfo that = (PartitionInfo) o;
return partitionId == that.partitionId &&
active == that.active &&
Objects.equals(childPartitionIds, that.childPartitionIds) &&
Objects.equals(parentPartitionIds, that.parentPartitionIds) &&
Objects.equals(partitionStats, that.partitionStats);
}

@Override
public int hashCode() {
return Objects.hash(partitionId, active, childPartitionIds, parentPartitionIds, partitionStats);
}
}
30 changes: 30 additions & 0 deletions topic/src/main/java/tech/ydb/topic/description/PartitionStats.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.time.Duration;
import java.time.Instant;
import java.util.Objects;

import javax.annotation.Nullable;

Expand Down Expand Up @@ -126,4 +127,33 @@ public PartitionStats build() {
return new PartitionStats(this);
}
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PartitionStats that = (PartitionStats) o;
return storeSizeBytes == that.storeSizeBytes &&
partitionNodeId == that.partitionNodeId &&
Objects.equals(partitionOffsets, that.partitionOffsets) &&
Objects.equals(lastWriteTime, that.lastWriteTime) &&
Objects.equals(maxWriteTimeLag, that.maxWriteTimeLag) &&
Objects.equals(bytesWritten, that.bytesWritten);
}

@Override
public int hashCode() {
return Objects.hash(
partitionOffsets,
storeSizeBytes,
lastWriteTime,
maxWriteTimeLag,
bytesWritten,
partitionNodeId
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

import com.google.common.collect.ImmutableList;

Expand Down Expand Up @@ -47,4 +48,21 @@ public SupportedCodecs build() {
return new SupportedCodecs(this);
}
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SupportedCodecs that = (SupportedCodecs) o;
return Objects.equals(codecs, that.codecs);
}

@Override
public int hashCode() {
return Objects.hashCode(codecs);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
Expand Down Expand Up @@ -179,4 +180,43 @@ public TopicDescription build() {
return new TopicDescription(this);
}
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TopicDescription that = (TopicDescription) o;
return retentionStorageMb == that.retentionStorageMb &&
partitionWriteSpeedBytesPerSecond == that.partitionWriteSpeedBytesPerSecond &&
partitionWriteBurstBytes == that.partitionWriteBurstBytes &&
Objects.equals(partitioningSettings, that.partitioningSettings) &&
Objects.equals(partitions, that.partitions) &&
Objects.equals(retentionPeriod, that.retentionPeriod) &&
Objects.equals(supportedCodecs, that.supportedCodecs) &&
Objects.equals(attributes, that.attributes) &&
Objects.equals(consumers, that.consumers) &&
meteringMode == that.meteringMode &&
Objects.equals(topicStats, that.topicStats);
}

@Override
public int hashCode() {
return Objects.hash(
partitioningSettings,
partitions,
retentionPeriod,
retentionStorageMb,
supportedCodecs,
partitionWriteSpeedBytesPerSecond,
partitionWriteBurstBytes,
attributes,
consumers,
meteringMode,
topicStats
);
}
}
21 changes: 21 additions & 0 deletions topic/src/main/java/tech/ydb/topic/description/TopicStats.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.time.Duration;
import java.time.Instant;
import java.util.Objects;

import javax.annotation.Nullable;

Expand Down Expand Up @@ -76,4 +77,24 @@ public TopicStats build() {
return new TopicStats(this);
}
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TopicStats that = (TopicStats) o;
return storeSizeBytes == that.storeSizeBytes &&
Objects.equals(minLastWriteTime, that.minLastWriteTime) &&
Objects.equals(maxWriteTimeLag, that.maxWriteTimeLag) &&
Objects.equals(bytesWritten, that.bytesWritten);
}

@Override
public int hashCode() {
return Objects.hash(storeSizeBytes, minLastWriteTime, maxWriteTimeLag, bytesWritten);
}
}
19 changes: 19 additions & 0 deletions topic/src/main/java/tech/ydb/topic/read/impl/OffsetsRangeImpl.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package tech.ydb.topic.read.impl;

import java.util.Objects;

import tech.ydb.topic.description.OffsetsRange;

/**
Expand Down Expand Up @@ -36,4 +38,21 @@ public void setStart(long start) {
public void setEnd(long end) {
this.end = end;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
OffsetsRangeImpl that = (OffsetsRangeImpl) o;
return start == that.start && end == that.end;
}

@Override
public int hashCode() {
return Objects.hash(start, end);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package tech.ydb.topic.settings;

import java.time.Duration;
import java.util.Objects;

public class AutoPartitioningWriteStrategySettings {
private final Duration stabilizationWindow;
Expand Down Expand Up @@ -69,4 +70,23 @@ public AutoPartitioningWriteStrategySettings build() {
return new AutoPartitioningWriteStrategySettings(this);
}
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AutoPartitioningWriteStrategySettings that = (AutoPartitioningWriteStrategySettings) o;
return upUtilizationPercent == that.upUtilizationPercent &&
downUtilizationPercent == that.downUtilizationPercent &&
Objects.equals(stabilizationWindow, that.stabilizationWindow);
}

@Override
public int hashCode() {
return Objects.hash(stabilizationWindow, upUtilizationPercent, downUtilizationPercent);
}
}
Loading