diff --git a/build.gradle b/build.gradle index 7b75bd88..fd5ce403 100644 --- a/build.gradle +++ b/build.gradle @@ -16,11 +16,11 @@ ext { projectVersion = '0.3.3' + (Boolean.valueOf(System.getProperty('release')) ? '' : '-SNAPSHOT') // Gradle plugins - gradleVersion = '8.1.1' - buildConfigPluginVersion = '4.0.2' + gradleVersion = '8.6' + buildConfigPluginVersion = '5.3.5' gitVersionPluginVersion = '3.0.0' shadowPluginVersion = '8.1.1' - protobufPluginVersion = '0.9.2' + protobufPluginVersion = '0.9.4' // Core dependencies agronaVersion = '1.18.1' @@ -28,21 +28,22 @@ ext { slf4jVersion = '2.0.7' // Binding dependencies - jucxVersion = '1.14' + jucxVersion = '1.14.1' infinileapVersion = '0.2.0-SNAPSHOT' // Example dependencies - log4jVersion = '2.20.0' - picocliVersion = '4.7.3' - kryoVersion = '5.5.0' - nettyVersion = '4.1.92.Final' - grpcVersion = '1.54.1' - protobufVersion = '3.22.3' + log4jVersion = '2.22.1' + picocliVersion = '4.7.5' + kryoVersion = '5.6.0' + nettyVersion = '4.1.107.Final' + grpcVersion = '1.61.1' + protobufVersion = '3.25.3' tomcatVersion = '6.0.53' ycsbVersion = '0.17.0' + bookkeeperVersion = '4.16.4' // Test dependencies - junitJupiterVersion = '5.9.2' + junitJupiterVersion = '5.10.2' } subprojects { diff --git a/core/src/main/java/de/hhu/bsinfo/hadronio/Configuration.java b/core/src/main/java/de/hhu/bsinfo/hadronio/Configuration.java index a747b96b..f6b6ef0e 100644 --- a/core/src/main/java/de/hhu/bsinfo/hadronio/Configuration.java +++ b/core/src/main/java/de/hhu/bsinfo/hadronio/Configuration.java @@ -26,7 +26,7 @@ enum PollMethod { private static final int DEFAULT_FLUSH_INTERVAL_SIZE = 1024; private static final int DEFAULT_BUSY_POLL_TIMEOUT_NANOS = 20000; - private static final String DEFAULT_POLL_METHOD = "DYNAMIC"; + private static final String DEFAULT_POLL_METHOD = "BUSY_POLLING"; private final int sendBufferLength; private final int receiveBufferLength; diff --git a/core/src/main/java/de/hhu/bsinfo/hadronio/HadronioSelector.java b/core/src/main/java/de/hhu/bsinfo/hadronio/HadronioSelector.java index c15926c3..b202e658 100644 --- a/core/src/main/java/de/hhu/bsinfo/hadronio/HadronioSelector.java +++ b/core/src/main/java/de/hhu/bsinfo/hadronio/HadronioSelector.java @@ -62,7 +62,7 @@ class HadronioSelector extends AbstractSelector { @Override protected void implCloseSelector() throws IOException { - LOGGER.info("Closing selector"); + if (DebugConfig.DEBUG) LOGGER.debug("Closing selector"); selectorClosed = true; synchronized (this) { @@ -96,7 +96,7 @@ protected SelectionKey register(final AbstractSelectableChannel channel, final i final var key = new HadronioSelectionKey(channel, this); key.interestOps(interestOps); key.attach(attachment); - LOGGER.info("Registering channel with selection key [{}]", key); + if (DebugConfig.DEBUG) LOGGER.debug("Registering channel with selection key [{}]", key); synchronized (keys) { synchronized (wakeupLock) { diff --git a/core/src/main/java/de/hhu/bsinfo/hadronio/HadronioServerSocketChannel.java b/core/src/main/java/de/hhu/bsinfo/hadronio/HadronioServerSocketChannel.java index c948754c..5f03d387 100644 --- a/core/src/main/java/de/hhu/bsinfo/hadronio/HadronioServerSocketChannel.java +++ b/core/src/main/java/de/hhu/bsinfo/hadronio/HadronioServerSocketChannel.java @@ -5,6 +5,7 @@ import de.hhu.bsinfo.hadronio.binding.UcxWorker; import java.util.Stack; +import de.hhu.bsinfo.hadronio.generated.DebugConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -60,7 +61,7 @@ public synchronized ServerSocketChannel bind(final SocketAddress socketAddress, try { listener.bind(localAddress, connectionRequest -> { - LOGGER.info("Received connection request"); + if (DebugConfig.DEBUG) LOGGER.debug("Received connection request"); if (backlog <= 0 || pendingRequests.size() < backlog) { pendingRequests.push(connectionRequest); @@ -125,7 +126,7 @@ public synchronized SocketChannel accept() throws IOException { listener.getWorker().progress(); } - LOGGER.info("Accepting connection request"); + if (DebugConfig.DEBUG) LOGGER.debug("Accepting connection request"); final var endpoint = listener.accept(pendingRequests.pop()); final var socket = new HadronioSocketChannel(provider(), endpoint); @@ -144,14 +145,14 @@ public SocketAddress getLocalAddress() { @Override protected void implCloseSelectableChannel() throws IOException { - LOGGER.info("Closing server socket channel bound to [{}]", getLocalAddress()); + if (DebugConfig.DEBUG) LOGGER.debug("Closing server socket channel bound to [{}]", getLocalAddress()); channelClosed = true; listener.close(); } @Override protected void implConfigureBlocking(boolean blocking) { - LOGGER.info("Server socket channel is now configured to be [{}]", blocking ? "BLOCKING" : "NON-BLOCKING"); + if (DebugConfig.DEBUG) LOGGER.debug("Server socket channel is now configured to be [{}]", blocking ? "BLOCKING" : "NON-BLOCKING"); } @Override diff --git a/core/src/main/java/de/hhu/bsinfo/hadronio/HadronioSocketChannel.java b/core/src/main/java/de/hhu/bsinfo/hadronio/HadronioSocketChannel.java index 2c754d09..98a8b79d 100644 --- a/core/src/main/java/de/hhu/bsinfo/hadronio/HadronioSocketChannel.java +++ b/core/src/main/java/de/hhu/bsinfo/hadronio/HadronioSocketChannel.java @@ -119,7 +119,7 @@ public SocketChannel shutdownInput() throws IOException { throw new ClosedChannelException(); } - LOGGER.info("Closing connection for input"); + if (DebugConfig.DEBUG) LOGGER.debug("Closing connection for input"); inputClosed = true; return this; } @@ -134,7 +134,7 @@ public SocketChannel shutdownOutput() throws IOException { throw new ClosedChannelException(); } - LOGGER.info("Closing connection for output"); + if (DebugConfig.DEBUG) LOGGER.debug("Closing connection for output"); outputClosed = true; return this; } @@ -173,7 +173,7 @@ public synchronized boolean connect(final SocketAddress remoteAddress) throws IO } connectionPending = true; - LOGGER.info("Connecting to [{}]", remoteAddress); + if (DebugConfig.DEBUG) LOGGER.debug("Connecting to [{}]", remoteAddress); endpoint.connect((InetSocketAddress) remoteAddress); establishConnection(); @@ -321,7 +321,7 @@ public SocketAddress getLocalAddress() throws IOException { @Override protected void implCloseSelectableChannel() throws IOException { - LOGGER.info("Closing socket channel"); + if (DebugConfig.DEBUG) LOGGER.debug("Closing socket channel"); channelClosed = true; inputClosed = true; outputClosed = true; @@ -331,7 +331,7 @@ protected void implCloseSelectableChannel() throws IOException { @Override protected void implConfigureBlocking(final boolean blocking) { - LOGGER.info("Socket channel is now configured to be [{}]", blocking ? "BLOCKING" : "NON-BLOCKING"); + if (DebugConfig.DEBUG) LOGGER.debug("Socket channel is now configured to be [{}]", blocking ? "BLOCKING" : "NON-BLOCKING"); } @Override @@ -401,7 +401,7 @@ public void onConnection(final boolean success, long localTag, long remoteTag) { endpoint.setSendCallback(new SendCallback(sendBuffer)); endpoint.setReceiveCallback(new ReceiveCallback(this, readableMessages, isFlushing, configuration.getFlushIntervalSize())); - LOGGER.info("SocketChannel connected successfully (connection: [{} -> {}], localTag: [0x{}], remoteTag: [0x{}])", endpoint.getLocalAddress(), endpoint.getRemoteAddress(), Long.toHexString(localTag), Long.toHexString(remoteTag)); + if (DebugConfig.DEBUG) LOGGER.debug("SocketChannel connected successfully (connection: [{} -> {}], localTag: [0x{}], remoteTag: [0x{}])", endpoint.getLocalAddress(), endpoint.getRemoteAddress(), Long.toHexString(localTag), Long.toHexString(remoteTag)); if (isBlocking()) { connected = true; @@ -462,7 +462,7 @@ void establishConnection() { endpoint.setSendCallback(connectionCallback); endpoint.setReceiveCallback(connectionCallback); - LOGGER.info("Exchanging tags to establish connection"); + if (DebugConfig.DEBUG) LOGGER.debug("Exchanging tags to establish connection"); endpoint.sendStream(sendBuffer.addressOffset(), 2 * Long.BYTES, true, true); endpoint.receiveStream(receiveBuffer.addressOffset(), 2 * Long.BYTES, true, false); } diff --git a/example/build.gradle b/example/build.gradle index d9ab6f8e..1519f2f3 100644 --- a/example/build.gradle +++ b/example/build.gradle @@ -42,6 +42,7 @@ dependencies { implementation "io.grpc:grpc-netty-shaded:${grpcVersion}" implementation "org.apache.tomcat:annotations-api:${tomcatVersion}" implementation "site.ycsb:core:${ycsbVersion}" + implementation "org.apache.bookkeeper:bookkeeper-server:${bookkeeperVersion}" testImplementation "org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}" diff --git a/example/src/dist/bin/grpc/benchmark_client_inc_connections.sh b/example/src/dist/bin/grpc/benchmark_client_inc_connections.sh index 5d63c0d3..34d96a36 100755 --- a/example/src/dist/bin/grpc/benchmark_client_inc_connections.sh +++ b/example/src/dist/bin/grpc/benchmark_client_inc_connections.sh @@ -16,7 +16,7 @@ readonly BENCHMARK_NAME=${11} wait() { local seconds=$1 - for (( k=0; k<$seconds; k++ )) do + for (( k=0; k 0 ? requestCount / 10 : 1; + LOGGER.info("Starting warmup with [{}] requests", warmupCount); + + try { + for (int i = 0; i < requestCount; i++) { + ledgerPool.getRandomLedger().addEntry(data); + } + } catch (BKException | InterruptedException e) { + LOGGER.error("Failed get data from benchmark file", e); + return; + } + + LOGGER.info("Finished warmup"); + + // Benchmark + try { + syncBarrier.await(); + } catch (InterruptedException | BrokenBarrierException e) { + throw new RuntimeException(e); + } + + LOGGER.info("Starting benchmark with [{}] requests", requestCount); + try { + final var startTime = System.nanoTime(); + + for (int i = 0; i < requestCount; i++) { + result.startSingleMeasurement(); + ledgerPool.getRandomLedger().addEntry(data); + result.stopSingleMeasurement(); + } + + result.setMeasuredTime(System.nanoTime() - startTime); + } catch (BKException | InterruptedException e) { + LOGGER.error("Failed get data from benchmark file", e); + return; + } + + try { + bookKeeper.close(); + } catch (BKException | InterruptedException e) { + LOGGER.error("Failed to close connection to bookkeeper server"); + } + + combiner.addResult(result); + LOGGER.info("{}", result); + } +} diff --git a/example/src/main/java/de/hhu/bsinfo/hadronio/example/bookkeeper/benchmark/Client.java b/example/src/main/java/de/hhu/bsinfo/hadronio/example/bookkeeper/benchmark/Client.java new file mode 100644 index 00000000..cd773662 --- /dev/null +++ b/example/src/main/java/de/hhu/bsinfo/hadronio/example/bookkeeper/benchmark/Client.java @@ -0,0 +1,76 @@ +package de.hhu.bsinfo.hadronio.example.bookkeeper.benchmark; + +import de.hhu.bsinfo.hadronio.example.bookkeeper.Bookkeeper; +import de.hhu.bsinfo.hadronio.util.LatencyCombiner; +import org.apache.bookkeeper.client.BKException; +import org.apache.bookkeeper.client.BookKeeper; +import org.apache.zookeeper.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.concurrent.CyclicBarrier; + +public class Client implements Runnable { + + private static final int WORKER_THREADS = Integer.parseInt(System.getProperty("de.hhu.bsinfo.hadronio.example.NETTY_WORKER_THREADS", "0")); + + private static final Logger LOGGER = LoggerFactory.getLogger(Benchmark.class); + + private final String remoteAddress; + private final int ledgerCount; + private final int messageCount; + private final int messageSize; + private final int connections; + + private final CyclicBarrier syncBarrier; + private final LatencyCombiner combiner = new LatencyCombiner(); + + private BookKeeper[] clients; + + public Client(final String remoteAddress, final int ledgerCount, final int messageCount, final int messageSize, final int connections) { + this.remoteAddress = remoteAddress; + this.ledgerCount = ledgerCount; + this.messageCount = messageCount; + this.messageSize = messageSize; + this.connections = connections; + syncBarrier = new CyclicBarrier(connections); + clients = new BookKeeper[connections]; + } + + @Override + public void run() { + final var pools = new LedgerPool[connections]; + final var runnables = new BenchmarkRunnable[connections]; + final var threads = new Thread[connections]; + + try { + for (int i = 0; i < connections; i++) { + clients[i] = new BookKeeper(remoteAddress); + pools[i] = new LedgerPool(clients[i], ledgerCount); + runnables[i] = new BenchmarkRunnable(clients[i], pools[i], syncBarrier, combiner, messageCount, messageSize); + threads[i] = new Thread(runnables[i]); + LOGGER.info("Successfully connected to bookkeeper cluster"); + } + } catch (BKException | IOException | InterruptedException e) { + LOGGER.error("Failed to connect to bookkeeper cluster", e); + return; + } + + for (int i = 0; i < connections; i++) { + threads[i].start(); + } + + for (int i = 0; i < connections; i++) { + try { + threads[i].join(); + } catch (InterruptedException e) { + LOGGER.error("Failed to join thread [{}]", threads[i].toString(), e); + } + } + + final var result = combiner.getCombinedResult(); + LOGGER.info("{}", result); + } +} diff --git a/example/src/main/java/de/hhu/bsinfo/hadronio/example/bookkeeper/benchmark/LedgerPool.java b/example/src/main/java/de/hhu/bsinfo/hadronio/example/bookkeeper/benchmark/LedgerPool.java new file mode 100644 index 00000000..d4931fef --- /dev/null +++ b/example/src/main/java/de/hhu/bsinfo/hadronio/example/bookkeeper/benchmark/LedgerPool.java @@ -0,0 +1,34 @@ +package de.hhu.bsinfo.hadronio.example.bookkeeper.benchmark; + +import org.apache.bookkeeper.client.BKException; +import org.apache.bookkeeper.client.BookKeeper; +import org.apache.bookkeeper.client.LedgerHandle; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; + +public class LedgerPool { + + private static final Logger LOGGER = LoggerFactory.getLogger(LedgerPool.class); + + private final BookKeeper client; + private final LedgerHandle[] ledgerHandles; + + LedgerPool(final BookKeeper client, final int ledgerCount) { + this.client = client; + ledgerHandles = new LedgerHandle[ledgerCount]; + } + + void createLedgers() throws BKException, InterruptedException { + LOGGER.info("Creating [{}] ledgers", ledgerHandles.length); + for (int i = 0; i < ledgerHandles.length; i++) { + ledgerHandles[i] = client.createLedger(3, 2, 2, BookKeeper.DigestType.CRC32, "hadroNIO".getBytes(StandardCharsets.UTF_8)); + } + } + + LedgerHandle getRandomLedger() { + final var index = (int) (Math.random() * ledgerHandles.length); + return ledgerHandles[index]; + } +} diff --git a/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/Client.java b/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/Client.java index f2ebe053..105122df 100644 --- a/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/Client.java +++ b/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/Client.java @@ -16,11 +16,17 @@ import java.net.InetSocketAddress; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; public class Client implements Closeable { + private static final int WORKER_THREADS = Integer.parseInt(System.getProperty("de.hhu.bsinfo.hadronio.example.NETTY_WORKER_THREADS", "0")); private static final Logger LOGGER = LoggerFactory.getLogger(Client.class); + private static final NioEventLoopGroup WORKER_GROUP = new NioEventLoopGroup(WORKER_THREADS); + private static final ExecutorService EXECUTOR_GROUP = Executors.newFixedThreadPool(1); + private final ObjectConverter converter = new ObjectConverter(); private MessageDigest messageDigest; private KeyValueStoreGrpc.KeyValueStoreBlockingStub[] blockingStubs; @@ -28,7 +34,6 @@ public class Client implements Closeable { private long[] buckets; public void connect(final InetSocketAddress[] remoteAddresses) { - final var workerGroup = new NioEventLoopGroup(remoteAddresses.length); blockingStubs = new KeyValueStoreGrpc.KeyValueStoreBlockingStub[remoteAddresses.length]; ids = new ClientIdMessage[remoteAddresses.length]; buckets = new long[remoteAddresses.length]; @@ -44,7 +49,8 @@ public void connect(final InetSocketAddress[] remoteAddresses) { LOGGER.info("Connecting to server [{}]", remoteAddress); final var channel = NettyChannelBuilder.forAddress(remoteAddress.getHostString(), remoteAddress.getPort()) - .eventLoopGroup(workerGroup) + .eventLoopGroup(WORKER_GROUP) + .executor(EXECUTOR_GROUP) .channelType(NioSocketChannel.class) .usePlaintext() .build(); diff --git a/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/KeyValueStore.java b/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/KeyValueStore.java index c74ea5d7..1cde9fb5 100644 --- a/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/KeyValueStore.java +++ b/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/KeyValueStore.java @@ -19,6 +19,7 @@ class KeyValueStore extends KeyValueStoreGrpc.KeyValueStoreImplBase { private final ConcurrentMap store = new ConcurrentHashMap<>(); private final AtomicInteger counter = new AtomicInteger(); + private final AtomicInteger finishedCounter = new AtomicInteger(); private Server server; private int connections; @@ -112,11 +113,26 @@ public void startBenchmark(final ClientIdMessage request, final StreamObserver responseObserver) { LOGGER.info("Client [#{}] disconnected", request.getId()); - if (counter.decrementAndGet() <= 0) { + if (counter.decrementAndGet() == 0) { + LOGGER.info("Benchmark finished"); server.shutdownNow(); } responseObserver.onNext(Empty.newBuilder().build()); responseObserver.onCompleted(); } + + @Override + public void isBenchmarkFinished(final Empty request, final StreamObserver responseObserver) { + final int remainingConnections = counter.get(); + final boolean finished = remainingConnections == 0; + responseObserver.onNext(BenchmarkFinishedMessage.newBuilder().setFinished(finished).build()); + responseObserver.onCompleted(); + + if (remainingConnections == 0) { + if (finishedCounter.incrementAndGet() >= connections) { + server.shutdownNow(); + } + } + } } \ No newline at end of file diff --git a/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/KeyValueStoreDemo.java b/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/KeyValueStoreDemo.java index 35345e5d..cdc5af35 100644 --- a/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/KeyValueStoreDemo.java +++ b/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/KeyValueStoreDemo.java @@ -4,6 +4,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import picocli.CommandLine; +import site.ycsb.measurements.Measurements; import java.net.InetSocketAddress; import java.nio.file.Path; @@ -67,6 +68,12 @@ public class KeyValueStoreDemo implements Runnable { ) private boolean status = false; + @CommandLine.Option( + names = {"-z", "--measurement-type"}, + description = "Set the measurement type (HDRHISTOGRAM, HISTORGRAM, TIMESERIES)" + ) + private Measurements.MeasurementType measurementType = Measurements.MeasurementType.HDRHISTOGRAM; + @CommandLine.Option( names = {"-o", "--output"}, description = "Path to the result file, to which the CSV data shall be written.") @@ -114,7 +121,7 @@ public void run() { return; } - runnable = new YcsbRunner(remoteAddress, workload, phase, threads, status, resultFileName, benchmarkName, benchmarkIteration, recordSize); + runnable = new YcsbRunner(remoteAddress, workload, phase, measurementType, threads, status, resultFileName, benchmarkName, benchmarkIteration, recordSize); } else { runnable = new Shell(remoteAddress); } diff --git a/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/Server.java b/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/Server.java index 206c9dee..5068cb2c 100644 --- a/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/Server.java +++ b/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/Server.java @@ -8,6 +8,7 @@ import java.io.IOException; import java.net.InetSocketAddress; +import java.util.concurrent.Executors; public class Server implements Runnable { @@ -32,6 +33,7 @@ public void run() { final var server = NettyServerBuilder.forPort(bindAddress.getPort()) .bossEventLoopGroup(acceptorGroup) .workerEventLoopGroup(workerGroup) + .executor(Executors.newFixedThreadPool(WORKER_THREADS)) .channelType(NioServerSocketChannel.class) .addService(store) .build(); diff --git a/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/CsvExporter.java b/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/CsvHistogramExporter.java similarity index 67% rename from example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/CsvExporter.java rename to example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/CsvHistogramExporter.java index 635c7e94..d8b6651e 100644 --- a/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/CsvExporter.java +++ b/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/CsvHistogramExporter.java @@ -2,7 +2,7 @@ import java.io.*; -public class CsvExporter extends LoggingExporter { +public class CsvHistogramExporter extends LoggingExporter { static String benchmarkName; static int iteration; @@ -12,7 +12,7 @@ public class CsvExporter extends LoggingExporter { private final YcsbResult result = new YcsbResult(); - public CsvExporter(final OutputStream outputStream) { + public CsvHistogramExporter(final OutputStream outputStream) { super(outputStream); result.setRecordSize(recordSize); } @@ -32,11 +32,15 @@ public void write(final String metric, final String measurement, final long l) t @Override public void write(final String metric, final String measurement, final double d) throws IOException { super.write(metric, measurement, d); - gather(metric, measurement, d); + if (YcsbProperties.phase == YcsbRunner.Phase.RUN && measurement.startsWith("Throughput")) { + gather(metric, measurement, super.getThroughput()); + } else { + gather(metric, measurement, d); + } } private void gather(final String metric, final String measurement, final double value) { - if (metric.equals("CLEANUP")) { + if (!metric.equals("OVERALL") && !metric.equals("READ")) { return; } @@ -45,28 +49,28 @@ private void gather(final String metric, final String measurement, final double result.setOperationThroughput(value); break; case "AverageLatency(us)": - result.addAverageLatency(value); + result.setAverageLatency(value / 1000000); break; case "MinLatency(us)": - result.addMinimumLatency(value); + result.setMinimumLatency(value / 1000000); break; case "MaxLatency(us)": - result.addMaximumLatency(value); + result.setMaximumLatency(value / 1000000); break; case "50thPercentileLatency(us)": - result.add50thPercentileLatency(value); + result.set50thPercentileLatency(value / 1000000); break; case "95thPercentileLatency(us)": - result.add95thPercentileLatency(value); + result.set95thPercentileLatency(value / 1000000); break; case "99thPercentileLatency(us)": - result.add99thPercentileLatency(value); + result.set99thPercentileLatency(value / 1000000); break; case "999thPercentileLatency(us)": - result.add999thPercentileLatency(value); + result.set999thPercentileLatency(value / 1000000); break; case "9999thPercentileLatency(us)": - result.add9999thPercentileLatency(value); + result.set9999thPercentileLatency(value / 1000000); break; } } diff --git a/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/CsvTimeSeriesExporter.java b/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/CsvTimeSeriesExporter.java new file mode 100644 index 00000000..4bff035e --- /dev/null +++ b/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/CsvTimeSeriesExporter.java @@ -0,0 +1,65 @@ +package de.hhu.bsinfo.hadronio.example.grpc.kvs.ycsb; + +import site.ycsb.measurements.exporter.MeasurementsExporter; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.OutputStream; + +public class CsvTimeSeriesExporter implements MeasurementsExporter { + + final FileWriter writer; + + public CsvTimeSeriesExporter(final OutputStream outputStream) { + final var fileName = CsvHistogramExporter.resultFileName == null ? "result.csv" : CsvHistogramExporter.resultFileName; + final var file = new File(fileName); + + try { + if (file.exists()) { + writer = new FileWriter(fileName, true); + } else { + if (!file.createNewFile()) { + throw new IOException("Unable to create file '" + fileName + "'"); + } + + writer = new FileWriter(fileName, false); + } + + writer.append("Metric,Count,Latency\n"); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + @Override + public void write(final String metric, final String measurement, final int i) throws IOException { + write(metric, measurement, String.valueOf(i)); + } + + @Override + public void write(final String metric, final String measurement, final long l) throws IOException { + write(metric, measurement, String.valueOf(l)); + } + + @Override + public void write(final String metric, final String measurement, final double d) throws IOException { + write(metric, measurement, String.valueOf(d)); + } + + private void write(final String metric, final String measurement, final String value) throws IOException { + if (!metric.equals("READ") && !metric.equals("UPDATE") && !metric.equals("INSERT")) { + return; + } + + writer.append(metric).append(",") + .append(measurement).append(",") + .append(value).append("\n"); + } + + @Override + public void close() throws IOException { + writer.flush(); + writer.close(); + } +} diff --git a/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/LoggingExporter.java b/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/LoggingExporter.java index 9ab032ff..bf0632f9 100644 --- a/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/LoggingExporter.java +++ b/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/LoggingExporter.java @@ -9,11 +9,14 @@ public class LoggingExporter implements MeasurementsExporter { + private static final Logger LOGGER = LoggerFactory.getLogger(LoggingExporter.class.getCanonicalName().replace(LoggingExporter.class.getSimpleName(), "YCSB")); + private static final int METRIC_LENGTH = 35; private static final int MEASUREMENT_LENGTH = 23; private static final int VALUE_LENGTH = 15; - private static final Logger LOGGER = LoggerFactory.getLogger(LoggingExporter.class.getCanonicalName().replace(LoggingExporter.class.getSimpleName(), "YCSB")); + private long runTime; + private double throughput; public LoggingExporter(final OutputStream outputStream) { write("Metric", "Measurement", "Value"); @@ -28,19 +31,34 @@ public void write(final String metric, final String measurement, final int i) th @Override public void write(final String metric, final String measurement, final long l) throws IOException { + if (measurement.startsWith("RunTime")) { + runTime = l - YcsbBinding.getInitTime(); + write(metric, "InitTime(ms)", YcsbBinding.getInitTime()); + } + final var value = formatUnit(measurement, String.valueOf(l)); write(metric, measurement, value); } @Override public void write(final String metric, final String measurement, final double d) throws IOException { - final var value = formatUnit(measurement, String.format("%.03f", d)); - write(metric, measurement, value); + if (YcsbProperties.phase == YcsbRunner.Phase.RUN && measurement.startsWith("Throughput")) { + throughput = YcsbBinding.getOperationCount() / (runTime / 1000.0); + final var value = formatUnit(measurement, String.format("%.03f", throughput)); + write(metric, measurement, value); + } else { + final var value = formatUnit(measurement, String.format("%.03f", d)); + write(metric, measurement, value); + } } @Override public void close() throws IOException {} + public double getThroughput() { + return throughput; + } + private static String formatUnit(final String measurement, final String value) { if (measurement.contains("(")) { var unit = measurement.substring(measurement.indexOf('(') + 1, measurement.indexOf(')')); diff --git a/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/YcsbBinding.java b/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/YcsbBinding.java index da4c07aa..128a8c44 100644 --- a/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/YcsbBinding.java +++ b/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/YcsbBinding.java @@ -1,13 +1,11 @@ package de.hhu.bsinfo.hadronio.example.grpc.kvs.ycsb; import de.hhu.bsinfo.hadronio.example.grpc.kvs.Client; -import io.grpc.StatusRuntimeException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import site.ycsb.*; - -import java.net.InetSocketAddress; import java.util.*; +import java.util.concurrent.atomic.AtomicLong; public class YcsbBinding extends DB { @@ -15,21 +13,39 @@ public class YcsbBinding extends DB { private static final String NAMESPACE_SEPARATOR = "."; + private static AtomicLong firstInitStartTime = new AtomicLong(0); + private static AtomicLong lastInitFinishedTime = new AtomicLong(0); + private static AtomicLong operationCount = new AtomicLong(0); + private final Client client = new Client(); private YcsbProperties properties; private YcsbObject reusableObject; + public static long getInitTime() { + return lastInitFinishedTime.get() - firstInitStartTime.get(); + } + + public static long getOperationCount() { + return operationCount.get(); + } + @Override public void init() { + firstInitStartTime.compareAndSet(0, System.currentTimeMillis()); + LOGGER.info("Initializing YCSB client"); properties = new YcsbProperties(getProperties()); reusableObject = new YcsbObject(properties.getFieldsPerKey(), properties.getFieldSize()); client.connect(properties.getRemoteAddresses()); + operationCount.compareAndSet(0, properties.getOperationCount()); + CsvHistogramExporter.recordSize = properties.getFieldLength(); if (YcsbProperties.phase == YcsbRunner.Phase.RUN) { client.startBenchmark(); } + + lastInitFinishedTime.set(System.currentTimeMillis()); } @Override @@ -90,6 +106,7 @@ public Status scan(String table, String startKey, int recordCount, Set f @Override public void cleanup() { LOGGER.info("Cleaning up YCSB client"); + if (YcsbProperties.phase == YcsbRunner.Phase.RUN) { client.endBenchmark(); } diff --git a/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/YcsbProperties.java b/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/YcsbProperties.java index b4b70734..78f4c99a 100644 --- a/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/YcsbProperties.java +++ b/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/YcsbProperties.java @@ -1,6 +1,7 @@ package de.hhu.bsinfo.hadronio.example.grpc.kvs.ycsb; import de.hhu.bsinfo.hadronio.util.InetSocketAddressConverter; +import site.ycsb.Client; import site.ycsb.workloads.CoreWorkload; import java.net.InetSocketAddress; @@ -13,6 +14,8 @@ public class YcsbProperties { private final int fieldsPerKey; private final int fieldSize; + private final int operationCount; + private final int fieldLength; private final InetSocketAddress[] remoteAddresses; static YcsbRunner.Phase phase; static AtomicInteger closeConnectionCounter; @@ -20,6 +23,8 @@ public class YcsbProperties { YcsbProperties(final Properties properties) { fieldsPerKey = Integer.parseInt(properties.getProperty(CoreWorkload.FIELD_COUNT_PROPERTY, CoreWorkload.FIELD_COUNT_PROPERTY_DEFAULT)); fieldSize = Integer.parseInt(properties.getProperty(CoreWorkload.FIELD_LENGTH_PROPERTY, CoreWorkload.FIELD_LENGTH_PROPERTY_DEFAULT)); + operationCount = Integer.parseInt(properties.getProperty(Client.OPERATION_COUNT_PROPERTY, "0")); + fieldLength = Integer.parseInt(properties.getProperty(CoreWorkload.FIELD_LENGTH_PROPERTY, CoreWorkload.FIELD_COUNT_PROPERTY_DEFAULT)); final var addresses = properties.getProperty(REMOTE_ADDRESSES_PROPERTY); final var splitAddresses = addresses.split(","); @@ -39,6 +44,14 @@ public int getFieldSize() { return fieldSize; } + public int getOperationCount() { + return operationCount; + } + + public int getFieldLength() { + return fieldLength; + } + public InetSocketAddress[] getRemoteAddresses() { return remoteAddresses; } diff --git a/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/YcsbResult.java b/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/YcsbResult.java index faca2006..b2148080 100644 --- a/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/YcsbResult.java +++ b/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/YcsbResult.java @@ -8,14 +8,14 @@ public class YcsbResult { private long recordSize; private double operationThroughput; - private final List averageLatencies = new ArrayList<>(); - private final List minimumLatencies = new ArrayList<>(); - private final List maximumLatencies = new ArrayList<>(); - private final List percentile50thLatencies = new ArrayList<>(); - private final List percentile95thLatencies = new ArrayList<>(); - private final List percentile99thLatencies = new ArrayList<>(); - private final List percentile999thLatencies = new ArrayList<>(); - private final List percentile9999thLatencies = new ArrayList<>(); + private double averagelatency; + private double minimumlatency; + private double maximumlatency; + private double percentile50thlatency; + private double percentile95thlatency; + private double percentile99thlatency; + private double percentile999thlatency; + private double percentile9999thlatency; void setRecordSize(final long recordSize) { this.recordSize = recordSize; @@ -25,36 +25,36 @@ void setOperationThroughput(final double operationThroughput) { this.operationThroughput = operationThroughput; } - void addAverageLatency(final double latency) { - averageLatencies.add(latency); + void setAverageLatency(final double latency) { + averagelatency = latency; } - void addMinimumLatency(final double latency) { - minimumLatencies.add(latency); + void setMinimumLatency(final double latency) { + minimumlatency = latency; } - void addMaximumLatency(final double latency) { - maximumLatencies.add(latency); + void setMaximumLatency(final double latency) { + maximumlatency = latency; } - void add50thPercentileLatency(final double latency) { - percentile50thLatencies.add(latency); + void set50thPercentileLatency(final double latency) { + percentile50thlatency = latency; } - void add95thPercentileLatency(final double latency) { - percentile95thLatencies.add(latency); + void set95thPercentileLatency(final double latency) { + percentile95thlatency = latency; } - void add99thPercentileLatency(final double latency) { - percentile99thLatencies.add(latency); + void set99thPercentileLatency(final double latency) { + percentile99thlatency = latency; } - void add999thPercentileLatency(final double latency) { - percentile999thLatencies.add(latency); + void set999thPercentileLatency(final double latency) { + percentile999thlatency = latency; } - void add9999thPercentileLatency(final double latency) { - percentile9999thLatencies.add(latency); + void set9999thPercentileLatency(final double latency) { + percentile9999thlatency = latency; } void write(final String fileName, final String benchmarkName, final int iteration, final int connections) throws IOException { @@ -77,20 +77,16 @@ void write(final String fileName, final String benchmarkName, final int iteratio .append(String.valueOf(connections)).append(",") .append(String.valueOf(recordSize)).append(",") .append(String.valueOf(operationThroughput)).append(",") - .append(String.valueOf(calculateAverage(averageLatencies))).append(",") - .append(String.valueOf(calculateAverage(minimumLatencies))).append(",") - .append(String.valueOf(calculateAverage(maximumLatencies))).append(",") - .append(String.valueOf(calculateAverage(percentile50thLatencies))).append(",") - .append(String.valueOf(calculateAverage(percentile95thLatencies))).append(",") - .append(String.valueOf(calculateAverage(percentile99thLatencies))).append(",") - .append(String.valueOf(calculateAverage(percentile999thLatencies))).append(",") - .append(String.valueOf(calculateAverage(percentile9999thLatencies))).append("\n"); + .append(String.valueOf(averagelatency)).append(",") + .append(String.valueOf(minimumlatency)).append(",") + .append(String.valueOf(maximumlatency)).append(",") + .append(String.valueOf(percentile50thlatency)).append(",") + .append(String.valueOf(percentile95thlatency)).append(",") + .append(String.valueOf(percentile99thlatency)).append(",") + .append(String.valueOf(percentile999thlatency)).append(",") + .append(String.valueOf(percentile9999thlatency)).append("\n"); writer.flush(); writer.close(); } - - private double calculateAverage(final List values) { - return values.stream().mapToDouble((value) -> value).summaryStatistics().getAverage() / 1000000; - } } diff --git a/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/YcsbRunner.java b/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/YcsbRunner.java index f978f5b1..d5915685 100644 --- a/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/YcsbRunner.java +++ b/example/src/main/java/de/hhu/bsinfo/hadronio/example/grpc/kvs/ycsb/YcsbRunner.java @@ -1,6 +1,7 @@ package de.hhu.bsinfo.hadronio.example.grpc.kvs.ycsb; import site.ycsb.Client; +import site.ycsb.measurements.Measurements; import java.net.InetSocketAddress; import java.nio.file.Path; @@ -15,6 +16,7 @@ public class YcsbRunner implements Runnable { private final InetSocketAddress[] remoteAddresses; private final Path properties; private final Phase phase; + private final Measurements.MeasurementType measurementType; private final int threads; private final boolean status; private final String resultFileName; @@ -27,11 +29,12 @@ public enum Phase { RUN } - public YcsbRunner(final InetSocketAddress[] remoteAddresses, final Path workload, final Phase phase, final int threads, final boolean status, final String resultFileName, final String benchmarkName, final int benchmarkIteration, final int recordSize) { + public YcsbRunner(final InetSocketAddress[] remoteAddresses, final Path workload, final Phase phase, final Measurements.MeasurementType measurementType, final int threads, final boolean status, final String resultFileName, final String benchmarkName, final int benchmarkIteration, final int recordSize) { this.remoteAddresses = remoteAddresses; this.properties = workload; this.resultFileName = resultFileName; this.phase = phase; + this.measurementType = measurementType; this.threads = threads; this.status = status; this.benchmarkName = benchmarkName; @@ -44,6 +47,7 @@ public YcsbRunner(final InetSocketAddress[] remoteAddresses, final Path workload @Override public void run() { Client.main(generateParameters(phase)); + } private String[] generateParameters(final Phase phase) { @@ -61,23 +65,24 @@ private String[] generateParameters(final Phase phase) { // Set result format parameters.add("-p"); - parameters.add("measurementtype=hdrhistogram"); + parameters.add("measurementtype=" + measurementType.toString().toLowerCase()); parameters.add("-p"); parameters.add("hdrhistogram.percentiles=50,95,99,999,9999"); + parameters.add("-p"); + parameters.add("timeseries.granularity=1"); // Set exporter and output file if (resultFileName.isEmpty()) { parameters.add("-p"); parameters.add(String.format("exporter=%s", LoggingExporter.class.getCanonicalName())); } else { - CsvExporter.benchmarkName = benchmarkName; - CsvExporter.iteration = benchmarkIteration; - CsvExporter.connections = threads; - CsvExporter.recordSize = recordSize; - CsvExporter.resultFileName = resultFileName; + CsvHistogramExporter.benchmarkName = benchmarkName; + CsvHistogramExporter.iteration = benchmarkIteration; + CsvHistogramExporter.connections = threads; + CsvHistogramExporter.resultFileName = resultFileName; parameters.add("-p"); - parameters.add(String.format("exporter=%s", CsvExporter.class.getCanonicalName())); + parameters.add(String.format("exporter=%s", measurementType == Measurements.MeasurementType.TIMESERIES ? CsvTimeSeriesExporter.class.getCanonicalName() : CsvHistogramExporter.class.getCanonicalName())); } // Set properties file diff --git a/example/src/main/proto/kvs.proto b/example/src/main/proto/kvs.proto index 30c5e5a1..806ca119 100644 --- a/example/src/main/proto/kvs.proto +++ b/example/src/main/proto/kvs.proto @@ -17,6 +17,7 @@ service KeyValueStore { rpc connect (google.protobuf.Empty) returns (ClientIdMessage) {} rpc startBenchmark (ClientIdMessage) returns (StartBenchmarkMessage) {} rpc endBenchmark (ClientIdMessage) returns (google.protobuf.Empty) {} + rpc isBenchmarkFinished (google.protobuf.Empty) returns (BenchmarkFinishedMessage) {} } message KeyValueRequest { @@ -43,4 +44,8 @@ message ClientIdMessage { message StartBenchmarkMessage { bool start = 1; +} + +message BenchmarkFinishedMessage { + bool finished = 1; } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index c1962a79..d64cd491 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 37aef8d3..a80b22ce 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index aeb74cbb..1aa94a42 100755 --- a/gradlew +++ b/gradlew @@ -83,7 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -130,10 +131,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -141,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -149,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -198,11 +202,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/gradlew.bat b/gradlew.bat index 6689b85b..7101f8e4 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/infinileap-binding/src/main/java/de/hhu/bsinfo/hadronio/infinileap/InfinileapEndpoint.java b/infinileap-binding/src/main/java/de/hhu/bsinfo/hadronio/infinileap/InfinileapEndpoint.java index ecec160e..ecaa53b3 100644 --- a/infinileap-binding/src/main/java/de/hhu/bsinfo/hadronio/infinileap/InfinileapEndpoint.java +++ b/infinileap-binding/src/main/java/de/hhu/bsinfo/hadronio/infinileap/InfinileapEndpoint.java @@ -58,7 +58,7 @@ class InfinileapEndpoint implements UcxEndpoint { handleError(); })); - LOGGER.info("Endpoint created"); + if (DebugConfig.DEBUG) LOGGER.debug("Endpoint created"); } @Override @@ -75,7 +75,7 @@ public void connect(final InetSocketAddress remoteAddress) throws IOException { throw new IOException(e); } - LOGGER.info("Endpoint created"); + if (DebugConfig.DEBUG) LOGGER.debug("Endpoint created"); } @Override @@ -185,7 +185,7 @@ public UcxWorker getWorker() { @Override public void close() { - LOGGER.info("Closing endpoint"); + if (DebugConfig.DEBUG) LOGGER.debug("Closing endpoint"); if (endpoint != null) { endpoint.close(); } diff --git a/infinileap-binding/src/main/java/de/hhu/bsinfo/hadronio/infinileap/InfinileapWorker.java b/infinileap-binding/src/main/java/de/hhu/bsinfo/hadronio/infinileap/InfinileapWorker.java index 70f9fed5..be9e57ed 100644 --- a/infinileap-binding/src/main/java/de/hhu/bsinfo/hadronio/infinileap/InfinileapWorker.java +++ b/infinileap-binding/src/main/java/de/hhu/bsinfo/hadronio/infinileap/InfinileapWorker.java @@ -1,6 +1,7 @@ package de.hhu.bsinfo.hadronio.infinileap; import de.hhu.bsinfo.hadronio.binding.UcxWorker; +import de.hhu.bsinfo.hadronio.generated.DebugConfig; import de.hhu.bsinfo.infinileap.binding.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -50,7 +51,7 @@ public int getEventFileDescriptor() { @Override public void close() { - LOGGER.info("Closing worker"); + if (DebugConfig.DEBUG) LOGGER.debug("Closing worker"); worker.close(); } } diff --git a/jucx-binding/jucx-1.14.jar b/jucx-binding/jucx-1.14.1.jar similarity index 95% rename from jucx-binding/jucx-1.14.jar rename to jucx-binding/jucx-1.14.1.jar index bc0dd83c..f8e96fe1 100644 Binary files a/jucx-binding/jucx-1.14.jar and b/jucx-binding/jucx-1.14.1.jar differ diff --git a/provider/src/main/java/de/hhu/bsinfo/hadronio/HadronioProvider.java b/provider/src/main/java/de/hhu/bsinfo/hadronio/HadronioProvider.java index 57aed5ee..9420a37a 100644 --- a/provider/src/main/java/de/hhu/bsinfo/hadronio/HadronioProvider.java +++ b/provider/src/main/java/de/hhu/bsinfo/hadronio/HadronioProvider.java @@ -2,6 +2,7 @@ import de.hhu.bsinfo.hadronio.binding.UcxProvider; import de.hhu.bsinfo.hadronio.generated.BuildConfig; +import de.hhu.bsinfo.hadronio.generated.DebugConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -57,14 +58,14 @@ public AbstractSelector openSelector() throws IOException { @Override public ServerSocketChannel openServerSocketChannel() throws IOException { - LOGGER.info("Creating new HadronioServerSocketChannel"); + if (DebugConfig.DEBUG) LOGGER.debug("Creating new HadronioServerSocketChannel"); final var listener = provider.createListener(); return new HadronioServerSocketChannel(this, listener); } @Override public SocketChannel openSocketChannel() throws IOException { - LOGGER.info("Creating new HadronioSocketChannel"); + if (DebugConfig.DEBUG) LOGGER.debug("Creating new HadronioSocketChannel"); final var endpoint = provider.createEndpoint(); return new HadronioSocketChannel(this, endpoint); } diff --git a/settings.gradle b/settings.gradle index e2917988..a929ca65 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,6 +2,6 @@ rootProject.name = 'hadronio' include 'core' include 'provider' -include 'infinileap-binding' +// include 'infinileap-binding' include 'jucx-binding' include 'example'