Skip to content

Commit

Permalink
modify java doc/mvn repo sign
Browse files Browse the repository at this point in the history
  • Loading branch information
stone1100 committed Nov 7, 2022
1 parent 158d039 commit b291d2e
Show file tree
Hide file tree
Showing 15 changed files with 231 additions and 70 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ generate: ## generate proto code
mvn generate-sources

deploy: ## deploy to mvn repo
# install gpg https://docs.releng.linuxfoundation.org/en/latest/gpg.html
# https://central.sonatype.org/publish/requirements/gpg/#listing-keys
# export GPG_TTY=$(tty)
mvn clean deploy

update: ## update project/classpath
Expand Down
97 changes: 97 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,33 @@
<packaging>jar</packaging>

<name>LinDB Java Client SDK</name>
<description>
The reference JVM client for the LinDB.
</description>

<url>https://github.com/lindb/client_java</url>

<organization>
<name>LinDB</name>
<url>https://lindb.io</url>
</organization>

<developers>
<developer>
<name>stone1100</name>
<email>[email protected]</email>
<organization>LinDB</organization>
<organizationUrl>https://www.lindb.io</organizationUrl>
</developer>
<developer>
<name>CodingCrush</name>
<email>[email protected]</email>
<organization>LinDB</organization>
<organizationUrl>https://www.lindb.io</organizationUrl>
</developer>
</developers>


