Search in sources :

Example 1 with DataSourceValidator

use of com.swirlds.jasperdb.DataSourceValidator in project hedera-services by hashgraph.

the class ContractDataSourceValidator method main.

public static void main(String[] args) throws IOException {
    Path dataSourcePath = Path.of("").toAbsolutePath();
    System.out.println("dataSourcePath = " + dataSourcePath + " exists " + Files.exists(dataSourcePath));
    VirtualLeafRecordSerializer<ContractKey, ContractValue> virtualLeafRecordSerializer = new VirtualLeafRecordSerializer<>((short) 1, DigestType.SHA_384, (short) 1, DataFileCommon.VARIABLE_DATA_SIZE, new ContractKeySupplier(), (short) 1, ContractValue.SERIALIZED_SIZE, new ContractValueSupplier(), true);
    ;
    JasperDbBuilder<ContractKey, ContractValue> dbBuilder = new JasperDbBuilder<>();
    dbBuilder.virtualLeafRecordSerializer(virtualLeafRecordSerializer).virtualInternalRecordSerializer(new VirtualInternalRecordSerializer()).keySerializer(new ContractKeySerializer()).storageDir(dataSourcePath).maxNumOfKeys(500_000_000).preferDiskBasedIndexes(false).internalHashesRamToDiskThreshold(0).mergingEnabled(true);
    DataSourceValidator<ContractKey, ContractValue> dataSourceValidator = new DataSourceValidator<>(dbBuilder.build("jdb", "4validator"));
    dataSourceValidator.validate();
}
Also used : Path(java.nio.file.Path) DataSourceValidator(com.swirlds.jasperdb.DataSourceValidator) VirtualLeafRecordSerializer(com.swirlds.jasperdb.VirtualLeafRecordSerializer) JasperDbBuilder(com.swirlds.jasperdb.JasperDbBuilder) ContractValue(com.hedera.services.state.virtual.ContractValue) ContractKey(com.hedera.services.state.virtual.ContractKey) ContractValueSupplier(com.hedera.services.state.virtual.ContractValueSupplier) VirtualInternalRecordSerializer(com.swirlds.jasperdb.VirtualInternalRecordSerializer) ContractKeySerializer(com.hedera.services.state.virtual.ContractKeySerializer) ContractKeySupplier(com.hedera.services.state.virtual.ContractKeySupplier)

Aggregations

ContractKey (com.hedera.services.state.virtual.ContractKey)1 ContractKeySerializer (com.hedera.services.state.virtual.ContractKeySerializer)1 ContractKeySupplier (com.hedera.services.state.virtual.ContractKeySupplier)1 ContractValue (com.hedera.services.state.virtual.ContractValue)1 ContractValueSupplier (com.hedera.services.state.virtual.ContractValueSupplier)1 DataSourceValidator (com.swirlds.jasperdb.DataSourceValidator)1 JasperDbBuilder (com.swirlds.jasperdb.JasperDbBuilder)1 VirtualInternalRecordSerializer (com.swirlds.jasperdb.VirtualInternalRecordSerializer)1 VirtualLeafRecordSerializer (com.swirlds.jasperdb.VirtualLeafRecordSerializer)1 Path (java.nio.file.Path)1