use of com.swirlds.jasperdb.VirtualInternalRecordSerializer in project hedera-services by hashgraph.
the class VirtualMapFactory method newVirtualizedStorage.
public VirtualMap<ContractKey, ContractValue> newVirtualizedStorage() {
final var storageKeySerializer = new ContractKeySerializer();
final VirtualLeafRecordSerializer<ContractKey, ContractValue> storageLeafRecordSerializer = new VirtualLeafRecordSerializer<>(CURRENT_SERIALIZATION_VERSION, DigestType.SHA_384, CURRENT_SERIALIZATION_VERSION, storageKeySerializer.getSerializedSize(), new ContractKeySupplier(), CURRENT_SERIALIZATION_VERSION, ContractValue.SERIALIZED_SIZE, new ContractValueSupplier(), true);
final JasperDbBuilder<ContractKey, ContractValue> dsBuilder = jdbBuilderFactory.newJdbBuilder();
dsBuilder.virtualLeafRecordSerializer(storageLeafRecordSerializer).virtualInternalRecordSerializer(new VirtualInternalRecordSerializer()).keySerializer(storageKeySerializer).maxNumOfKeys(MAX_STORAGE_ENTRIES).preferDiskBasedIndexes(false).internalHashesRamToDiskThreshold(MAX_IN_MEMORY_INTERNAL_HASHES);
return new VirtualMap<>(STORAGE_VM_NAME, dsBuilder);
}
Aggregations