use of org.apache.ignite.internal.storage.basic.SimpleDataRow in project ignite-3 by apache.
the class ItInternalTableScanTest method prepareDataRow.
/**
* Helper method to convert key and value to {@link DataRow}.
*
* @param entryKey Key.
* @param entryVal Value
* @return {@link DataRow} based on given key and value.
* @throws java.io.IOException If failed to close output stream that was used to convertation.
*/
@NotNull
private static DataRow prepareDataRow(@NotNull String entryKey, @NotNull String entryVal) throws IOException {
byte[] keyBytes = ByteUtils.toBytes(entryKey);
try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
outputStream.write(keyBytes);
outputStream.write(ByteUtils.toBytes(entryVal));
return new SimpleDataRow(keyBytes, outputStream.toByteArray());
}
}
Aggregations