Search in sources :

Example 51 with ByteArray

use of org.apache.ignite.lang.ByteArray in project ignite-3 by apache.

the class ConcurrentHashMapPartitionStorage method read.

/**
 * {@inheritDoc}
 */
@Override
@Nullable
public DataRow read(SearchRow key) throws StorageException {
    byte[] keyBytes = key.keyBytes();
    byte[] valueBytes = map.get(new ByteArray(keyBytes));
    return valueBytes == null ? null : new SimpleDataRow(keyBytes, valueBytes);
}
Also used : ByteArray(org.apache.ignite.lang.ByteArray) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

ByteArray (org.apache.ignite.lang.ByteArray)51 Test (org.junit.jupiter.api.Test)35 Cursor (org.apache.ignite.internal.util.Cursor)13 List (java.util.List)12 WatchAggregator (org.apache.ignite.internal.metastorage.watch.WatchAggregator)12 Assertions.assertEquals (org.junit.jupiter.api.Assertions.assertEquals)11 Map (java.util.Map)10 NotNull (org.jetbrains.annotations.NotNull)9 Collection (java.util.Collection)8 Iterator (java.util.Iterator)8 Collectors (java.util.stream.Collectors)8 AfterEach (org.junit.jupiter.api.AfterEach)8 Assertions.assertTrue (org.junit.jupiter.api.Assertions.assertTrue)8 Assertions.fail (org.junit.jupiter.api.Assertions.fail)8 BeforeEach (org.junit.jupiter.api.BeforeEach)8 ByteBuffer (java.nio.ByteBuffer)7 UTF_8 (java.nio.charset.StandardCharsets.UTF_8)7 ArrayList (java.util.ArrayList)7 NoSuchElementException (java.util.NoSuchElementException)7 Function.identity (java.util.function.Function.identity)7