Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing Perl Javadoc warnings. #331

Merged
merged 1 commit into from
Mar 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions perl/src/main/java/io/perl/api/Channel.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
*/
package io.perl.api;

/**
* Interface Channel.
*/
public non-sealed interface Channel extends GetPerlChannel {

/**
Expand Down
3 changes: 3 additions & 0 deletions perl/src/main/java/io/perl/api/GetPerlChannel.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

package io.perl.api;

/**
* Interface GetPerlChannel.
*/
public sealed interface GetPerlChannel permits Channel, Perl {

/**
Expand Down
53 changes: 53 additions & 0 deletions perl/src/main/java/io/perl/api/LatencyPercentiles.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,56 @@
*/
package io.perl.api;

/**
* Class LatencyPercentiles.
*/
final public class LatencyPercentiles {

/**
* <code>public double[] fractions</code>.
*/
final public double[] fractions;

/**
* <code>public long[] latencies</code>.
*/
final public long[] latencies;

/**
* <code>public long[] latencyIndexes</code>.
*/
final public long[] latencyIndexes;

/**
* <code>public long[] latencyCount</code>.
*/
final public long[] latencyCount;

/**
* <code>long medianLatency</code>.
*/
public long medianLatency;

/**
* <code>long medianLatencyCount</code>.
*/
public long medianLatencyCount;

/**
* <code>long medianIndex</code>.
*/
public long medianIndex;

/**
* <code>int index</code>.
*/
private int index;

/**
* Constructor LatencyPercentiles initializing all values.
*
* @param percentileFractions double[]
*/
public LatencyPercentiles(double[] percentileFractions) {
this.fractions = percentileFractions;
this.latencies = new long[this.fractions.length];
Expand All @@ -30,6 +70,11 @@ public LatencyPercentiles(double[] percentileFractions) {
this.index = 0;
}

/**
* This method reset all records.
*
* @param totalRecords long
*/
public void reset(long totalRecords) {
for (int i = 0; i < fractions.length; i++) {
latencyIndexes[i] = (long) (totalRecords * fractions[i]);
Expand All @@ -42,6 +87,14 @@ public void reset(long totalRecords) {
index = 0;
}

/**
* This method copy Latency.
*
* @param latency long
* @param count long
* @param startIndex long
* @param endIndex long
*/
public void copyLatency(long latency, long count, long startIndex, long endIndex) {
if (medianIndex >= startIndex && medianIndex < endIndex) {
medianLatency = latency;
Expand Down
38 changes: 38 additions & 0 deletions perl/src/main/java/io/perl/api/LatencyRecord.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,63 @@
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;

/**
* Sealed Class LatencyRecord.
*/
@Slf4j
abstract public sealed class LatencyRecord permits LatencyRecorder {

/**
* <code>long totalRecords</code>.
*/
@Getter
protected long totalRecords;

/**
* <code>long validLatencyRecords</code>.
*/
@Getter
protected long validLatencyRecords;

/**
* <code>lowerLatencyDiscardRecords</code>.
*/
@Getter
protected long lowerLatencyDiscardRecords;

/**
* <code>long higherLatencyDiscardRecords</code>.
*/
@Getter
protected long higherLatencyDiscardRecords;

/**
* <code>long invalidLatencyRecords</code>.
*/
@Getter
protected long invalidLatencyRecords;

/**
* <code>long totalBytes</code>.
*/
@Getter
protected long totalBytes;

/**
* <code>long totalLatency</code>.
*/
@Getter
protected long totalLatency;

/**
* <code>long maxLatency</code>.
*/
@Getter
protected long maxLatency;

/**
* Method to reset all recording variables.
*/
public LatencyRecord() {
reset();
}
Expand Down
14 changes: 14 additions & 0 deletions perl/src/main/java/io/perl/api/LatencyRecordWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,23 @@
import javax.annotation.concurrent.NotThreadSafe;


/**
* non-sealed Class LatencyRecordWindow.
*/
@NotThreadSafe
public abstract non-sealed class LatencyRecordWindow extends LatencyWindow implements ReportLatency, ReportLatencies {

/**
* Constructor LatencyRecordWindow passing all latencies to it's super class LatencyWindow.
*
* @param lowLatency long
* @param highLatency long
* @param totalLatencyMax long
* @param totalRecordsMax long
* @param bytesMax long
* @param percentilesFractions double[]
* @param time Time
*/
public LatencyRecordWindow(long lowLatency, long highLatency, long totalLatencyMax, long totalRecordsMax,
long bytesMax, double[] percentilesFractions, Time time) {
super(lowLatency, highLatency, totalLatencyMax, totalRecordsMax, bytesMax, percentilesFractions, time);
Expand Down
24 changes: 24 additions & 0 deletions perl/src/main/java/io/perl/api/LatencyRecorder.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,36 @@
*/
@NotThreadSafe
public sealed class LatencyRecorder extends LatencyRecord permits LatencyWindow {
/**
* <code>long lowLatency</code>.
*/
final protected long lowLatency;
/**
* <code>long highLatency</code>.
*/
final protected long highLatency;
/**
* <code>long totalLatencyMax</code>.
*/
final protected long totalLatencyMax;
/**
* <code>long totalRecordsMax</code>.
*/
final protected long totalRecordsMax;
/**
* <code>long totalBytesMax</code>.
*/
final protected long totalBytesMax;

/**
* Constructor LatencyRecorder initializing all values.
*
* @param baseLatency long
* @param latencyThreshold long
* @param totalLatencyMax long
* @param totalRecordsMax long
* @param totalBytesMax long
*/
public LatencyRecorder(long baseLatency, long latencyThreshold, long totalLatencyMax, long totalRecordsMax, long totalBytesMax) {
super();
this.lowLatency = baseLatency;
Expand Down
26 changes: 26 additions & 0 deletions perl/src/main/java/io/perl/api/LatencyWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,39 @@
import io.time.Time;
import org.jetbrains.annotations.NotNull;

/**
* Sealed Class LatencyWindow.
*/
abstract public sealed class LatencyWindow extends LatencyRecorder permits LatencyRecordWindow {
/**
* <code>LatencyPercentiles percentiles</code>.
*/
final protected LatencyPercentiles percentiles;
/**
* <code>Time time</code>.
*/
final protected Time time;
/**
* <code>long[] slc</code>.
*/
final private long[] slc;
/**
* <code>long startTime</code>.
*/
private long startTime;


/**
* Constructor LatencyWindow to initialize values and pass Latencies to it's super class.
*
* @param lowLatency long
* @param highLatency long
* @param totalLatencyMax long
* @param totalRecordsMax long
* @param bytesMax long
* @param percentilesFractions double[]
* @param time Time
*/
public LatencyWindow(long lowLatency, long highLatency, long totalLatencyMax, long totalRecordsMax, long bytesMax,
double[] percentilesFractions, Time time) {
super(lowLatency, highLatency, totalLatencyMax, totalRecordsMax, bytesMax);
Expand Down
3 changes: 3 additions & 0 deletions perl/src/main/java/io/perl/api/ReportLatencies.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
package io.perl.api;


/**
* Interface ReportLatencies.
*/
public interface ReportLatencies {

/**
Expand Down
3 changes: 3 additions & 0 deletions perl/src/main/java/io/perl/api/ReportLatency.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
*/
package io.perl.api;

/**
* Interface ReportLatency.
*/
public interface ReportLatency {


Expand Down
38 changes: 38 additions & 0 deletions perl/src/main/java/io/perl/api/TimeStamp.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,64 @@
* class for time stamp including start, end time, bytes and records.
*/
final public class TimeStamp {

/**
* <code>long startTime</code>.
*/
final public long startTime;

/**
* <code>long endTime</code>.
*/
final public long endTime;

/**
* <code>int bytes</code>.
*/
final public int bytes;

/**
* <code>int records</code>.
*/
final public int records;

/**
* Constructor TimeStamp initialize all values.
*
* @param startTime long
* @param endTime long
* @param bytes int
* @param records int
*/
public TimeStamp(long startTime, long endTime, int bytes, int records) {
this.startTime = startTime;
this.endTime = endTime;
this.bytes = bytes;
this.records = records;
}

/**
* This Constructor TimeStamp with no arguments initialize all values with 0.
*/
public TimeStamp() {
this(0, 0, 0, 0);
}

/**
* This Constructor TimeStamp with just one argument, initialize {@link #startTime} = -1
* and {@link #endTime} according to the given parameters.
*
* @param endTime long
*/
public TimeStamp(long endTime) {
this(-1, endTime, 0, 0);
}

/**
* Checks if it is the end.
*
* @return true if {@link #startTime} == -1.
*/
public boolean isEnd() {
return this.startTime == -1;
}
Expand Down
11 changes: 11 additions & 0 deletions perl/src/main/java/io/perl/api/impl/ArrayLatencyRecorder.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ final public class ArrayLatencyRecorder extends LatencyRecordWindow {
private int minIndex;
private int maxIndex;

/**
* Constructor ArrayLatencyRecorder initialize all values.
*
* @param lowLatency long
* @param highLatency long
* @param totalLatencyMax long
* @param totalRecordsMax long
* @param bytesMax long
* @param percentiles double[]
* @param time Time
*/
public ArrayLatencyRecorder(long lowLatency, long highLatency, long totalLatencyMax, long totalRecordsMax,
long bytesMax, double[] percentiles, Time time) {
super(lowLatency, highLatency, totalLatencyMax, totalRecordsMax, bytesMax, percentiles, time);
Expand Down
11 changes: 10 additions & 1 deletion perl/src/main/java/io/perl/api/impl/CQueuePerl.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ final public class CQueuePerl implements Perl {
private CompletableFuture<Void> qFuture;


/**
* Constructor CQueuePerl initialize all values.
*
* @param perlConfig NotNull PerlConfig
* @param periodicRecorder PeriodicRecorder
* @param reportingIntervalMS int
* @param time Time
* @param executor ExecutorService
*/
public CQueuePerl(@NotNull PerlConfig perlConfig, PeriodicRecorder periodicRecorder,
int reportingIntervalMS, Time time, ExecutorService executor) {
int maxQs;
Expand Down Expand Up @@ -127,7 +136,7 @@ private void shutdown(Throwable ex) {
* @param secondsToRun Number of seconds to Run
* @param recordsCount If secondsToRun is 0, then this indicates the total number of records to benchmark or
* read/write. If secondsToRun is higher than 0, then this parameter is ignored.
* @return
* @return CompletableFuture retFuture.
*/
@Override
@Synchronized
Expand Down
Loading