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
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,6 @@ protected Serde<ValueAndTimestamp<V>> prepareValueSerdeForStore(final Serde<Valu
}
}

RawAndDeserializedValue<V> getWithBinary(final K key) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused... (only in a test -- removing test, too)

try {
return maybeMeasureLatency(
() -> {
final byte[] rawValue = wrapped().get(serializeKey(key));
return new RawAndDeserializedValue<>(rawValue, deserializeValue(rawValue));
},
time,
getSensor
);
} catch (final ProcessorStateException e) {
final String message = String.format(e.getMessage(), key);
throw new ProcessorStateException(message, e);
}
}

public boolean putIfDifferentValues(
final K key,
final ValueAndTimestamp<V> newValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import org.apache.kafka.streams.state.KeyValueIterator;
import org.apache.kafka.streams.state.KeyValueStore;
import org.apache.kafka.streams.state.ValueAndTimestamp;
import org.apache.kafka.streams.state.internals.MeteredTimestampedKeyValueStore.RawAndDeserializedValue;
import org.apache.kafka.test.KeyValueIteratorStub;

import org.junit.jupiter.api.Test;
Expand All @@ -61,8 +60,6 @@
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
Expand Down Expand Up @@ -233,18 +230,6 @@ public void shouldWriteBytesToInnerStoreAndRecordPutMetric() {
assertTrue((Double) metric.metricValue() > 0);
}

@Test
public void shouldGetWithBinary() {
setUp();
when(inner.get(KEY_BYTES)).thenReturn(VALUE_AND_TIMESTAMP_BYTES);

init();

final RawAndDeserializedValue<String> valueWithBinary = metered.getWithBinary(KEY);
assertEquals(VALUE_AND_TIMESTAMP, valueWithBinary.value);
assertArrayEquals(VALUE_AND_TIMESTAMP_BYTES, valueWithBinary.rawValue);
}

@Test
public void shouldNotPutIfSameValuesAndGreaterTimestamp() {
setUp();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,14 +397,6 @@ public void setTime(final long timestamp) {
this.timestamp = timestamp;
}

@Override
public long timestamp() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There override are exactly the same code as the super-class implementation. Thus, removing.

if (recordContext == null) {
return timestamp;
}
return recordContext.timestamp();
}

@Override
public long currentSystemTimeMs() {
return time.milliseconds();
Expand All @@ -415,38 +407,6 @@ public long currentStreamTimeMs() {
throw new UnsupportedOperationException("this method is not supported in InternalMockProcessorContext");
}

@Override
public String topic() {
if (recordContext == null) {
return null;
}
return recordContext.topic();
}

@Override
public int partition() {
if (recordContext == null) {
return -1;
}
return recordContext.partition();
}

@Override
public long offset() {
if (recordContext == null) {
return -1L;
}
return recordContext.offset();
}

@Override
public Headers headers() {
if (recordContext == null) {
return new RecordHeaders();
}
return recordContext.headers();
}

@Override
public TaskType taskType() {
return taskType;
Expand Down
Loading