Search in sources :

Example 1 with StateStorageMode

use of tech.pegasys.teku.storage.server.StateStorageMode in project teku by ConsenSys.

the class StorageSystemArgumentsProvider method provideArguments.

@Override
public Stream<? extends Arguments> provideArguments(ExtensionContext context) {
    final Map<String, StorageSystemSupplier> storageSystems = new HashMap<>();
    for (StateStorageMode mode : StateStorageMode.values()) {
        for (Long storageFrequency : stateStorageFrequencyOptions) {
            for (DatabaseVersion databaseVersion : supportedDatabaseVersions()) {
                storageSystems.put(describeStorage(databaseVersion.name() + " (in-memory)", storageFrequency), (dataPath, spec) -> InMemoryStorageSystemBuilder.create().specProvider(spec).version(databaseVersion).storageMode(mode).stateStorageFrequency(storageFrequency).build());
                storageSystems.put(describeStorage(databaseVersion.name() + " (file-backed)", storageFrequency), (dataPath, spec) -> FileBackedStorageSystemBuilder.create().specProvider(spec).version(databaseVersion).dataDir(dataPath).storageMode(mode).stateStorageFrequency(storageFrequency).build());
            }
        }
    }
    return storageSystems.entrySet().stream().map((entry) -> Arguments.of("storage type: " + entry.getKey(), entry.getValue()));
}
Also used : HashMap(java.util.HashMap) StateStorageMode(tech.pegasys.teku.storage.server.StateStorageMode) DatabaseVersion(tech.pegasys.teku.storage.server.DatabaseVersion)

Aggregations

HashMap (java.util.HashMap)1 DatabaseVersion (tech.pegasys.teku.storage.server.DatabaseVersion)1 StateStorageMode (tech.pegasys.teku.storage.server.StateStorageMode)1