Skip to content

Commit

Permalink
build: format pom and code (#39)
Browse files Browse the repository at this point in the history
Signed-off-by: tison <[email protected]>
Co-authored-by: JeremyHi <[email protected]>
  • Loading branch information
tisonkun and fengjiachun authored Mar 19, 2024
1 parent b904e51 commit 4fa729a
Show file tree
Hide file tree
Showing 156 changed files with 1,677 additions and 1,841 deletions.
58 changes: 36 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2023 Greptime Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: build

on:
Expand All @@ -7,57 +21,57 @@ on:
branches: [ main ]

jobs:
check_format:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- uses: actions/checkout@v4
- uses: korandoru/hawkeye@v4
- uses: actions/setup-java@v4
with:
java-version: 1.8
java-version: '21'
distribution: 'zulu'
- name: Check format
run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
&& sh ./tools/check_format.sh
run: mvn spotless:check

test_ingester_common:
needs: check_format
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 1.8
java-version: '8'
distribution: 'zulu'
- name: Maven Test
run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
&& (mvn --projects ingester-common test
|| mvn --projects ingester-common test
|| mvn --projects ingester-common test)

test_ingester_grpc:
needs: check_format
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 1.8
java-version: '8'
distribution: 'zulu'
- name: Maven Test
run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
&& (mvn --projects ingester-grpc test
|| mvn --projects ingester-grpc test
|| mvn --projects ingester-grpc test)

test_ingester_protocol:
needs: check_format
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 1.8
java-version: '8'
distribution: 'zulu'
- name: Maven Test
run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
&& (mvn --projects ingester-protocol test
Expand Down
24 changes: 18 additions & 6 deletions .github/workflows/mvn_publish.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2023 Greptime Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Maven Publish

on:
Expand All @@ -8,13 +22,11 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout Git Repo
uses: actions/checkout@v2

- name: Set up JDK 1.8
uses: actions/setup-java@v1
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 1.8
java-version: '8'
distribution: 'zulu'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ target

# dev tools
.idea
*.iml

*.bak
.vscode/*
Expand Down
25 changes: 18 additions & 7 deletions ingester-all/pom.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2023 Greptime Team
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>greptimedb-ingester</artifactId>
<groupId>io.greptime</groupId>
<artifactId>greptimedb-ingester</artifactId>
<version>0.7.3</version>
</parent>

<artifactId>ingester-all</artifactId>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
Expand Down
24 changes: 19 additions & 5 deletions ingester-common/pom.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2023 Greptime Team
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>greptimedb-ingester</artifactId>
<groupId>io.greptime</groupId>
<artifactId>greptimedb-ingester</artifactId>
<version>0.7.3</version>
</parent>

<artifactId>ingester-common</artifactId>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<metrics.version>4.2.11</metrics.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
Expand All @@ -35,8 +49,8 @@
<version>${metrics.version}</version>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.protobuf;

/**
* A {@code ByteString} helper, avoid some memory copying to improve performance.
*
* @author jiachun.fjc
*/
public class ByteStringHelper {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.greptime.common;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.greptime.common;

import java.io.PrintWriter;
Expand All @@ -21,8 +22,6 @@
* Components that implement this interface need to be able to display
* their own state and output state information via the {@code display}
* method.
*
* @author jiachun.fjc
*/
public interface Display {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.greptime.common;

import io.greptime.common.util.Strings;
import java.io.Serializable;

/**
* An IP address with port.
*
* @author jiachun.fjc
*/
public class Endpoint implements Serializable {

Expand Down
3 changes: 1 addition & 2 deletions ingester-common/src/main/java/io/greptime/common/Into.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.greptime.common;

/**
* A value-to-value conversion.
*
* @author jiachun.fjc
*/
public interface Into<Output> {
Output into();
Expand Down
3 changes: 1 addition & 2 deletions ingester-common/src/main/java/io/greptime/common/Keys.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.greptime.common;

/**
* Constant string keys.
*
* @author jiachun.fjc
*/
public final class Keys {
public static final String DB_NAME = "GreptimeDB";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.greptime.common;

/**
* Service life cycle mark interface.
*
* @author jiachun.fjc
*/
public interface Lifecycle<T> {

Expand Down
3 changes: 1 addition & 2 deletions ingester-common/src/main/java/io/greptime/common/SPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.greptime.common;

import java.lang.annotation.Documented;
Expand All @@ -23,8 +24,6 @@

/**
* Service provide interface annotation.
*
* @author jiachun.fjc
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.greptime.common.signal;

import io.greptime.common.Keys;
Expand All @@ -26,8 +27,6 @@

/**
* File output helper.
*
* @author jiachun.fjc
*/
public final class FileOutputHelper {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.greptime.common.signal;

import java.util.Optional;
Expand All @@ -23,12 +24,10 @@
* Adopt the method of creating files with specified names to interact
* with the Client process and implement signal transmission, achieve the
* purpose of controlling the process to output specified content through this.
*
* @author jiachun.fjc
*/
public enum FileSignal {
RwLogging("rw_logging.sig", "How to open or close read/write log(The second execution means close)"), //
RpcLimit("rpc_limit.sig", "How to open or close rpc limiter(The second execution means close)"), //
RwLogging("rw_logging.sig", "How to open or close read/write log(The second execution means close)"),
RpcLimit("rpc_limit.sig", "How to open or close rpc limiter(The second execution means close)"),
;

private final String filename;
Expand Down
Loading

0 comments on commit 4fa729a

Please sign in to comment.