use of org.apache.ignite.internal.storage.index.SortedIndexStorage in project ignite-3 by apache.
the class IndexRowWrapper method randomRow.
/**
* Creates an Entry with a random key that satisfies the given schema and a random value.
*/
static IndexRowWrapper randomRow(SortedIndexStorage indexStorage) {
var random = new Random();
Object[] columns = indexStorage.indexDescriptor().indexRowColumns().stream().map(ColumnDescriptor::column).map(column -> generateRandomValue(random, column.type())).toArray();
var primaryKey = new ByteArraySearchRow(randomBytes(random, 25));
IndexRow row = indexStorage.indexRowFactory().createIndexRow(columns, primaryKey);
return new IndexRowWrapper(indexStorage, row, columns);
}
Aggregations