<licenses>
<license>
<name>Apache License, Version 2.0</name>
Expand Down Expand Up @@ -111,6 +132,37 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<excludePackageNames>
io.lindb.client.flat.metrics.*
</excludePackageNames>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
Expand Down Expand Up @@ -209,9 +261,54 @@
</licenseSets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<!-- GPG Signature on release -->
<profile>
<id>release-sign-artifacts</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/lindb/client/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public interface Client {
*
* @param database database name {@link String}
* @return write client {@link Write}
* @throws {{@link IOException}}
* @throws IOException if send data error
*/
Write write(String database) throws IOException;
}
13 changes: 7 additions & 6 deletions src/main/java/io/lindb/client/api/CompoundField.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ public class CompoundField implements Field {

/**
* Create a compound field instance.
* Notice: bounds length must be equals values length
*
* @param count {@link double}
* @param sum {@link double}
* @param min {@link double}
* @param max {@link double}
* @param bounds
* @param values
* @param count count value
* @param sum sum value
* @param min min value
* @param max max value
* @param bounds bound array
* @param values value array
*/
protected CompoundField(double count, double sum, double min, double max, double[] bounds, double[] values) {
this.count = count;
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/io/lindb/client/api/FieldType.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,25 @@
* Simple field type.
*/
public enum FieldType {
/**
* Last field type.
*/
Last(1),
/**
* Sum field type.
*/
Sum(2),
/**
* Min field type.
*/
Min(3),
/**
* Max field type.
*/
Max(4),
/**
* First field type.
*/
First(5);

private byte val;
Expand Down
50 changes: 26 additions & 24 deletions src/main/java/io/lindb/client/api/Point.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private Builder() {
/**
* Set the namespace of point.
*
* @param namespace
* @param namespace namespace of metric point
* @return builder
*/
public Builder namespace(String namespace) {
Expand All @@ -58,8 +58,8 @@ public Builder namespace(String namespace) {
/**
* Add tag key/value into the tags of point.
*
* @param key
* @param value
* @param key tag key
* @param value tag value
* @return builder
*/
public Builder addTag(String key, String value) {
Expand All @@ -78,7 +78,7 @@ public Builder addTag(String key, String value) {
/**
* Add tags into the tags of point.
*
* @param tags
* @param tags tags of metric point
* @return builder
*/
public Builder addTags(Map<String, String> tags) {
Expand All @@ -95,8 +95,8 @@ public Builder addTags(Map<String, String> tags) {
/**
* Add sum simple field with name and value.
*
* @param name
* @param value
* @param name field name
* @param value field value
* @return builder
*/
public Builder addSum(String name, double value) {
Expand All @@ -106,8 +106,8 @@ public Builder addSum(String name, double value) {
/**
* Add min simple field with name and value.
*
* @param name
* @param value
* @param name field name
* @param value field value
* @return builder
*/
public Builder addMin(String name, double value) {
Expand All @@ -117,8 +117,8 @@ public Builder addMin(String name, double value) {
/**
* Add max simple field with name and value.
*
* @param name
* @param value
* @param name field name
* @param value field value
* @return builder
*/
public Builder addMax(String name, double value) {
Expand All @@ -128,8 +128,8 @@ public Builder addMax(String name, double value) {
/**
* Add last simple field with name and value.
*
* @param name
* @param value
* @param name field name
* @param value field value
* @return builder
*/
public Builder addLast(String name, double value) {
Expand All @@ -139,8 +139,8 @@ public Builder addLast(String name, double value) {
/**
* Add first simple field with name and value.
*
* @param name
* @param value
* @param name field name
* @param value field value
* @return builder
*/
public Builder addFirst(String name, double value) {
Expand All @@ -149,13 +149,15 @@ public Builder addFirst(String name, double value) {

/**
* Add histogram field with values.
* Notice: bounds length must be equals values length
*
* @param count
* @param sum
* @param min
* @param max
* @param bounds
* @param values
* @param count count value
* @param sum sum value
* @param min min value
* @param max max value
* @param bounds bound array
* @param values value array
*
* @return builder
*/
public Builder addHistogram(double count, double sum, double min, double max, double[] bounds,
Expand Down Expand Up @@ -209,7 +211,7 @@ private Builder addSimpleField(Field field) {
/**
* Add field just for testing.
*
* @param field {@link Field}
* @param field field
* @return builder
*/
protected Builder addField(Field field) {
Expand All @@ -224,7 +226,7 @@ protected Builder addField(Field field) {
/**
* Create a builder instance with metric name.
*
* @param name
* @param name name of metric
* @return builder
*/
public static Builder builder(String name) {
Expand All @@ -234,8 +236,8 @@ public static Builder builder(String name) {
/**
* Create a builder instance with metric name and timestamp.
*
* @param name
* @param timestamp
* @param name name of metric
* @param timestamp timestamp of point
* @return builder
*/
public static Builder builder(String name, long timestamp) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/lindb/client/api/RetryEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class RetryEntry {
/**
* Create retryn entry instance with data.
*
* @param data
* @param data data of point
*/
protected RetryEntry(byte[] data) {
this.data = data;
Expand All @@ -47,7 +47,7 @@ public void increaseRetry() {
/**
* Return the retry data.
*
* @return data
* @return data of point
*/
public byte[] getData() {
return data;
Expand Down
21 changes: 11 additions & 10 deletions src/main/java/io/lindb/client/api/RowBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public RowBuilder() {
/**
* Write point into flat buffer then returns binary value of point.
*
* @param point
* @param point metric data point
* @param defaultTags default tags for metric
* @return the data of point
*/
public byte[] build(final Point point, Map<String, String> defaultTags) {
Expand Down Expand Up @@ -139,9 +140,9 @@ public byte[] build(final Point point, Map<String, String> defaultTags) {
/**
* Write simple field into flat buffer.
*
* @param name
* @param type
* @param value
* @param name field name
* @param type field type
* @param value field value
* @return field offset
*/
public int addSimpleField(String name, FieldType type, double value) {
Expand All @@ -157,12 +158,12 @@ public int addSimpleField(String name, FieldType type, double value) {
/**
* Write compound field into flat buffer.
*
* @param count
* @param sum
* @param min
* @param max
* @param bounds
* @param values
* @param count count value
* @param sum sum value
* @param min min value
* @param max max value
* @param bounds bound array
* @param values value array
* @return field offset
*/
public int addCompoundField(double count, double sum, double min, double max, double[] bounds, double[] values) {
Expand Down
Loading

0 comments on commit b291d2e

Please sign in to comment.