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

Update spotless from 5.14.3 to 6.11.0 #1050

Merged
merged 1 commit into from
Oct 31, 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
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ static Builder builder() {
*/
TableCreator tableCreator();

/** @param name to delete */
/**
* @param name to delete
*/
void deleteTable(String name);

@Override
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/org/astraea/app/database/TableQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public interface TableQuery {
*/
TableQuery tableName(String tableName);

/** @return the tables matched to this query. */
/**
* @return the tables matched to this query.
*/
Collection<TableInfo> run();
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ public interface AbstractThread extends Closeable {
/** wait this thread to be completed. */
void waitForDone();

/** @return true if this thread is done */
/**
* @return true if this thread is done
*/
boolean closed();

/** wakeup and then wait this thread to complete */
Expand Down
20 changes: 15 additions & 5 deletions app/src/main/java/org/astraea/app/performance/DataSupplier.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,21 +98,31 @@ public byte[] value() {

interface Data {

/** @return true if there is no data. */
/**
* @return true if there is no data.
*/
boolean done();

/** @return true if there are some data, but it is throttled now. */
/**
* @return true if there are some data, but it is throttled now.
*/
boolean throttled();

/** @return true if there is accessible data */
/**
* @return true if there is accessible data
*/
default boolean hasData() {
return !done() && !throttled();
}

/** @return key or throw exception if there is no data, or it is throttled now */
/**
* @return key or throw exception if there is no data, or it is throttled now
*/
byte[] key();

/** @return value or throw exception if there is no data, or it is throttled now */
/**
* @return value or throw exception if there is no data, or it is throttled now
*/
byte[] value();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,9 @@ Producer<byte[], byte[]> createProducer() {
converter = TopicPartitionField.class)
List<TopicPartition> specifyPartitions = List.of();

/** @return a supplier that randomly return a sending target */
/**
* @return a supplier that randomly return a sending target
*/
Supplier<TopicPartition> topicPartitionSelector() {
var specifiedByBroker = !specifyBrokers.isEmpty();
var specifiedByPartition = !specifyPartitions.isEmpty();
Expand Down
16 changes: 12 additions & 4 deletions app/src/main/java/org/astraea/app/performance/Report.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,23 @@ public String clientId() {
.collect(Collectors.toList());
}

/** @return Get the number of records. */
/**
* @return Get the number of records.
*/
long records();
/** @return Get the maximum of latency put. */
/**
* @return Get the maximum of latency put.
*/
long maxLatency();

/** @return Get the average latency. */
/**
* @return Get the average latency.
*/
double avgLatency();

/** @return total send/received bytes */
/**
* @return total send/received bytes
*/
long totalBytes();

double avgThroughput();
Expand Down
16 changes: 12 additions & 4 deletions app/src/main/java/org/astraea/app/web/Channel.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,16 +222,24 @@ static Channel of(HttpExchange exchange) {
.build();
}

/** @return the type of HTTP method */
/**
* @return the type of HTTP method
*/
Type type();

/** @return the target from URL. The form is /{type}/target */
/**
* @return the target from URL. The form is /{type}/target
*/
Optional<String> target();

/** @return body request */
/**
* @return body request
*/
PostRequest request();

/** @return the queries appended to URL */
/**
* @return the queries appended to URL
*/
Map<String, String> queries();

/**
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/org/astraea/app/web/PostRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ static PostRequest of(Map<String, Object> objs) {
return () -> raw;
}

/** @return body represented by key-value */
/**
* @return body represented by key-value
*/
Map<String, String> raw();

/**
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/org/astraea/app/web/Response.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ private static int code(Throwable exception) {
return 400;
}

/** @return http code */
/**
* @return http code
*/
default int code() {
return 200;
}
Expand Down
6 changes: 5 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
* limitations under the License.
*/
plugins {
id "com.diffplug.spotless" version "5.14.3"
id "com.diffplug.spotless" version "6.11.0"
}

repositories {
mavenCentral()
}

spotless {
Expand Down
4 changes: 3 additions & 1 deletion common/src/main/java/org/astraea/common/DataRate.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ public double byteRate() {
return toBigDecimal(DataUnit.Byte, ChronoUnit.SECONDS).doubleValue();
}

/** @return the data rate per second as a {@link DataSize}. */
/**
* @return the data rate per second as a {@link DataSize}.
*/
public DataSize dataSize() {
var bitsPerSecond = toBigDecimal(DataUnit.Bit, ChronoUnit.SECONDS).toBigInteger();
return new DataSize(bitsPerSecond);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ public ExecutionRuntimeException(ExecutionException executionException) {
this.executionException = executionException;
}

/** @return the root cause of ExecutionException */
/**
* @return the root cause of ExecutionException
*/
public Throwable getRootCause() {
return executionException.getCause();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,13 @@ public long leaderSize() {

String path();

/** @return current data size of this adding replica */
/**
* @return current data size of this adding replica
*/
long size();

/** @return size (of topic partition leader) to sync */
/**
* @return size (of topic partition leader) to sync
*/
long leaderSize();
}
28 changes: 21 additions & 7 deletions common/src/main/java/org/astraea/common/admin/Admin.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ static Admin of(Map<String, String> configs) {
// ---------------------------------[internal]---------------------------------//
String clientId();

/** @return the number of pending requests. */
/**
* @return the number of pending requests.
*/
int runningRequests();

// ---------------------------------[readonly]---------------------------------//
Expand All @@ -58,7 +60,9 @@ static Admin of(Map<String, String> configs) {
*/
CompletionStage<Set<String>> topicNames(boolean listInternal);

/** @return names of internal topics */
/**
* @return names of internal topics
*/
CompletionStage<Set<String>> internalTopicNames();

CompletionStage<List<Topic>> topics(Set<String> topics);
Expand Down Expand Up @@ -128,10 +132,14 @@ default CompletionStage<Map<TopicPartition, Long>> timestampOfLatestRecords(

CompletionStage<List<Partition>> partitions(Set<String> topics);

/** @return online node information */
/**
* @return online node information
*/
CompletionStage<Set<NodeInfo>> nodeInfos();

/** @return online broker information */
/**
* @return online broker information
*/
CompletionStage<List<Broker>> brokers();

default CompletionStage<Map<Integer, Set<String>>> brokerFolders() {
Expand Down Expand Up @@ -257,7 +265,9 @@ default CompletionStage<Set<String>> idleTopic(List<TopicChecker> checkers) {
*/
CompletionStage<Void> unsetConsumerQuotas(Set<String> clientIds);

/** @return a topic creator to set all topic configs and then run the procedure. */
/**
* @return a topic creator to set all topic configs and then run the procedure.
*/
TopicCreator creator();

CompletionStage<Void> moveToBrokers(Map<TopicPartition, List<Integer>> assignments);
Expand All @@ -280,7 +290,9 @@ default CompletionStage<Set<String>> idleTopic(List<TopicChecker> checkers) {
*/
CompletionStage<Void> addPartitions(String topic, int total);

/** @param override defines the key and new value. The other undefined keys won't get changed. */
/**
* @param override defines the key and new value. The other undefined keys won't get changed.
*/
CompletionStage<Void> setTopicConfigs(Map<String, Map<String, String>> override);

/**
Expand All @@ -303,7 +315,9 @@ default CompletionStage<Set<String>> idleTopic(List<TopicChecker> checkers) {
*/
CompletionStage<Void> unsetTopicConfigs(Map<String, Set<String>> unset);

/** @param override defines the key and new value. The other undefined keys won't get changed. */
/**
* @param override defines the key and new value. The other undefined keys won't get changed.
*/
CompletionStage<Void> setBrokerConfigs(Map<Integer, Map<String, String>> override);

/**
Expand Down
24 changes: 18 additions & 6 deletions common/src/main/java/org/astraea/common/admin/Broker.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,26 +133,38 @@ public Set<TopicPartition> topicPartitionLeaders() {

boolean isController();

/** @return config used by this node */
/**
* @return config used by this node
*/
Config config();

/** @return the disk folder used to stored data by this node */
/**
* @return the disk folder used to stored data by this node
*/
List<DataFolder> dataFolders();

Set<TopicPartition> topicPartitions();

/** @return partition leaders hosted by this broker */
/**
* @return partition leaders hosted by this broker
*/
Set<TopicPartition> topicPartitionLeaders();

interface DataFolder {

/** @return the path on the local disk */
/**
* @return the path on the local disk
*/
String path();

/** @return topic partition hosed by this node and size of files */
/**
* @return topic partition hosed by this node and size of files
*/
Map<TopicPartition, Long> partitionSizes();

/** @return topic partition located by this node but not traced by cluster */
/**
* @return topic partition located by this node but not traced by cluster
*/
Map<TopicPartition, Long> orphanPartitionSizes();
}
}
12 changes: 9 additions & 3 deletions common/src/main/java/org/astraea/common/admin/ClusterInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,9 @@ default List<T> availableReplicas(String topic) {

// ---------------------[for replicas]---------------------//

/** @return all replicas cached by this cluster info. */
/**
* @return all replicas cached by this cluster info.
*/
default List<T> replicas() {
return replicaStream().collect(Collectors.toUnmodifiableList());
}
Expand Down Expand Up @@ -410,10 +412,14 @@ default Stream<T> replicaStream(TopicPartitionReplica replica) {

// ---------------------[abstract methods]---------------------//

/** @return The known set of nodes */
/**
* @return The known set of nodes
*/
Set<NodeInfo> nodes();

/** @return replica stream to offer effective way to operate a bunch of replicas */
/**
* @return replica stream to offer effective way to operate a bunch of replicas
*/
Stream<T> replicaStream();

/** It optimizes all queries by pre-allocated Map collection. */
Expand Down
16 changes: 12 additions & 4 deletions common/src/main/java/org/astraea/common/admin/NodeInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,24 @@ public boolean equals(Object other) {
};
}

/** @return The host name for this node */
/**
* @return The host name for this node
*/
String host();

/** @return The client (kafka data, jmx, etc.) port for this node */
/**
* @return The client (kafka data, jmx, etc.) port for this node
*/
int port();

/** @return id of broker node. it must be unique. */
/**
* @return id of broker node. it must be unique.
*/
int id();

/** @return true if the node is offline. An offline node can't offer host or port information. */
/**
* @return true if the node is offline. An offline node can't offer host or port information.
*/
default boolean offline() {
return host() == null || host().isEmpty() || port() < 0;
}
Expand Down
Loading