package organization

This commit is contained in:
Jonathan Shook 2020-11-22 02:55:20 -06:00
parent a23808b36d
commit 2ab118f400
35 changed files with 136 additions and 43 deletions

View File

@ -106,11 +106,6 @@
<artifactId>netty-handler</artifactId>
</dependency>
<dependency>
<groupId>com.github.oshi</groupId>
<artifactId>oshi-core</artifactId>
</dependency>
<!-- test scope only -->

View File

@ -25,7 +25,7 @@ import io.nosqlbench.engine.api.activityimpl.SimpleActivity;
import io.nosqlbench.engine.api.activityimpl.action.CoreActionDispenser;
import io.nosqlbench.engine.api.activityimpl.motor.CoreMotorDispenser;
import io.nosqlbench.engine.api.util.SimpleServiceLoader;
import io.nosqlbench.nb.spi.Named;
import io.nosqlbench.nb.api.spi.Named;
import java.util.Map;
import java.util.Optional;

View File

@ -20,7 +20,7 @@ package io.nosqlbench.engine.api.activityapi.cyclelog.filters;
import io.nosqlbench.engine.api.activityapi.core.Activity;
import io.nosqlbench.engine.api.util.SimpleConfig;
import io.nosqlbench.engine.api.util.SimpleServiceLoader;
import io.nosqlbench.nb.spi.Named;
import io.nosqlbench.nb.api.spi.Named;
import java.util.function.IntPredicate;

View File

