review comment fix

This commit is contained in:
Jonathan Shook
2025-01-03 15:09:07 -06:00
parent 9a6a881ceb
commit 1a61846ea0

View File

@@ -2,13 +2,13 @@ package io.nosqlbench.engine.api.activityimpl.uniform;
/* /*
* Copyright (c) nosqlbench * Copyright (c) nosqlbench
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, * Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an * software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -42,14 +42,11 @@ public class AdapterResolver
NBConfiguration configSuperset NBConfiguration configSuperset
) )
{ {
ServiceSelector<DriverAdapterLoader> ServiceSelector<DriverAdapterLoader> selector = ServiceSelector.of(
loader = name, ServiceLoader.load(DriverAdapterLoader.class));
ServiceSelector.of(name, ServiceLoader.load(DriverAdapterLoader.class)); DriverAdapterLoader loader = selector.get()
DriverAdapterLoader .orElseThrow(() -> new OpConfigError("No DriverAdapterLoader found for " + name));
dal = DriverAdapter<CycleOp<?>, Space> adapter = loader.load(parent, NBLabels.forKV());
loader.get()
.orElseThrow(() -> new OpConfigError("No DriverAdapterLoader found for " + name));
DriverAdapter<CycleOp<?>, Space> adapter = dal.load(parent, NBLabels.forKV());
if (adapter instanceof NBConfigurable configurable) { if (adapter instanceof NBConfigurable configurable) {
NBConfigModel adapterModel = configurable.getConfigModel(); NBConfigModel adapterModel = configurable.getConfigModel();