diff --git a/direct/io-cassandra/src/main/java/cz/o2/proxima/direct/io/cassandra/CassandraRandomReader.java b/direct/io-cassandra/src/main/java/cz/o2/proxima/direct/io/cassandra/CassandraRandomReader.java index d4a94557a..5fed2ae81 100644 --- a/direct/io-cassandra/src/main/java/cz/o2/proxima/direct/io/cassandra/CassandraRandomReader.java +++ b/direct/io-cassandra/src/main/java/cz/o2/proxima/direct/io/cassandra/CassandraRandomReader.java @@ -67,7 +67,6 @@ public Optional> get( ByteBuffer val = row.getBytes(0); if (val != null) { byte[] rowValue = val.array(); - try { return Optional.ofNullable( accessor @@ -146,7 +145,6 @@ public void scanWildcard( System.currentTimeMillis(), new Raw(name), rowValue); - if (keyValue != null) { consumer.accept(keyValue); } else { diff --git a/direct/io-cassandra/src/main/java/cz/o2/proxima/direct/io/cassandra/DefaultCqlFactory.java b/direct/io-cassandra/src/main/java/cz/o2/proxima/direct/io/cassandra/DefaultCqlFactory.java index cb0e7f888..987eb7b17 100644 --- a/direct/io-cassandra/src/main/java/cz/o2/proxima/direct/io/cassandra/DefaultCqlFactory.java +++ b/direct/io-cassandra/src/main/java/cz/o2/proxima/direct/io/cassandra/DefaultCqlFactory.java @@ -79,7 +79,7 @@ public byte[] asCellBytes(StreamElement element) { } @Override - public @Nullable KeyValue fromCellBytes( + public KeyValue fromCellBytes( EntityDescriptor entityDescriptor, AttributeDescriptor attributeDescriptor, String key, diff --git a/direct/io-cassandra/src/test/java/cz/o2/proxima/direct/io/cassandra/DefaultCqlFactoryTest.java b/direct/io-cassandra/src/test/java/cz/o2/proxima/direct/io/cassandra/DefaultCqlFactoryTest.java index 48c26629d..ccff14073 100644 --- a/direct/io-cassandra/src/test/java/cz/o2/proxima/direct/io/cassandra/DefaultCqlFactoryTest.java +++ b/direct/io-cassandra/src/test/java/cz/o2/proxima/direct/io/cassandra/DefaultCqlFactoryTest.java @@ -557,7 +557,7 @@ public void testV2SerializerRead() { URI.create("cassandra://whatever/my_table?primary=hgw&data=my_col&serializer=v2"), StringConverter.getDefault()); long now = System.currentTimeMillis(); - KeyValue kv = + assertNotNull( factory.toKeyValue( entity, attrWildcard, @@ -569,9 +569,8 @@ public void testV2SerializerRead() { .setSeqId(1L) .setValue(ByteString.copyFrom(new byte[] {1})) .build() - .toByteArray()); - assertNotNull(kv); - kv = + .toByteArray())); + assertNull( factory.toKeyValue( entity, attrWildcard, @@ -579,7 +578,6 @@ public void testV2SerializerRead() { attrWildcard.toAttributePrefix(true) + "1", System.currentTimeMillis(), Offsets.empty(), - new byte[] {(byte) 199, 0}); - assertNull(kv); + new byte[] {(byte) 199, 0})); } }