mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-16 17:34:52 -06:00
pull Named service up
This commit is contained in:
parent
574a89e75a
commit
4a9fa81b59
@ -24,8 +24,8 @@ import io.nosqlbench.engine.api.activityimpl.CoreServices;
|
|||||||
import io.nosqlbench.engine.api.activityimpl.SimpleActivity;
|
import io.nosqlbench.engine.api.activityimpl.SimpleActivity;
|
||||||
import io.nosqlbench.engine.api.activityimpl.action.CoreActionDispenser;
|
import io.nosqlbench.engine.api.activityimpl.action.CoreActionDispenser;
|
||||||
import io.nosqlbench.engine.api.activityimpl.motor.CoreMotorDispenser;
|
import io.nosqlbench.engine.api.activityimpl.motor.CoreMotorDispenser;
|
||||||
import io.nosqlbench.engine.api.util.Named;
|
|
||||||
import io.nosqlbench.engine.api.util.SimpleServiceLoader;
|
import io.nosqlbench.engine.api.util.SimpleServiceLoader;
|
||||||
|
import io.nosqlbench.nb.spi.Named;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@ -40,7 +40,7 @@ import java.util.Optional;
|
|||||||
*/
|
*/
|
||||||
public interface ActivityType<A extends Activity> extends Named {
|
public interface ActivityType<A extends Activity> extends Named {
|
||||||
|
|
||||||
public static SimpleServiceLoader<ActivityType> FINDER = new SimpleServiceLoader<>(ActivityType.class);
|
SimpleServiceLoader<ActivityType> FINDER = new SimpleServiceLoader<>(ActivityType.class);
|
||||||
/**
|
/**
|
||||||
* Return the short name of this activity type. The fully qualified name of an activity type is
|
* Return the short name of this activity type. The fully qualified name of an activity type is
|
||||||
* this value, prefixed by the package of the implementing class.
|
* this value, prefixed by the package of the implementing class.
|
||||||
|
@ -18,15 +18,15 @@
|
|||||||
package io.nosqlbench.engine.api.activityapi.cyclelog.filters;
|
package io.nosqlbench.engine.api.activityapi.cyclelog.filters;
|
||||||
|
|
||||||
import io.nosqlbench.engine.api.activityapi.core.Activity;
|
import io.nosqlbench.engine.api.activityapi.core.Activity;
|
||||||
import io.nosqlbench.engine.api.util.Named;
|
|
||||||
import io.nosqlbench.engine.api.util.SimpleConfig;
|
import io.nosqlbench.engine.api.util.SimpleConfig;
|
||||||
import io.nosqlbench.engine.api.util.SimpleServiceLoader;
|
import io.nosqlbench.engine.api.util.SimpleServiceLoader;
|
||||||
|
import io.nosqlbench.nb.spi.Named;
|
||||||
|
|
||||||
import java.util.function.IntPredicate;
|
import java.util.function.IntPredicate;
|
||||||
|
|
||||||
public interface ExperimentalResultFilterType extends Named {
|
public interface ExperimentalResultFilterType extends Named {
|
||||||
|
|
||||||
public static SimpleServiceLoader<ExperimentalResultFilterType> FINDER =
|
SimpleServiceLoader<ExperimentalResultFilterType> FINDER =
|
||||||
new SimpleServiceLoader<>(ExperimentalResultFilterType.class);
|
new SimpleServiceLoader<>(ExperimentalResultFilterType.class);
|
||||||
|
|
||||||
default IntPredicateDispenser getFilterDispenser(Activity activity) {
|
default IntPredicateDispenser getFilterDispenser(Activity activity) {
|
||||||
@ -41,7 +41,7 @@ public interface ExperimentalResultFilterType extends Named {
|
|||||||
|
|
||||||
IntPredicate getIntPredicate(SimpleConfig conf);
|
IntPredicate getIntPredicate(SimpleConfig conf);
|
||||||
|
|
||||||
public static class StaticDispenser implements IntPredicateDispenser {
|
class StaticDispenser implements IntPredicateDispenser {
|
||||||
|
|
||||||
private final IntPredicate predicate;
|
private final IntPredicate predicate;
|
||||||
|
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
|
|
||||||
package io.nosqlbench.engine.api.activityapi.cyclelog.filters;
|
package io.nosqlbench.engine.api.activityapi.cyclelog.filters;
|
||||||
|
|
||||||
import io.nosqlbench.engine.api.util.Named;
|
|
||||||
import io.nosqlbench.engine.api.util.SimpleServiceLoader;
|
import io.nosqlbench.engine.api.util.SimpleServiceLoader;
|
||||||
|
import io.nosqlbench.nb.spi.Named;
|
||||||
|
|
||||||
public interface ResultValueFilterType extends Named {
|
public interface ResultValueFilterType extends Named {
|
||||||
|
|
||||||
|
@ -18,12 +18,12 @@
|
|||||||
package io.nosqlbench.engine.api.activityapi.input;
|
package io.nosqlbench.engine.api.activityapi.input;
|
||||||
|
|
||||||
import io.nosqlbench.engine.api.activityapi.core.Activity;
|
import io.nosqlbench.engine.api.activityapi.core.Activity;
|
||||||
import io.nosqlbench.engine.api.util.Named;
|
|
||||||
import io.nosqlbench.engine.api.util.SimpleServiceLoader;
|
import io.nosqlbench.engine.api.util.SimpleServiceLoader;
|
||||||
|
import io.nosqlbench.nb.spi.Named;
|
||||||
|
|
||||||
public interface InputType extends Named {
|
public interface InputType extends Named {
|
||||||
|
|
||||||
public static SimpleServiceLoader<InputType> FINDER =
|
SimpleServiceLoader<InputType> FINDER =
|
||||||
new SimpleServiceLoader<>(InputType.class);
|
new SimpleServiceLoader<>(InputType.class);
|
||||||
|
|
||||||
InputDispenser getInputDispenser(Activity activity);
|
InputDispenser getInputDispenser(Activity activity);
|
||||||
|
@ -18,12 +18,12 @@
|
|||||||
package io.nosqlbench.engine.api.activityapi.output;
|
package io.nosqlbench.engine.api.activityapi.output;
|
||||||
|
|
||||||
import io.nosqlbench.engine.api.activityapi.core.Activity;
|
import io.nosqlbench.engine.api.activityapi.core.Activity;
|
||||||
import io.nosqlbench.engine.api.util.Named;
|
|
||||||
import io.nosqlbench.engine.api.util.SimpleServiceLoader;
|
import io.nosqlbench.engine.api.util.SimpleServiceLoader;
|
||||||
|
import io.nosqlbench.nb.spi.Named;
|
||||||
|
|
||||||
public interface OutputType extends Named {
|
public interface OutputType extends Named {
|
||||||
|
|
||||||
public static SimpleServiceLoader<OutputType> FINDER =
|
SimpleServiceLoader<OutputType> FINDER =
|
||||||
new SimpleServiceLoader<>(OutputType.class);
|
new SimpleServiceLoader<>(OutputType.class);
|
||||||
|
|
||||||
OutputDispenser getOutputDispenser(Activity activity);
|
OutputDispenser getOutputDispenser(Activity activity);
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* Copyright 2016 jshook
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
* /
|
|
||||||
*/
|
|
||||||
|
|
||||||
package io.nosqlbench.engine.api.util;
|
|
||||||
|
|
||||||
public interface Named {
|
|
||||||
String getName();
|
|
||||||
}
|
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
package io.nosqlbench.engine.api.util;
|
package io.nosqlbench.engine.api.util;
|
||||||
|
|
||||||
|
import io.nosqlbench.nb.spi.Named;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@ -27,7 +28,7 @@ import java.util.stream.Collectors;
|
|||||||
public class SimpleServiceLoader<T extends Named> {
|
public class SimpleServiceLoader<T extends Named> {
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(SimpleServiceLoader.class);
|
private static final Logger logger = LoggerFactory.getLogger(SimpleServiceLoader.class);
|
||||||
private Class<? extends T> serviceType;
|
private final Class<? extends T> serviceType;
|
||||||
private static SimpleServiceLoader instance;
|
private static SimpleServiceLoader instance;
|
||||||
|
|
||||||
private final Map<String, T> types = new ConcurrentHashMap<>();
|
private final Map<String, T> types = new ConcurrentHashMap<>();
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package io.nosqlbench.virtdata.core.bindings;
|
package io.nosqlbench.nb.spi;
|
||||||
|
|
||||||
public interface Named {
|
public interface Named {
|
||||||
/**
|
/**
|
@ -1,5 +1,6 @@
|
|||||||
package io.nosqlbench.virtdata.core.bindings;
|
package io.nosqlbench.virtdata.core.bindings;
|
||||||
|
|
||||||
|
import io.nosqlbench.nb.spi.Named;
|
||||||
import io.nosqlbench.virtdata.lang.ast.Expression;
|
import io.nosqlbench.virtdata.lang.ast.Expression;
|
||||||
import io.nosqlbench.virtdata.lang.ast.FunctionCall;
|
import io.nosqlbench.virtdata.lang.ast.FunctionCall;
|
||||||
import io.nosqlbench.virtdata.lang.parser.VirtDataDSL;
|
import io.nosqlbench.virtdata.lang.parser.VirtDataDSL;
|
||||||
@ -106,7 +107,7 @@ public interface VirtDataFunctionLibrary extends Named {
|
|||||||
case 0:
|
case 0:
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
case 1:
|
case 1:
|
||||||
return Optional.of(DataMapperFunctionMapper.<T>map(resolvedFunctions.get(0).getFunctionObject()));
|
return Optional.of(DataMapperFunctionMapper.map(resolvedFunctions.get(0).getFunctionObject()));
|
||||||
default:
|
default:
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
"Found " + resolvedFunctions.size() +
|
"Found " + resolvedFunctions.size() +
|
||||||
|
Loading…
Reference in New Issue
Block a user