@ -18,7 +18,7 @@
package io.nosqlbench.engine.api.activityapi.cyclelog.filters;
import io.nosqlbench.engine.api.util.SimpleServiceLoader;
import io.nosqlbench.nb.spi.Named;
import io.nosqlbench.nb.api.spi.Named;
public interface ResultValueFilterType extends Named {

View File

@ -19,7 +19,7 @@ package io.nosqlbench.engine.api.activityapi.input;
import io.nosqlbench.engine.api.activityapi.core.Activity;
import io.nosqlbench.engine.api.util.SimpleServiceLoader;
import io.nosqlbench.nb.spi.Named;
import io.nosqlbench.nb.api.spi.Named;
public interface InputType extends Named {

View File

@ -19,7 +19,7 @@ package io.nosqlbench.engine.api.activityapi.output;
import io.nosqlbench.engine.api.activityapi.core.Activity;
import io.nosqlbench.engine.api.util.SimpleServiceLoader;
import io.nosqlbench.nb.spi.Named;
import io.nosqlbench.nb.api.spi.Named;
public interface OutputType extends Named {

View File

@ -17,7 +17,7 @@
package io.nosqlbench.engine.api.util;
import io.nosqlbench.nb.spi.Named;
import io.nosqlbench.nb.api.spi.Named;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;

View File

@ -7,9 +7,13 @@ import io.nosqlbench.engine.api.activityapi.cyclelog.outputs.cyclelog.CycleLogIm
import io.nosqlbench.engine.api.activityapi.input.InputType;
import io.nosqlbench.engine.api.activityapi.output.OutputType;
import io.nosqlbench.engine.api.metrics.ActivityMetrics;
import io.nosqlbench.engine.core.*;
import io.nosqlbench.engine.core.annotation.Annotators;
import io.nosqlbench.engine.core.lifecycle.ScenarioErrorHandler;
import io.nosqlbench.engine.core.lifecycle.ScenarioResult;
import io.nosqlbench.engine.core.lifecycle.ScenariosResults;
import io.nosqlbench.engine.core.lifecycle.ShutdownManager;
import io.nosqlbench.engine.core.logging.LoggerConfig;
import io.nosqlbench.engine.core.metadata.MarkdownDocInfo;
import io.nosqlbench.engine.core.metrics.MetricReporters;
import io.nosqlbench.engine.core.script.MetricsMapper;
import io.nosqlbench.engine.core.script.Scenario;

View File

@ -15,7 +15,7 @@
* /
*/
package io.nosqlbench.engine.core;
package io.nosqlbench.engine.core.lifecycle;
public class ActivityExceptionHandler implements Thread.UncaughtExceptionHandler {

View File

@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.nosqlbench.engine.core;
package io.nosqlbench.engine.core.lifecycle;
import io.nosqlbench.engine.api.activityapi.core.*;
import io.nosqlbench.engine.api.activityimpl.ActivityDef;

View File

@ -15,7 +15,7 @@
* /
*/
package io.nosqlbench.engine.core;
package io.nosqlbench.engine.core.lifecycle;
import io.nosqlbench.engine.api.activityapi.core.RunState;
import io.nosqlbench.engine.api.activityimpl.ProgressAndStateMeter;

View File

@ -1,4 +1,4 @@
package io.nosqlbench.engine.core;
package io.nosqlbench.engine.core.lifecycle;
import io.nosqlbench.engine.api.activityimpl.ActivityDef;
import org.apache.logging.log4j.LogManager;

View File

@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.nosqlbench.engine.core;
package io.nosqlbench.engine.core.lifecycle;
import io.nosqlbench.engine.api.activityapi.core.Activity;
import io.nosqlbench.engine.api.activityapi.core.ActivityType;

View File

@ -1,4 +1,4 @@
package io.nosqlbench.engine.core;
package io.nosqlbench.engine.core.lifecycle;
import io.nosqlbench.nb.api.errors.BasicError;
import org.graalvm.polyglot.PolyglotException;

View File

@ -16,7 +16,7 @@
*
*/
package io.nosqlbench.engine.core;
package io.nosqlbench.engine.core.lifecycle;
import com.codahale.metrics.ConsoleReporter;
import com.codahale.metrics.MetricFilter;

View File

@ -15,7 +15,7 @@
* /
*/
package io.nosqlbench.engine.core;
package io.nosqlbench.engine.core.lifecycle;
import io.nosqlbench.engine.core.script.Scenario;
import io.nosqlbench.engine.core.script.ScenariosExecutor;

View File

@ -1,4 +1,4 @@
package io.nosqlbench.engine.core;
package io.nosqlbench.engine.core.metadata;
import io.nosqlbench.engine.api.activityapi.core.ActivityType;
import io.nosqlbench.nb.api.content.Content;

View File

@ -22,7 +22,7 @@ import com.codahale.metrics.graphite.Graphite;
import com.codahale.metrics.graphite.GraphiteReporter;
import io.nosqlbench.engine.api.activityapi.core.Shutdownable;
import io.nosqlbench.engine.api.metrics.ActivityMetrics;
import io.nosqlbench.engine.core.ShutdownManager;
import io.nosqlbench.engine.core.lifecycle.ShutdownManager;
import io.nosqlbench.engine.core.logging.Log4JMetricsReporter;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;

View File

@ -19,10 +19,10 @@ import com.oracle.truffle.js.scriptengine.GraalJSScriptEngine;
import io.nosqlbench.engine.api.extensions.ScriptingPluginInfo;
import io.nosqlbench.engine.api.metrics.ActivityMetrics;
import io.nosqlbench.engine.api.scripting.ScriptEnvBuffer;
import io.nosqlbench.engine.core.ActivityProgressIndicator;
import io.nosqlbench.engine.core.PolyglotScenarioController;
import io.nosqlbench.engine.core.ScenarioController;
import io.nosqlbench.engine.core.ScenarioResult;
import io.nosqlbench.engine.core.lifecycle.ActivityProgressIndicator;
import io.nosqlbench.engine.core.lifecycle.PolyglotScenarioController;
import io.nosqlbench.engine.core.lifecycle.ScenarioController;
import io.nosqlbench.engine.core.lifecycle.ScenarioResult;
import io.nosqlbench.engine.core.annotation.Annotators;
import io.nosqlbench.engine.core.metrics.PolyglotMetricRegistryBindings;
import io.nosqlbench.nb.api.Layer;

View File

@ -17,10 +17,10 @@
package io.nosqlbench.engine.core.script;
import io.nosqlbench.engine.core.IndexedThreadFactory;
import io.nosqlbench.engine.core.ScenarioController;
import io.nosqlbench.engine.core.ScenarioResult;
import io.nosqlbench.engine.core.ScenariosResults;
import io.nosqlbench.engine.core.lifecycle.IndexedThreadFactory;
import io.nosqlbench.engine.core.lifecycle.ScenarioController;
import io.nosqlbench.engine.core.lifecycle.ScenarioResult;
import io.nosqlbench.engine.core.lifecycle.ScenariosResults;
import io.nosqlbench.nb.api.errors.BasicError;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

View File

@ -12,6 +12,7 @@ import io.nosqlbench.engine.api.activityimpl.input.CoreInputDispenser;
import io.nosqlbench.engine.api.activityimpl.input.AtomicInput;
import io.nosqlbench.engine.api.activityimpl.motor.CoreMotor;
import io.nosqlbench.engine.api.activityimpl.motor.CoreMotorDispenser;
import io.nosqlbench.engine.core.lifecycle.ActivityExecutor;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.junit.Test;

View File

@ -17,7 +17,7 @@
package io.nosqlbench.engine.core.script;
import io.nosqlbench.engine.core.ScenariosResults;
import io.nosqlbench.engine.core.lifecycle.ScenariosResults;
import org.junit.Ignore;
import org.junit.Test;

View File

@ -5,7 +5,7 @@ import io.nosqlbench.engine.cli.BasicScriptBuffer;
import io.nosqlbench.engine.cli.Cmd;
import io.nosqlbench.engine.cli.NBCLICommandParser;
import io.nosqlbench.engine.cli.ScriptBuffer;
import io.nosqlbench.engine.core.ScenarioResult;
import io.nosqlbench.engine.core.lifecycle.ScenarioResult;
import io.nosqlbench.engine.core.script.Scenario;
import io.nosqlbench.engine.core.script.ScenariosExecutor;
import io.nosqlbench.engine.rest.services.WorkSpace;

View File

@ -3,7 +3,7 @@ package io.nosqlbench.engine.rest.transfertypes;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import io.nosqlbench.engine.api.activityapi.core.ProgressMeter;
import io.nosqlbench.engine.core.ScenarioResult;
import io.nosqlbench.engine.core.lifecycle.ScenarioResult;
import io.nosqlbench.engine.core.script.Scenario;
import java.util.ArrayList;

View File

@ -1,6 +1,6 @@
package io.nosqlbench.engine.rest.transfertypes;
import io.nosqlbench.engine.core.ScenarioResult;
import io.nosqlbench.engine.core.lifecycle.ScenarioResult;
public class ResultView {

View File

@ -57,6 +57,11 @@
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>com.github.oshi</groupId>
<artifactId>oshi-core</artifactId>
</dependency>
<!-- perf testing -->
<dependency>

View File

@ -1,4 +1,4 @@
package io.nosqlbench.engine.core.metrics;
package io.nosqlbench.nb.api;
public enum OnError {
Warn,

View File

@ -0,0 +1,36 @@
package io.nosqlbench.nb.api;
import oshi.SystemInfo;
import oshi.hardware.HardwareAbstractionLayer;
import oshi.hardware.NetworkIF;
import java.util.*;
public class SystemId {
public static String getNodeId() {
SystemInfo sysinfo = new SystemInfo();
HardwareAbstractionLayer hal = sysinfo.getHardware();
List<NetworkIF> interfaces = hal.getNetworkIFs();
Optional<String> first = interfaces.stream()
.filter(i -> !i.getName().startsWith("docker" ))
.filter(i -> !i.getName().equals("lo" ))
.sorted((o1, o2) -> {
if (o1.getName().startsWith("e" ) && o2.getName().startsWith("e" )) {
return 0;
}
if (o1.getName().startsWith("e" )) {
return -1;
}
if (o2.getName().startsWith("e" )) {
return 1;
}
return 0;
})
.flatMap(iface -> Arrays.stream(iface.getIPv4addr().clone()))
.filter(addr -> !(addr.startsWith("127." )))
.findFirst();
String systemID = first.orElse("UNKNOWN_SYSTEM_ID" );
return systemID;
}
}

View File

@ -1,6 +1,6 @@
package io.nosqlbench.nb.api.annotations;
import io.nosqlbench.nb.spi.Named;
import io.nosqlbench.nb.api.spi.Named;
/**
* An implementation of this type is responsible for taking annotation details and

View File

@ -1,4 +1,4 @@
package io.nosqlbench.nb.spi;
package io.nosqlbench.nb.api.spi;
public interface Named {
/**

View File

@ -0,0 +1,52 @@
package io.nosqlbench.nb.api.config;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class MutableConfigModelTest {
@Test
void optional() {
}
@Test
void testOptional() {
}
@Test
void required() {
}
@Test
void testRequired() {
}
@Test
void defaultto() {
}
@Test
void testDefaultto() {
}
@Test
void asReadOnly() {
}
@Test
void getElements() {
}
@Test
void getOf() {
}
@Test
void assertValidConfig() {
}
@Test
void apply() {
}
}

View File

@ -17,8 +17,8 @@
package io.nosqlbench.engine.core.script;
import io.nosqlbench.engine.core.ScenarioResult;
import io.nosqlbench.engine.core.ScenariosResults;
import io.nosqlbench.engine.core.lifecycle.ScenarioResult;
import io.nosqlbench.engine.core.lifecycle.ScenariosResults;
import org.apache.commons.compress.utils.IOUtils;
import org.assertj.core.data.Offset;
import org.junit.BeforeClass;

View File

@ -17,8 +17,8 @@
package io.nosqlbench.engine.core.script;
import io.nosqlbench.engine.core.ScenarioResult;
import io.nosqlbench.engine.core.ScenariosResults;
import io.nosqlbench.engine.core.lifecycle.ScenarioResult;
import io.nosqlbench.engine.core.lifecycle.ScenariosResults;
import org.apache.commons.compress.utils.IOUtils;
import org.assertj.core.data.Offset;
import org.junit.BeforeClass;

View File

@ -14,7 +14,7 @@
*/
package io.nosqlbench.engine.core.script;
import io.nosqlbench.engine.core.ScenarioResult;
import io.nosqlbench.engine.core.lifecycle.ScenarioResult;
import org.junit.Ignore;
import org.junit.Test;

View File

@ -1,6 +1,6 @@
package io.nosqlbench.virtdata.core.bindings;
import io.nosqlbench.nb.spi.Named;
import io.nosqlbench.nb.api.spi.Named;
import io.nosqlbench.virtdata.lang.ast.Expression;
import io.nosqlbench.virtdata.lang.ast.FunctionCall;
import io.nosqlbench.virtdata.lang.parser.VirtDataDSL;