diff --git a/README.md b/README.md
index 0835f3a..2acb441 100644
--- a/README.md
+++ b/README.md
@@ -102,27 +102,25 @@ CeresDB is a high-performance, distributed, schema-less, cloud native time-serie
io.ceresdbceresdb-all
- 0.1.0
+ 1.0.0-alpha
```
## Init CeresDB client
```java
-// CeresDB options
-final CeresDBOptions opts = CeresDBOptions.newBuilder("127.0.0.1", 8831) //// CeresDB default grpc port 8831
- .tenant("public", "sub_test", "test_token") // tenant info
+final CeresDBOptions opts = CeresDBOptions.newBuilder("127.0.0.1", 8831, DIRECT) // CeresDB default grpc port 8831,use DIRECT RouteMode
+ .database("public") // use database for client, can be overridden by the RequestContext in request
// maximum retry times when write fails
// (only some error codes will be retried, such as the routing table failure)
.writeMaxRetries(1)
// maximum retry times when read fails
// (only some error codes will be retried, such as the routing table failure)
- .readMaxRetries(1)
- .build();
+ .readMaxRetries(1).build();
final CeresDBClient client = new CeresDBClient();
- if (!client.init(this.opts)) {
+if (!client.init(opts)) {
throw new IllegalStateException("Fail to start CeresDBClient");
- }
+}
```
For more configuration options, see [configuration](docs/configuration.md)
@@ -132,105 +130,87 @@ CeresDB is a Schema-less time-series database, so creating table schema ahead of
The following table creation statement(using the SQL API included in SDK )shows all field types supported by CeresDB:
```java
-SqlResult result = client.management().executeSql("CREATE TABLE MY_FIRST_TABL(" +
- "ts TIMESTAMP NOT NULL," +
- "c1 STRING TAG NOT NULL," +
- "c2 STRING TAG NOT NULL," +
- "c3 DOUBLE NULL," +
- "c4 STRING NULL," +
- "c5 INT64 NULL," +
- "c6 FLOAT NULL," +
- "c7 INT32 NULL," +
- "c8 INT16 NULL," +
- "c9 INT8 NULL," +
- "c10 BOOLEAN NULL,"
- "c11 UINT64 NULL,"
- "c12 UINT32 NULL,"
- "c13 UINT16 NULL,"
- "c14 UINT8 NULL,"
- "c15 TIMESTAMP NULL,"
- "c16 VARBINARY NULL,"
- "TIMESTAMP KEY(ts)) ENGINE=Analytic"
-);
+// Create table manually, creating table schema ahead of data ingestion is not required
+String createTableSql = "CREATE TABLE IF NOT EXISTS machine_table(" + "ts TIMESTAMP NOT NULL," + //
+ "ts TIMESTAMP NOT NULL," +
+ "city STRING TAG NOT NULL," +
+ "ip STRING TAG NOT NULL," +
+ "cpu DOUBLE NULL," +
+ "mem DOUBLE NULL," +
+ "TIMESTAMP KEY(ts)" + // timestamp column must be specified
+ ") ENGINE=Analytic";
+
+Result createResult = client.sqlQuery(new SqlQueryRequest(createTableSql)).get();
+if (!createResult.isOk()) {
+ throw new IllegalStateException("Fail to create table");
+}
```
-## Write data example
+## How to build write data
```java
-final long t0 = System.currentTimeMillis();
-final long t1 = t0 + 1000;
-final long t2 = t1 + 1000;
-final Rows data = Series.newBuilder("machine_metric")
- .tag("city", "Singapore")
- .tag("ip", "127.0.0.1")
- .toRowsBuilder()
- // codes below organizes 3 lines data (3 timestamps) for the `cpu` and `mem` column, this will just transport once through network. CeresDB encourage practices like this, because the SDK could use efficient compression algorithm to reduce network traffic and also be friendly to the sever side.
- .field(t0, "cpu", FieldValue.withDouble(0.23)) // first row, first column
- .field(t0, "mem", FieldValue.withDouble(0.55)) // first row, second column
- .field(t1, "cpu", FieldValue.withDouble(0.25)) // second row, first column
- .field(t1, "mem", FieldValue.withDouble(0.56)) // second row, second column
- .field(t2, "cpu", FieldValue.withDouble(0.21)) // third row, first column
- .field(t2, "mem", FieldValue.withDouble(0.52)) // third row, second column
+final Point point = Point.newPointBuilder("machine_table")
+ .setTimestamp(t0)
+ .addTag("city", "Singapore")
+ .addTag("ip", "10.0.0.1")
+ .addField("cpu", Value.withDouble(0.23))
+ .addField("mem", Value.withDouble(0.55))
.build();
+```
-final CompletableFuture> wf = client.write(data);
+## Write data example
+```java
+final CompletableFuture> wf = client.write(new WriteRequest(pointList));
// here the `future.get` is just for demonstration, a better async programming practice would be using the CompletableFuture API
-final Result wr = wf.get();
-
- Assert.assertTrue(wr.isOk());
- Assert.assertEquals(3, wr.getOk().getSuccess());
- // `Result` class referenced the Rust language practice, provides rich functions (such as mapXXX, andThen) transforming the result value to improve programming efficiency. You can refer to the API docs for detail usage.
- Assert.assertEquals(3, wr.mapOr(0, WriteOk::getSuccess).intValue());
- Assert.assertEquals(0, wr.getOk().getFailed());
- Assert.assertEquals(0, wr.mapOr(-1, WriteOk::getFailed).intValue());
+final Result writeResult = wf.get();
+Assert.assertTrue(writeResult.isOk());
+// `Result` class referenced the Rust language practice, provides rich functions (such as mapXXX, andThen) transforming the result value to improve programming efficiency. You can refer to the API docs for detail usage.
+Assert.assertEquals(3, writeResult.getOk().getSuccess());
+Assert.assertEquals(3, writeResult.mapOr(0, WriteOk::getSuccess).intValue());
+Assert.assertEquals(0, writeResult.mapOr(-1, WriteOk::getFailed).intValue());
```
See [write](docs/write.md)
## Query data example
```java
-final QueryRequest queryRequest = QueryRequest.newBuilder()
- .forMetrics("machine_metric") // table name is optional. If not provided, SQL parser will parse the `ql` to get the table name and do the routing automaticly
- .ql("select timestamp, cpu, mem from machine_metric") //
+final SqlQueryRequest queryRequest = SqlQueryRequest.newBuilder()
+ .forTables("machine_table") // table name is optional. If not provided, SQL parser will parse the `sql` to get the table name and do the routing automaticly
+ .sql("select * from machine_table where ts = %d", t0) //
.build();
-final CompletableFuture> qf = client.query(queryRequest);
+final CompletableFuture> qf = client.sqlQuery(queryRequest);
// here the `future.get` is just for demonstration, a better async programming practice would be using the CompletableFuture API
-final Result qr = qf.get();
+final Result queryResult = qf.get();
+
+Assert.assertTrue(queryResult.isOk());
- Assert.assertTrue(qr.isOk());
+final SqlQueryOk queryOk = queryResult.getOk();
+Assert.assertEquals(1, queryOk.getRowCount());
-final QueryOk queryOk = qr.getOk();
+// get rows as list
+final List rows = queryOk.getRowList();
-final List records = queryOk.mapToRecord().collect(Collectors.toList())
+// get rows as stream
+final Stream rowStream = queryOk.stream();
+rowStream.forEach(row -> System.out.println(row.toString()));
```
See [read](docs/read.md)
## stream write/read Example
CeresDB support streaming writing and reading,suitable for large-scale data reading and writing。
```java
-final Calendar time = Calendar.getInstance();
-final StreamWriteBuf writeBuf = client.streamWrite("machine_metric");
- for (int i = 0; i < 1000; i++) {
- time.add(Calendar.MILLISECOND, 1);
- Collection rows = new ArrayList<>();
- final long t0 = System.currentTimeMillis();
- final long t1 = t0 + 1000;
- final long t2 = t1 + 1000;
- final Rows data = Series.newBuilder("machine_metric").tag("city", "Singapore").tag("ip", "127.0.0.1")
- .toRowsBuilder()
- .field(t0, "cpu", FieldValue.withDouble(0.23))
- .field(t0, "mem", FieldValue.withDouble(0.55))
- .field(t1, "cpu", FieldValue.withDouble(0.25))
- .field(t1, "mem", FieldValue.withDouble(0.56))
- .field(t2, "cpu", FieldValue.withDouble(0.21))
- .field(t2, "mem", FieldValue.withDouble(0.52))
+final StreamWriteBuf writeBuf = client.streamWrite("machine_table");
+for (int i = 0; i < 1000; i++) {
+ final Point point = Point.newPointBuilder("machine_table")
+ .setTimestamp(timestamp)
+ .addTag("city", "Beijing")
+ .addTag("ip", "10.0.0.3")
+ .addField("cpu", Value.withDouble(0.42))
+ .addField("mem", Value.withDouble(0.67))
.build();
- rows.add(data);
- writeBuf.writeAndFlush(data);
- }
-final CompletableFuture writeOk = writeBuf.completed();
- Assert.assertEquals(1000, writeOk.join().getSuccess());
+ writeBuf.writeAndFlush(Arrays.asList(point));
+ timestamp = timestamp+1;
+}
-final QueryRequest req = QueryRequest.newBuilder().ql("select * from %s", "machine_metric").build();
-final Iterator it = client.blockingStreamQuery(req, 3, TimeUnit.SECONDS);
+final CompletableFuture writeOk = writeBuf.completed();
```
See [streaming](docs/streaming.md)
diff --git a/README_CN.md b/README_CN.md
index f145f9a..38724a1 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -99,27 +99,23 @@ CeresDBClient 是 CeresDB 的高性能 Java 版客户端。CeresDB 是定位为
io.ceresdbceresdb-all
- 0.1.0-RC
+ 1.0.0-alpha
```
## 初始化 CeresDB Client
```java
// CeresDB options
-final CeresDBOptions opts = CeresDBOptions.newBuilder("127.0.0.1", 8831) //
- .tenant("test", "sub_test", "test_token") // tenant info
- // maximum retry times when write fails
- // (only some error codes will be retried, such as the routing table failure)
- .writeMaxRetries(1)
- // maximum retry times when read fails
- // (only some error codes will be retried, such as the routing table failure)
- .readMaxRetries(1)
+final CeresDBOptions opts = CeresDBOptions.newBuilder("127.0.0.1", 8831, DIRECT) // 默认 gprc 端口号,DIRECT 模式
+ .database("public") // Client所使用的database,可被RequestContext的database覆盖
+ .writeMaxRetries(1) // 写入失败重试次数上限(只有部分错误 code 才会重试,比如路由表失效)
+ .readMaxRetries(1) // 查询失败重试次数上限(只有部分错误 code 才会重试,比如路由表失效)
.build();
final CeresDBClient client = new CeresDBClient();
- if (!client.init(this.opts)) {
+if (!client.init(opts)) {
throw new IllegalStateException("Fail to start CeresDBClient");
- }
+}
```
配置详情见 [configuration](docs/configuration.md)
@@ -131,118 +127,88 @@ CeresDB 是一个 Schema-less 的时序数据引擎,你可以不必创建 sche
下面的建表语句(使用 SDK 的 SQL API)包含了 CeresDB 支持的所有字段类型:
```java
-final CeresDBOptions opts = CeresDBOptions.newBuilder("127.0.0.1", 8831) // 默认 gprc 端口号
- .managementAddress("127.0.0.1", 5440) // 注意,直接使用 sql 需要连接 CeresDB 的 http 端口
- .tenant("public", "sub_test", "test_token") // 租户信息
- .writeMaxRetries(1) // 写入失败重试次数上限(只有部分错误 code 才会重试,比如路由表失效)
- .readMaxRetries(1) // 查询失败重试次数上限(只有部分错误 code 才会重试,比如路由表失效)
- .build();
-
-SqlResult result = client.management().executeSql("CREATE TABLE MY_FIRST_TABL(" +
- "ts TIMESTAMP NOT NULL," +
- "c1 STRING TAG NOT NULL," +
- "c2 STRING TAG NOT NULL," +
- "c3 DOUBLE NULL," +
- "c4 STRING NULL," +
- "c5 INT64 NULL," +
- "c6 FLOAT NULL," +
- "c7 INT32 NULL," +
- "c8 INT16 NULL," +
- "c9 INT8 NULL," +
- "c10 BOOLEAN NULL,"
- "c11 UINT64 NULL,"
- "c12 UINT32 NULL,"
- "c13 UINT16 NULL,"
- "c14 UINT8 NULL,"
- "c15 TIMESTAMP NULL,"
- "c16 VARBINARY NULL,"
- "TIMESTAMP KEY(ts)) ENGINE=Analytic"
-);
+String createTableSql = "CREATE TABLE IF NOT EXISTS machine_table(" + "ts TIMESTAMP NOT NULL," + //
+ "ts TIMESTAMP NOT NULL," +
+ "city STRING TAG NOT NULL," +
+ "ip STRING TAG NOT NULL," +
+ "cpu DOUBLE NULL," +
+ "mem DOUBLE NULL," +
+ "TIMESTAMP KEY(ts)" + // 建表时必须指定时间戳序列
+ ") ENGINE=Analytic";
+
+Result createResult = client.sqlQuery(new SqlQueryRequest(createTableSql)).get();
+if (!createResult.isOk()) {
+ throw new IllegalStateException("Fail to create table");
+}
```
详情见 [table](docs/table.md)
+## 构建写入数据
+```java
+final Point point = Point.newPointBuilder("machine_table")
+ .setTimestamp(t0)
+ .addTag("city", "Singapore")
+ .addTag("ip", "10.0.0.1")
+ .addField("cpu", Value.withDouble(0.23))
+ .addField("mem", Value.withDouble(0.55))
+ .build();
+```
## 写入 Example
```java
-
-final long t0 = System.currentTimeMillis();
-final long t1 = t0 + 1000;
-final long t2 = t1 + 1000;
-final Rows data = Series.newBuilder("machine_metric")
- .tag("city", "Singapore")
- .tag("ip", "127.0.0.1")
- .toRowsBuilder()
- // 下面针对 cpu、mem 两列,一次写入了三行数据(3 个时间戳),CeresDB 鼓励这种实践,SDK 可以通过高效的压缩来减少网络传输,并且对 server 端写入非常友好
- .field(t0, "cpu", FieldValue.withDouble(0.23)) // 第 1 行第 1 列
- .field(t0, "mem", FieldValue.withDouble(0.55)) // 第 1 行第 2 列
- .field(t1, "cpu", FieldValue.withDouble(0.25)) // 第 2 行第 1 列
- .field(t1, "mem", FieldValue.withDouble(0.56)) // 第 2 行第 2 列
- .field(t2, "cpu", FieldValue.withDouble(0.21)) // 第 3 行第 1 列
- .field(t2, "mem", FieldValue.withDouble(0.52)) // 第 3 行第 2 列
- .build();
-
-final CompletableFuture> wf = client.write(data);
+final CompletableFuture> wf = client.write(new WriteRequest(pointList));
// 这里用 `future.get` 只是方便演示,推荐借助 CompletableFuture 强大的 API 实现异步编程
-final Result wr = wf.get();
+final Result writeResult = wf.get();
-Assert.assertTrue(wr.isOk());
-Assert.assertEquals(3, wr.getOk().getSuccess());
+Assert.assertTrue(writeResult.isOk());
+Assert.assertEquals(3, writeResult.getOk().getSuccess());
// `Result` 类参考了 Rust 语言,提供了丰富的 mapXXX、andThen 类 function 方便对结果值进行转换,提高编程效率,欢迎参考 API 文档使用
-Assert.assertEquals(3, wr.mapOr(0, WriteOk::getSuccess).intValue());
-Assert.assertEquals(0, wr.getOk().getFailed());
-Assert.assertEquals(0, wr.mapOr(-1, WriteOk::getFailed).intValue());
-
+Assert.assertEquals(3, writeResult.mapOr(0, WriteOk::getSuccess).intValue());
+Assert.assertEquals(0, writeResult.mapOr(-1, WriteOk::getFailed).intValue());
```
详情见 [write](docs/write.md)
## 查询 Example
```java
-final QueryRequest queryRequest = QueryRequest.newBuilder()
- .forMetrics("machine_metric") // 表名可选填,不填的话 SQL Parser 会自动解析 ql 涉及到的表名并完成自动路由
- .ql("select timestamp, cpu, mem from machine_metric") //
+final SqlQueryRequest queryRequest = SqlQueryRequest.newBuilder()
+ .forTables("machine_table") // 这里表名是可选的,如果未提供,SDK将自动解析SQL填充表名并自动路由
+ .sql("select * from machine_table where ts = %d", t0) //
.build();
-final CompletableFuture> qf = client.query(queryRequest);
+final CompletableFuture> qf = client.sqlQuery(queryRequest);
// 这里用 `future.get` 只是方便演示,推荐借助 CompletableFuture 强大的 API 实现异步编程
-final Result qr = qf.get();
+final Result queryResult = qf.get();
-Assert.assertTrue(qr.isOk());
+Assert.assertTrue(queryResult.isOk());
-final QueryOk queryOk = qr.getOk();
+final SqlQueryOk queryOk = queryResult.getOk();
+Assert.assertEquals(1, queryOk.getRowCount());
-final List records = queryOk.mapToRecord().collect(Collectors.toList())
-final Stream users = queryOk.map(bytes -> parseUser(bytes));
+// 直接获取结果数组
+final List rows = queryOk.getRowList();
+// 获取结果流
+final Stream rowStream = queryOk.stream();
+rowStream.forEach(row -> System.out.println(row.toString()));
```
详情见 [read](docs/read.md)
## 流式读写 Example
CeresDB 支持流式读写,适用于大规模数据读写。
```java
-final Calendar time = Calendar.getInstance();
-final StreamWriteBuf writeBuf = client.streamWrite("machine_metric");
- for (int i = 0; i < 1000; i++) {
- time.add(Calendar.MILLISECOND, 1);
- Collection rows = new ArrayList<>();
- final long t0 = System.currentTimeMillis();
- final long t1 = t0 + 1000;
- final long t2 = t1 + 1000;
- final Rows data = Series.newBuilder("machine_metric").tag("city", "Singapore").tag("ip", "127.0.0.1")
- .toRowsBuilder()
- .field(t0, "cpu", FieldValue.withDouble(0.23))
- .field(t0, "mem", FieldValue.withDouble(0.55))
- .field(t1, "cpu", FieldValue.withDouble(0.25))
- .field(t1, "mem", FieldValue.withDouble(0.56))
- .field(t2, "cpu", FieldValue.withDouble(0.21))
- .field(t2, "mem", FieldValue.withDouble(0.52))
+final StreamWriteBuf writeBuf = client.streamWrite("machine_table");
+for (int i = 0; i < 1000; i++) {
+ final Point point = Point.newPointBuilder("machine_table")
+ .setTimestamp(timestamp)
+ .addTag("city", "Beijing")
+ .addTag("ip", "10.0.0.3")
+ .addField("cpu", Value.withDouble(0.42))
+ .addField("mem", Value.withDouble(0.67))
.build();
- rows.add(data);
- writeBuf.writeAndFlush(data);
- }
-final CompletableFuture writeOk = writeBuf.completed();
- Assert.assertEquals(1000, writeOk.join().getSuccess());
+ writeBuf.writeAndFlush(Arrays.asList(point));
+ timestamp = timestamp+1;
+}
-final QueryRequest req = QueryRequest.newBuilder().ql("select * from %s", "machine_metric").build();
-final Iterator it = client.blockingStreamQuery(req, 3, TimeUnit.SECONDS);
+final CompletableFuture writeOk = writeBuf.completed();
```
详情见 [streaming](docs/streaming.md)
diff --git a/ceresdb-all/pom.xml b/ceresdb-all/pom.xml
index 55019da..1f9427a 100644
--- a/ceresdb-all/pom.xml
+++ b/ceresdb-all/pom.xml
@@ -20,11 +20,6 @@
ceresdb-grpc${project.version}
-
- ${project.groupId}
- ceresdb-http
- ${project.version}
- ${project.groupId}ceresdb-protocol
diff --git a/ceresdb-common/src/main/java/com/google/protobuf/ByteStringHelper.java b/ceresdb-common/src/main/java/com/google/protobuf/ByteStringHelper.java
index db3aa05..e81c919 100644
--- a/ceresdb-common/src/main/java/com/google/protobuf/ByteStringHelper.java
+++ b/ceresdb-common/src/main/java/com/google/protobuf/ByteStringHelper.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package com.google.protobuf;
@@ -23,7 +10,6 @@
/**
* A {@code ByteString} helper.
*
- * @author jiachun.fjc
*/
public class ByteStringHelper {
diff --git a/ceresdb-common/src/main/java/com/google/protobuf/BytesStealer.java b/ceresdb-common/src/main/java/com/google/protobuf/BytesStealer.java
index 01deb74..b1630f3 100644
--- a/ceresdb-common/src/main/java/com/google/protobuf/BytesStealer.java
+++ b/ceresdb-common/src/main/java/com/google/protobuf/BytesStealer.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package com.google.protobuf;
@@ -22,7 +9,6 @@
/**
* Try to gets the bytes form ByteString with no copy.
*
- * @author jiachun.fjc
*/
public class BytesStealer extends ByteOutput {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/Copiable.java b/ceresdb-common/src/main/java/io/ceresdb/common/Copiable.java
index 0f5ad18..866041d 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/Copiable.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/Copiable.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common;
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/Display.java b/ceresdb-common/src/main/java/io/ceresdb/common/Display.java
index 1ee2c33..efaa44b 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/Display.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/Display.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common;
@@ -23,7 +10,6 @@
* their own state and output state information via the {@code display}
* method.
*
- * @author jiachun.fjc
*/
public interface Display {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/Endpoint.java b/ceresdb-common/src/main/java/io/ceresdb/common/Endpoint.java
index 1f8b8a8..8fc5c13 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/Endpoint.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/Endpoint.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common;
@@ -23,7 +10,6 @@
/**
* A IP address with port.
*
- * @author jiachun.fjc
*/
public class Endpoint implements Serializable {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/InFlightLimiter.java b/ceresdb-common/src/main/java/io/ceresdb/common/InFlightLimiter.java
index a13935e..6a1f32c 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/InFlightLimiter.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/InFlightLimiter.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common;
@@ -28,7 +15,6 @@
/**
* In-flight limiter.
*
- * @author jiachun.fjc
*/
public class InFlightLimiter implements Limiter {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/Lifecycle.java b/ceresdb-common/src/main/java/io/ceresdb/common/Lifecycle.java
index 9113bae..1e5508a 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/Lifecycle.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/Lifecycle.java
@@ -1,25 +1,11 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common;
/**
* Service life cycle mark interface.
*
- * @author jiachun.fjc
*/
public interface Lifecycle {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/Limiter.java b/ceresdb-common/src/main/java/io/ceresdb/common/Limiter.java
index 3a6843c..8d7e8a9 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/Limiter.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/Limiter.java
@@ -1,27 +1,10 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common;
import java.util.concurrent.TimeUnit;
-/**
- *
- * @author jiachun.fjc
- */
public interface Limiter {
/**
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/OptKeys.java b/ceresdb-common/src/main/java/io/ceresdb/common/OptKeys.java
index 9a0fd51..236ca26 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/OptKeys.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/OptKeys.java
@@ -1,25 +1,11 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common;
/**
* System properties option keys
*
- * @author jiachun.fjc
*/
public final class OptKeys {
@@ -29,11 +15,8 @@ public final class OptKeys {
public static final String USE_OS_SIGNAL = "CeresDB.client.use_os_signal";
public static final String REPORT_PERIOD = "CeresDB.reporter.period_minutes";
public static final String SIG_OUT_DIR = "CeresDB.signal.out_dir";
- public static final String HTTP_READ_TIMEOUT_MS = "CeresDB.http.read_timeout_ms";
- public static final String HTTP_WRITE_TIMEOUT_MS = "CeresDB.http.write_timeout_ms";
public static final String GRPC_CONN_RESET_THRESHOLD = "CeresDB.grpc.conn.failures.reset_threshold";
public static final String AVAILABLE_CPUS = "CeresDB.available_cpus";
- public static final String NAME_VALIDATE = "CeresDB.avro.name_validate";
public static final String WRITE_LIMIT_PERCENT = "CeresDB.rpc.write.limit_percent";
private OptKeys() {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/SPI.java b/ceresdb-common/src/main/java/io/ceresdb/common/SPI.java
index 9f42e0e..f7036d3 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/SPI.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/SPI.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common;
@@ -25,7 +12,6 @@
/**
* Service provide interface annotation.
*
- * @author jiachun.fjc
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/Streamable.java b/ceresdb-common/src/main/java/io/ceresdb/common/Streamable.java
index 5d436ff..de5d326 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/Streamable.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/Streamable.java
@@ -1,27 +1,10 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common;
import java.util.stream.Stream;
-/**
- *
- * @author jiachun.fjc
- */
public interface Streamable {
/**
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/Tenant.java b/ceresdb-common/src/main/java/io/ceresdb/common/Tenant.java
deleted file mode 100644
index 514248e..0000000
--- a/ceresdb-common/src/main/java/io/ceresdb/common/Tenant.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package io.ceresdb.common;
-
-/**
- * A tenant for CeresDB.
- *
- * @author jiachun.fjc
- */
-public final class Tenant implements Copiable {
-
- private final String tenant;
- // Default subtenant, which is used if you do not re-specify a
- // subtenant each time you make a call.
- private final String childTenant;
- // Don't tell the secret to anyone, heaven knows and earth knows,
- // you know and I know. \(^▽^)/
- private final String token;
-
- private Tenant(String tenant, String childTenant, String token) {
- this.tenant = tenant;
- this.childTenant = childTenant;
- this.token = token;
- }
-
- public static Tenant of(final String tenant, final String childTenant, final String token) {
- return new Tenant(tenant, childTenant, token);
- }
-
- public String getTenant() {
- return tenant;
- }
-
- public String getChildTenant() {
- return childTenant;
- }
-
- public String getToken() {
- return token;
- }
-
- @Override
- public Tenant copy() {
- return of(this.tenant, this.childTenant, this.token);
- }
-
- @Override
- public String toString() {
- return "Tenant{" + //
- "tenant='" + tenant + '\'' + //
- ", childTenant='" + childTenant + '\'' + //
- '}';
- }
-}
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/VisibleForTest.java b/ceresdb-common/src/main/java/io/ceresdb/common/VisibleForTest.java
index 38f7b03..7714954 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/VisibleForTest.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/VisibleForTest.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common;
diff --git a/ceresdb-protocol/src/main/java/io/ceresdb/MetricParser.java b/ceresdb-common/src/main/java/io/ceresdb/common/parser/SqlParser.java
similarity index 51%
rename from ceresdb-protocol/src/main/java/io/ceresdb/MetricParser.java
rename to ceresdb-common/src/main/java/io/ceresdb/common/parser/SqlParser.java
index 4721128..5f82eda 100644
--- a/ceresdb-protocol/src/main/java/io/ceresdb/MetricParser.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/parser/SqlParser.java
@@ -1,32 +1,18 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
-package io.ceresdb;
+package io.ceresdb.common.parser;
import java.util.Collections;
import java.util.List;
/**
- * A metric QL parser that can extract metric names from the given QL.
+ * A SQL parser that can extract table names from the given SQL.
*
- * @author jiachun.fjc
*/
-public interface MetricParser {
+public interface SqlParser {
- MetricParser DEFAULT = new NoopMetricParser();
+ SqlParser DEFAULT = new NoopSqlParser();
StatementType statementType();
@@ -35,7 +21,7 @@ public interface MetricParser {
*
* @return metric names
*/
- List metricNames();
+ List tableNames();
/**
* Extract the column names and types from the given create table QL.
@@ -69,7 +55,7 @@ default String valueType() {
}
}
- class NoopMetricParser implements MetricParser {
+ class NoopSqlParser implements SqlParser {
@Override
public StatementType statementType() {
@@ -77,7 +63,7 @@ public StatementType statementType() {
}
@Override
- public List metricNames() {
+ public List tableNames() {
return Collections.emptyList();
}
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/parser/SqlParserFactory.java b/ceresdb-common/src/main/java/io/ceresdb/common/parser/SqlParserFactory.java
new file mode 100644
index 0000000..f6c7501
--- /dev/null
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/parser/SqlParserFactory.java
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
+ */
+package io.ceresdb.common.parser;
+
+public interface SqlParserFactory {
+
+ SqlParserFactory DEFAULT = new NoopFactory();
+
+ SqlParser getParser(final String sql);
+
+ class NoopFactory implements SqlParserFactory {
+
+ @Override
+ public SqlParser getParser(final String sql) {
+ return SqlParser.DEFAULT;
+ }
+ }
+}
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/parser/SqlParserFactoryProvider.java b/ceresdb-common/src/main/java/io/ceresdb/common/parser/SqlParserFactoryProvider.java
new file mode 100644
index 0000000..a39ec30
--- /dev/null
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/parser/SqlParserFactoryProvider.java
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
+ */
+package io.ceresdb.common.parser;
+
+import io.ceresdb.common.util.ServiceLoader;
+
+public class SqlParserFactoryProvider {
+
+ private static final SqlParserFactory METRIC_PARSER_FACTORY = ServiceLoader //
+ .load(SqlParserFactory.class) //
+ .firstOrDefault(() -> SqlParserFactory.DEFAULT);
+
+ public static SqlParserFactory getSqlParserFactory() {
+ return METRIC_PARSER_FACTORY;
+ }
+}
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/signal/FileOutputHelper.java b/ceresdb-common/src/main/java/io/ceresdb/common/signal/FileOutputHelper.java
index 58c5058..01b8f2d 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/signal/FileOutputHelper.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/signal/FileOutputHelper.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.signal;
@@ -26,10 +13,6 @@
import io.ceresdb.common.util.Files;
import io.ceresdb.common.util.SystemPropertyUtil;
-/**
- *
- * @author jiachun.fjc
- */
public final class FileOutputHelper {
private static final String OUT_DIR = SystemPropertyUtil.get(OptKeys.SIG_OUT_DIR, "");
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/signal/FileSignal.java b/ceresdb-common/src/main/java/io/ceresdb/common/signal/FileSignal.java
index cdf416a..a56f006 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/signal/FileSignal.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/signal/FileSignal.java
@@ -1,26 +1,10 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.signal;
import java.util.Optional;
-/**
- * @author jiachun.fjc
- */
public enum FileSignal {
ClearCache("clear_cache.sig", "How to clear route cache"), //
RwLogging("rw_logging.sig", "How to open or close read/write log(The second execution means close)"), //
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/signal/FileSignals.java b/ceresdb-common/src/main/java/io/ceresdb/common/signal/FileSignals.java
index e356f2b..175d530 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/signal/FileSignals.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/signal/FileSignals.java
@@ -1,27 +1,11 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.signal;
import java.io.File;
import java.nio.file.Paths;
-/**
- * @author jiachun.fjc
- */
public class FileSignals {
private static final String[] EMPTY_ARRAY = new String[0];
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/signal/Signal.java b/ceresdb-common/src/main/java/io/ceresdb/common/signal/Signal.java
index fbd7a51..5abfb27 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/signal/Signal.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/signal/Signal.java
@@ -1,25 +1,11 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.signal;
/**
* Signal types.
*
- * @author jiachun.fjc
*/
public enum Signal {
SIG_USR2("USR2");
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/signal/SignalHandler.java b/ceresdb-common/src/main/java/io/ceresdb/common/signal/SignalHandler.java
index 19f8383..9faae9b 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/signal/SignalHandler.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/signal/SignalHandler.java
@@ -1,25 +1,11 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.signal;
/**
* This is the signal handler interface.
*
- * @author jiachun.fjc
*/
public interface SignalHandler {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/signal/SignalHandlersLoader.java b/ceresdb-common/src/main/java/io/ceresdb/common/signal/SignalHandlersLoader.java
index 94dd276..68e48f0 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/signal/SignalHandlersLoader.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/signal/SignalHandlersLoader.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.signal;
@@ -33,7 +20,6 @@
*
* Do not support windows.
*
- * @author jiachun.fjc
*/
public class SignalHandlersLoader {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/signal/SignalHelper.java b/ceresdb-common/src/main/java/io/ceresdb/common/signal/SignalHelper.java
index cd89a2a..4d7d0a8 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/signal/SignalHelper.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/signal/SignalHelper.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.signal;
@@ -26,7 +13,6 @@
/**
* A signal helper, provides ANSI/ISO C signal support.
*
- * @author jiachun.fjc
*/
public final class SignalHelper {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/AuthUtil.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/AuthUtil.java
deleted file mode 100644
index d56341b..0000000
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/AuthUtil.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package io.ceresdb.common.util;
-
-import java.nio.charset.StandardCharsets;
-import java.security.MessageDigest;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import io.ceresdb.common.Tenant;
-
-/**
- * A tool class for generating auth headers.
- *
- * @author jiachun.fjc
- */
-public class AuthUtil {
-
- public static final String HEAD_TIMESTAMP = "x-ceresdb-timestamp";
- public static final String HEAD_ACCESS_TENANT = "x-ceresdb-access-tenant";
- public static final String HEAD_ACCESS_TOKEN = "x-ceresdb-access-token";
- public static final String HEAD_ACCESS_CHILD_TENANT = "x-ceresdb-access-child-tenant";
-
- public static Map authHeaders(final Tenant tenant) {
- if (tenant == null) {
- return Collections.emptyMap();
- }
-
- final String timestamp = String.valueOf(Clock.defaultClock().getTick());
- final String token = tenant.getToken();
- final String tenantName = tenant.getTenant();
- final String childTenantName = tenant.getChildTenant();
-
- final Map headers = new HashMap<>();
- headers.put(HEAD_TIMESTAMP, timestamp);
- if (tenantName != null) {
- headers.put(HEAD_ACCESS_TENANT, tenantName);
- }
- if (token != null) {
- headers.put(HEAD_ACCESS_TOKEN, SHA256(token + timestamp));
- }
- if (childTenantName != null) {
- headers.put(HEAD_ACCESS_CHILD_TENANT, childTenantName);
- }
- return headers;
- }
-
- public static void replaceChildTenant(final Map headers, final String childTenant) {
- if (childTenant != null) {
- headers.put(HEAD_ACCESS_CHILD_TENANT, childTenant);
- }
- }
-
- private static String SHA256(final String str) {
- try {
- final MessageDigest md = MessageDigest.getInstance("SHA-256");
- final byte[] bytes = md.digest(str.getBytes(StandardCharsets.UTF_8));
- return toHex(bytes);
- } catch (final Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- private static String toHex(final byte[] bytes) {
- final char[] HEX_DIGITS = "0123456789abcdef".toCharArray();
- final StringBuilder buf = new StringBuilder(bytes.length * 2);
- for (final byte b : bytes) {
- buf.append(HEX_DIGITS[(b >> 4) & 0x0f]);
- buf.append(HEX_DIGITS[b & 0x0f]);
- }
- return buf.toString();
- }
-}
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/Clock.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/Clock.java
index 73dbc25..872dd49 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/Clock.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/Clock.java
@@ -1,25 +1,8 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
-/**
- *
- * @author jiachun.fjc
- */
public abstract class Clock {
/**
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/Cpus.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/Cpus.java
index 4888bac..a7f99d8 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/Cpus.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/Cpus.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
@@ -21,7 +8,6 @@
/**
* Utility for cpu.
*
- * @author jiachun.fjc
*/
public class Cpus {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/DirectExecutor.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/DirectExecutor.java
index fb8b37d..e33f712 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/DirectExecutor.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/DirectExecutor.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
@@ -23,7 +10,6 @@
/**
* An executor that run task directly.
*
- * @author jiachun.fjc
*/
public class DirectExecutor implements Executor {
private final String name;
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/ExecutorServiceHelper.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/ExecutorServiceHelper.java
index 73ca24a..c9eada6 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/ExecutorServiceHelper.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/ExecutorServiceHelper.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
@@ -25,7 +12,6 @@
/**
* Executor service shutdown helper.
*
- * @author jiachun.fjc
*/
public final class ExecutorServiceHelper {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/Files.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/Files.java
index dfd3fd8..71e569d 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/Files.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/Files.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
@@ -22,10 +9,6 @@
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
-/**
- *
- * @author jiachun.fjc
- */
public class Files {
/**
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/LogScheduledThreadPoolExecutor.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/LogScheduledThreadPoolExecutor.java
index 623ff4f..31f4378 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/LogScheduledThreadPoolExecutor.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/LogScheduledThreadPoolExecutor.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
@@ -31,7 +18,6 @@
* schedule tasks to run after a given delay with a logger witch can print
* error message for failed execution.
*
- * @author jiachun.fjc
*/
public class LogScheduledThreadPoolExecutor extends ScheduledThreadPoolExecutor {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/LogThreadPoolExecutor.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/LogThreadPoolExecutor.java
index bffe9fb..5ca7968 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/LogThreadPoolExecutor.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/LogThreadPoolExecutor.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
@@ -32,7 +19,6 @@
* A {@link java.util.concurrent.ExecutorService} that witch can print
* error message for failed execution.
*
- * @author jiachun.fjc
*/
public class LogThreadPoolExecutor extends ThreadPoolExecutor {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/MetricExecutor.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/MetricExecutor.java
index 5c6c4c8..5112b6e 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/MetricExecutor.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/MetricExecutor.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
@@ -24,7 +11,6 @@
* A {@link java.util.concurrent.Executor} that with a timer metric
* which aggregates timing durations and provides duration statistics.
*
- * @author jiachun.fjc
*/
public class MetricExecutor implements Executor {
private final Executor pool;
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/MetricReporter.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/MetricReporter.java
index b0233fd..b261e21 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/MetricReporter.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/MetricReporter.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/MetricScheduledThreadPoolExecutor.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/MetricScheduledThreadPoolExecutor.java
index ab66acd..f4b38c4 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/MetricScheduledThreadPoolExecutor.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/MetricScheduledThreadPoolExecutor.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
@@ -25,7 +12,6 @@
* schedule tasks to run after a given delay with a timer metric
* which aggregates timing durations and provides duration statistics.
*
- * @author jiachun.fjc
*/
public class MetricScheduledThreadPoolExecutor extends LogScheduledThreadPoolExecutor {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/MetricThreadPoolExecutor.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/MetricThreadPoolExecutor.java
index ac83f0a..558caab 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/MetricThreadPoolExecutor.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/MetricThreadPoolExecutor.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
@@ -25,7 +12,6 @@
* A {@link java.util.concurrent.ExecutorService} that with a timer metric
* which aggregates timing durations and provides duration statistics.
*
- * @author jiachun.fjc
*/
public class MetricThreadPoolExecutor extends LogThreadPoolExecutor {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/MetricsUtil.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/MetricsUtil.java
index 2eaaee6..fad76fb 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/MetricsUtil.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/MetricsUtil.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
@@ -34,7 +21,6 @@
* In CeresDB client, metrics are required. As for whether to output (log) metrics
* results, you decide.
*
- * @author jiachun.fjc
*/
public final class MetricsUtil {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/NamedThreadFactory.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/NamedThreadFactory.java
index ab5ad2a..83ea4e3 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/NamedThreadFactory.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/NamedThreadFactory.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
@@ -25,7 +12,6 @@
/**
* Named thread factory.
*
- * @author jiachun.fjc
*/
public class NamedThreadFactory implements ThreadFactory {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/ObjectPool.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/ObjectPool.java
index 99ef2c0..a1c31cb 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/ObjectPool.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/ObjectPool.java
@@ -1,25 +1,11 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
/**
* An object pool.
*
- * @author jiachun.fjc
*/
public interface ObjectPool {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/Platform.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/Platform.java
index bcafc2a..9c65d3c 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/Platform.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/Platform.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
@@ -23,10 +10,6 @@
import io.ceresdb.common.OptKeys;
-/**
- *
- * @author jiachun.fjc
- */
public class Platform {
private static final Logger LOG = LoggerFactory.getLogger(Platform.class);
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/RcObjectPool.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/RcObjectPool.java
index d7fa638..d8ba9d6 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/RcObjectPool.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/RcObjectPool.java
@@ -1,25 +1,11 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
/**
* An shared object pool with ref count.
*
- * @author jiachun.fjc
*/
public class RcObjectPool implements ObjectPool {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/RcResourceHolder.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/RcResourceHolder.java
index bc33a9a..d8f10f0 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/RcResourceHolder.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/RcResourceHolder.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
@@ -22,10 +9,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-/**
- *
- * @author jiachun.fjc
- */
public class RcResourceHolder {
private static final Logger LOG = LoggerFactory.getLogger(RcResourceHolder.class);
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/RefCell.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/RefCell.java
index 546c540..8e11724 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/RefCell.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/RefCell.java
@@ -1,24 +1,8 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
-/**
- * @author jiachun.fjc
- */
public class RefCell {
private T value;
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/Requires.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/Requires.java
index e132ef6..a6125e1 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/Requires.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/Requires.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
@@ -20,7 +7,6 @@
* Simple static methods to be called at the start of your own methods to verify
* correct arguments and state.
*
- * @author jiachun.fjc
*/
@SuppressWarnings("PMD")
public final class Requires {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/SerializingExecutor.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/SerializingExecutor.java
index 0568751..612be8c 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/SerializingExecutor.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/SerializingExecutor.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/ServiceLoader.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/ServiceLoader.java
index d8d6353..f8e2bd6 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/ServiceLoader.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/ServiceLoader.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
@@ -40,7 +27,6 @@
/**
* A simple service-provider loading facility (SPI).
*
- * @author jiachun.fjc
*/
@SuppressWarnings("PMD")
public final class ServiceLoader implements Iterable {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/SharedScheduledPool.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/SharedScheduledPool.java
index ef63e76..194f62a 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/SharedScheduledPool.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/SharedScheduledPool.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
@@ -21,7 +8,6 @@
/**
* Like rust: pub type SharedScheduledPool = RcObjectPool
*
- * @author jiachun.fjc
*/
public class SharedScheduledPool extends RcObjectPool {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/SharedThreadPool.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/SharedThreadPool.java
index 5406c4f..1589ace 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/SharedThreadPool.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/SharedThreadPool.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
@@ -21,7 +8,6 @@
/**
* Like rust: pub type SharedThreadPool = RcObjectPool
*
- * @author jiachun.fjc
*/
public class SharedThreadPool extends RcObjectPool {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/Spines.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/Spines.java
index 627c257..67d4c98 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/Spines.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/Spines.java
@@ -1,35 +1,18 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
import java.util.ArrayList;
-import java.util.Collection;
+import java.util.List;
-/**
- *
- * @author jiachun.fjc
- */
public class Spines {
- public static Collection newBuf() {
+ public static List newBuf() {
return new ArrayList<>();
}
- public static Collection newBuf(final int initialCapacity) {
+ public static List newBuf(final int initialCapacity) {
return new ArrayList<>(initialCapacity);
}
}
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/StringBuilderHelper.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/StringBuilderHelper.java
index 67d80a8..f5daadd 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/StringBuilderHelper.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/StringBuilderHelper.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
@@ -21,7 +8,6 @@
*
* Be careful that do not to nest in the same thread.
*
- * @author jiachun.fjc
*/
public class StringBuilderHelper {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/Strings.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/Strings.java
index 44ba843..10daca2 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/Strings.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/Strings.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
@@ -23,7 +10,6 @@
* Static utility methods pertaining to {@code String} or {@code CharSequence}
* instances.
*
- * @author jiachun.fjc
*/
public final class Strings {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/SystemPropertyUtil.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/SystemPropertyUtil.java
index 692fbba..dd97f0c 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/SystemPropertyUtil.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/SystemPropertyUtil.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/ThreadPoolMetricRegistry.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/ThreadPoolMetricRegistry.java
index 0a93966..baa9447 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/ThreadPoolMetricRegistry.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/ThreadPoolMetricRegistry.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
@@ -21,7 +8,6 @@
/**
* A global timer metric registry for thread pool, use threadLocal to pass timer context.
*
- * @author jiachun.fjc
*/
public class ThreadPoolMetricRegistry {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/ThreadPoolUtil.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/ThreadPoolUtil.java
index a01f97d..a366b7b 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/ThreadPoolUtil.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/ThreadPoolUtil.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
@@ -27,7 +14,6 @@
* Factory and utility methods for creating {@link ThreadPoolExecutor} and
* {@link ScheduledThreadPoolExecutor}.
*
- * @author jiachun.fjc
*/
public final class ThreadPoolUtil {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/TopKSelector.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/TopKSelector.java
index 87b40b2..a27af8e 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/TopKSelector.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/TopKSelector.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
@@ -23,7 +10,6 @@
/**
* TopK selector based on a priority heap.
*
- * @author jiachun.fjc
*/
public class TopKSelector {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/UnsignedUtil.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/UnsignedUtil.java
index 067eec0..e4b4ea0 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/UnsignedUtil.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/UnsignedUtil.java
@@ -1,27 +1,10 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
import java.math.BigInteger;
-/**
- *
- * @author jiachun.fjc
- */
public final class UnsignedUtil {
/**
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/IntegerFieldUpdater.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/IntegerFieldUpdater.java
index 78cbbb1..312de92 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/IntegerFieldUpdater.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/IntegerFieldUpdater.java
@@ -1,24 +1,8 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util.internal;
-/**
- * @author jiachun.fjc
- */
public interface IntegerFieldUpdater {
void set(final U obj, final int newValue);
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/LongFieldUpdater.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/LongFieldUpdater.java
index c47be3e..d498057 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/LongFieldUpdater.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/LongFieldUpdater.java
@@ -1,24 +1,8 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util.internal;
-/**
- * @author jiachun.fjc
- */
public interface LongFieldUpdater {
void set(final U obj, final long newValue);
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/ReferenceFieldUpdater.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/ReferenceFieldUpdater.java
index c646c87..4def0b1 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/ReferenceFieldUpdater.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/ReferenceFieldUpdater.java
@@ -1,24 +1,8 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util.internal;
-/**
- * @author jiachun.fjc
- */
public interface ReferenceFieldUpdater {
void set(final U obj, final W newValue);
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/ReflectionIntegerFieldUpdater.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/ReflectionIntegerFieldUpdater.java
index 1d3633f..69b562a 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/ReflectionIntegerFieldUpdater.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/ReflectionIntegerFieldUpdater.java
@@ -1,27 +1,10 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util.internal;
import java.lang.reflect.Field;
-/**
- *
- * @author jiachun.fjc
- */
final class ReflectionIntegerFieldUpdater implements IntegerFieldUpdater {
private final Field field;
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/ReflectionLongFieldUpdater.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/ReflectionLongFieldUpdater.java
index c6e3698..638dd30 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/ReflectionLongFieldUpdater.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/ReflectionLongFieldUpdater.java
@@ -1,27 +1,10 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util.internal;
import java.lang.reflect.Field;
-/**
- *
- * @author jiachun.fjc
- */
final class ReflectionLongFieldUpdater implements LongFieldUpdater {
private final Field field;
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/ReflectionReferenceFieldUpdater.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/ReflectionReferenceFieldUpdater.java
index c45cadd..e37c65f 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/ReflectionReferenceFieldUpdater.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/ReflectionReferenceFieldUpdater.java
@@ -1,27 +1,10 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util.internal;
import java.lang.reflect.Field;
-/**
- *
- * @author jiachun.fjc
- */
@SuppressWarnings("unchecked")
final class ReflectionReferenceFieldUpdater implements ReferenceFieldUpdater {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/ThrowUtil.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/ThrowUtil.java
index 14da6c6..c3fe329 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/ThrowUtil.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/ThrowUtil.java
@@ -1,25 +1,11 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util.internal;
/**
* Throwing tool.
*
- * @author jiachun.fjc
*/
public final class ThrowUtil {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/UnsafeIntegerFieldUpdater.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/UnsafeIntegerFieldUpdater.java
index 463b2ab..9514310 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/UnsafeIntegerFieldUpdater.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/UnsafeIntegerFieldUpdater.java
@@ -1,27 +1,10 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util.internal;
import java.lang.reflect.Field;
-/**
- *
- * @author jiachun.fjc
- */
@SuppressWarnings("PMD")
final class UnsafeIntegerFieldUpdater implements IntegerFieldUpdater {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/UnsafeLongFieldUpdater.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/UnsafeLongFieldUpdater.java
index 96a70aa..c2e0a64 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/UnsafeLongFieldUpdater.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/UnsafeLongFieldUpdater.java
@@ -1,27 +1,10 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util.internal;
import java.lang.reflect.Field;
-/**
- *
- * @author jiachun.fjc
- */
@SuppressWarnings("PMD")
final class UnsafeLongFieldUpdater implements LongFieldUpdater {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/UnsafeReferenceFieldUpdater.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/UnsafeReferenceFieldUpdater.java
index 528c28e..6b0ffae 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/UnsafeReferenceFieldUpdater.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/UnsafeReferenceFieldUpdater.java
@@ -1,27 +1,10 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util.internal;
import java.lang.reflect.Field;
-/**
- *
- * @author jiachun.fjc
- */
@SuppressWarnings({ "unchecked", "PMD" })
final class UnsafeReferenceFieldUpdater implements ReferenceFieldUpdater {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/UnsafeUtil.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/UnsafeUtil.java
index 0646b17..5d0e13c 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/UnsafeUtil.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/UnsafeUtil.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util.internal;
@@ -28,7 +15,6 @@
/**
* For the {@link sun.misc.Unsafe} access.
*
- * @author jiachun.fjc
*/
@SuppressWarnings({ "ConstantConditions", "PMD" })
public final class UnsafeUtil {
diff --git a/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/Updaters.java b/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/Updaters.java
index bcd4668..d7fe18e 100644
--- a/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/Updaters.java
+++ b/ceresdb-common/src/main/java/io/ceresdb/common/util/internal/Updaters.java
@@ -1,25 +1,11 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util.internal;
/**
* Sometime instead of reflection, better performance.
*
- * @author jiachun.fjc
*/
public class Updaters {
diff --git a/ceresdb-common/src/test/java/io/ceresdb/common/EndpointTest.java b/ceresdb-common/src/test/java/io/ceresdb/common/EndpointTest.java
index 3ce13fc..3c0d539 100644
--- a/ceresdb-common/src/test/java/io/ceresdb/common/EndpointTest.java
+++ b/ceresdb-common/src/test/java/io/ceresdb/common/EndpointTest.java
@@ -1,27 +1,11 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common;
import org.junit.Assert;
import org.junit.Test;
-/**
- * @author jiachun.fjc
- */
public class EndpointTest {
@Test
diff --git a/ceresdb-common/src/test/java/io/ceresdb/common/util/DirectExecutorTest.java b/ceresdb-common/src/test/java/io/ceresdb/common/util/DirectExecutorTest.java
index d9894ef..26600b6 100644
--- a/ceresdb-common/src/test/java/io/ceresdb/common/util/DirectExecutorTest.java
+++ b/ceresdb-common/src/test/java/io/ceresdb/common/util/DirectExecutorTest.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
@@ -21,9 +8,6 @@
import org.junit.Assert;
import org.junit.Test;
-/**
- * @author jiachun.fjc
- */
public class DirectExecutorTest {
@Test
diff --git a/ceresdb-common/src/test/java/io/ceresdb/common/util/ExecutorServiceHelperTest.java b/ceresdb-common/src/test/java/io/ceresdb/common/util/ExecutorServiceHelperTest.java
index 837c796..a75775d 100644
--- a/ceresdb-common/src/test/java/io/ceresdb/common/util/ExecutorServiceHelperTest.java
+++ b/ceresdb-common/src/test/java/io/ceresdb/common/util/ExecutorServiceHelperTest.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
@@ -22,9 +9,6 @@
import org.junit.Assert;
import org.junit.Test;
-/**
- * @author jiachun.fjc
- */
public class ExecutorServiceHelperTest {
@Test
diff --git a/ceresdb-common/src/test/java/io/ceresdb/common/util/RcObjectPoolTest.java b/ceresdb-common/src/test/java/io/ceresdb/common/util/RcObjectPoolTest.java
index 68acf7c..3e0656b 100644
--- a/ceresdb-common/src/test/java/io/ceresdb/common/util/RcObjectPoolTest.java
+++ b/ceresdb-common/src/test/java/io/ceresdb/common/util/RcObjectPoolTest.java
@@ -1,28 +1,11 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb.common.util;
import org.junit.Assert;
import org.junit.Test;
-/**
- *
- * @author jiachun.fjc
- */
public class RcObjectPoolTest {
static final ObjectPool.Resource
- org.apache.avro
- avro
+ com.github.luben
+ zstd-jni
+
+
+ org.apache.arrow
+ arrow-vector
+
+
+
+ org.apache.arrow
+ arrow-memory-unsafe
diff --git a/ceresdb-protocol/src/main/java/io/ceresdb/ArrayMapper.java b/ceresdb-protocol/src/main/java/io/ceresdb/ArrayMapper.java
deleted file mode 100644
index d29bf32..0000000
--- a/ceresdb-protocol/src/main/java/io/ceresdb/ArrayMapper.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package io.ceresdb;
-
-import java.util.List;
-import java.util.function.Function;
-
-import org.apache.avro.Schema;
-import org.apache.avro.generic.GenericRecord;
-
-/**
- * Map byte[] to Object[] by avro.
- *
- * @author jiachun.fjc
- */
-public class ArrayMapper extends AvroMapper implements Function {
-
- ArrayMapper(Schema schema) {
- super(schema);
- }
-
- public static ArrayMapper getMapper(final String s) {
- final Schema schema = new Schema.Parser().parse(s);
- return new ArrayMapper(schema);
- }
-
- @Override
- public Object[] apply(final byte[] bytes) {
- final GenericRecord record = mapTo(bytes);
- final List fields = record.getSchema().getFields();
- final Object[] objects = new Object[fields.size()];
- int i = 0;
- for (final Schema.Field f : fields) {
- objects[i++] = record.get(f.name());
- }
- return objects;
- }
-}
diff --git a/ceresdb-protocol/src/main/java/io/ceresdb/AvroMapper.java b/ceresdb-protocol/src/main/java/io/ceresdb/AvroMapper.java
deleted file mode 100644
index 7ae9732..0000000
--- a/ceresdb-protocol/src/main/java/io/ceresdb/AvroMapper.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package io.ceresdb;
-
-import java.io.IOException;
-
-import org.apache.avro.AvroRuntimeException;
-import org.apache.avro.Schema;
-import org.apache.avro.generic.GenericDatumReader;
-import org.apache.avro.generic.GenericRecord;
-import org.apache.avro.io.BinaryDecoder;
-import org.apache.avro.io.DatumReader;
-import org.apache.avro.io.DecoderFactory;
-
-/**
- * Avro mapper tool.
- *
- * @author jiachun.fjc
- */
-public class AvroMapper {
- private final Schema schema;
- private BinaryDecoder reuseDecoder;
-
- public AvroMapper(Schema schema) {
- this.schema = schema;
- }
-
- public GenericRecord mapTo(final byte[] bytes) {
- final DatumReader reader = new GenericDatumReader<>(this.schema);
- final BinaryDecoder decoder = DecoderFactory.get().binaryDecoder(bytes, this.reuseDecoder);
- if (this.reuseDecoder == null) {
- this.reuseDecoder = decoder;
- }
- try {
- return reader.read(null, decoder);
- } catch (final IOException e) {
- throw new AvroRuntimeException(e);
- }
- }
-}
diff --git a/ceresdb-protocol/src/main/java/io/ceresdb/BlockingStreamIterator.java b/ceresdb-protocol/src/main/java/io/ceresdb/BlockingStreamIterator.java
index 7b825c6..578ee93 100644
--- a/ceresdb-protocol/src/main/java/io/ceresdb/BlockingStreamIterator.java
+++ b/ceresdb-protocol/src/main/java/io/ceresdb/BlockingStreamIterator.java
@@ -1,18 +1,5 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb;
@@ -23,34 +10,33 @@
import java.util.stream.Stream;
import io.ceresdb.errors.IteratorException;
-import io.ceresdb.models.QueryOk;
-import io.ceresdb.models.Record;
+import io.ceresdb.models.SqlQueryOk;
+import io.ceresdb.models.Row;
import io.ceresdb.rpc.Observer;
/**
* A blocking iterator, the `hasNext` method will be blocked until
* the server returns data or the process ends.
*
- * @author jiachun.fjc
*/
-public class BlockingStreamIterator implements Iterator> {
+public class BlockingStreamIterator implements Iterator> {
- private static final QueryOk EOF = QueryOk.emptyOk();
+ private static final SqlQueryOk EOF = SqlQueryOk.emptyOk();
private final long timeout;
private final TimeUnit unit;
private final BlockingQueue staging = new LinkedBlockingQueue<>();
- private final Observer observer;
- private QueryOk next;
+ private final Observer observer;
+ private SqlQueryOk next;
public BlockingStreamIterator(long timeout, TimeUnit unit) {
this.timeout = timeout;
this.unit = unit;
- this.observer = new Observer() {
+ this.observer = new Observer() {
@Override
- public void onNext(final QueryOk value) {
+ public void onNext(final SqlQueryOk value) {
staging.offer(value);
}
@@ -83,7 +69,7 @@ public boolean hasNext() {
return reject("Stream iterator got an error", (Throwable) v);
}
- this.next = (QueryOk) v;
+ this.next = (SqlQueryOk) v;
return this.next != EOF;
} catch (final InterruptedException e) {
@@ -93,7 +79,7 @@ public boolean hasNext() {
}
@Override
- public Stream next() {
+ public Stream next() {
if (this.next == null) {
return reject("Null `next` element");
}
@@ -102,10 +88,10 @@ public Stream next() {
return reject("Reaches the end of the iterator");
}
- return this.next.mapToRecord();
+ return this.next.stream();
}
- public Observer getObserver() {
+ public Observer getObserver() {
return this.observer;
}
diff --git a/ceresdb-protocol/src/main/java/io/ceresdb/CeresDBClient.java b/ceresdb-protocol/src/main/java/io/ceresdb/CeresDBClient.java
index 0f575e6..08af871 100644
--- a/ceresdb-protocol/src/main/java/io/ceresdb/CeresDBClient.java
+++ b/ceresdb-protocol/src/main/java/io/ceresdb/CeresDBClient.java
@@ -1,23 +1,9 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
*/
package io.ceresdb;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
@@ -37,13 +23,14 @@
import io.ceresdb.common.util.MetricExecutor;
import io.ceresdb.common.util.MetricsUtil;
import io.ceresdb.models.Err;
-import io.ceresdb.models.QueryOk;
-import io.ceresdb.models.QueryRequest;
+import io.ceresdb.models.Point;
+import io.ceresdb.models.RequestContext;
+import io.ceresdb.models.SqlQueryOk;
+import io.ceresdb.models.SqlQueryRequest;
import io.ceresdb.models.Result;
-import io.ceresdb.models.Rows;
import io.ceresdb.models.WriteOk;
+import io.ceresdb.models.WriteRequest;
import io.ceresdb.options.CeresDBOptions;
-import io.ceresdb.options.ManagementOptions;
import io.ceresdb.options.QueryOptions;
import io.ceresdb.options.RouterOptions;
import io.ceresdb.options.WriteOptions;
@@ -52,13 +39,16 @@
import io.ceresdb.rpc.RpcClient;
import io.ceresdb.rpc.RpcFactoryProvider;
import io.ceresdb.rpc.RpcOptions;
+import io.ceresdb.util.RpcServiceRegister;
+import io.ceresdb.util.StreamWriteBuf;
+import io.ceresdb.util.Utils;
+
import com.codahale.metrics.Counter;
import com.codahale.metrics.Meter;
/**
* CeresDB client.
*
- * @author jiachun.fjc
*/
public class CeresDBClient implements Write, Query, Lifecycle, Display {
@@ -77,9 +67,7 @@ public class CeresDBClient implements Write, Query, Lifecycle, D
private RouterClient routerClient;
private WriteClient writeClient;
private QueryClient queryClient;
- // CeresDBClient is only intended to manage the instance and does not
- // intend to broker any of its behavior
- private Management management;
+
// Note: We do not close it to free resources, as we view it as shared
private Executor asyncWritePool;
private Executor asyncReadPool;
@@ -112,7 +100,6 @@ public boolean init(final CeresDBOptions opts) {
this.asyncReadPool = withMetricPool(this.opts.getAsyncReadPool(), "async_read_pool.time");
this.writeClient = initWriteClient(this.opts, this.routerClient, this.asyncWritePool);
this.queryClient = initQueryClient(this.opts, this.routerClient, this.asyncReadPool);
- this.management = initManagementClient(this.opts, this.routerClient);
INSTANCES.put(this.id, this);
@@ -139,10 +126,6 @@ public void shutdownGracefully() {
this.routerClient.shutdownGracefully();
}
- if (this.management != null) {
- this.management.shutdownGracefully();
- }
-
INSTANCES.remove(this.id);
}
@@ -155,44 +138,31 @@ public void ensureInitialized() {
}
@Override
- public CompletableFuture> write(final Collection data, final Context ctx) {
+ public CompletableFuture> write(final WriteRequest req, final Context ctx) {
ensureInitialized();
- return this.writeClient.write(data, attachCtx(ctx));
+ return this.writeClient.write(req, attachCtx(ctx));
}
@Override
- public StreamWriteBuf streamWrite(final String metric, final Context ctx) {
+ public StreamWriteBuf streamWrite(RequestContext reqCtx, final String table, final Context ctx) {
ensureInitialized();
- return this.writeClient.streamWrite(metric, attachCtx(ctx));
+ return this.writeClient.streamWrite(reqCtx, table, attachCtx(ctx));
}
@Override
- public CompletableFuture> query(final QueryRequest req, final Context ctx) {
+ public CompletableFuture> sqlQuery(final SqlQueryRequest req, final Context ctx) {
ensureInitialized();
- return this.queryClient.query(req, attachCtx(ctx));
+ return this.queryClient.sqlQuery(req, attachCtx(ctx));
}
@Override
- public void streamQuery(final QueryRequest req, final Context ctx, final Observer observer) {
+ public void streamSqlQuery(final SqlQueryRequest req, final Context ctx, final Observer observer) {
ensureInitialized();
- this.queryClient.streamQuery(req, attachCtx(ctx), observer);
+ this.queryClient.streamSqlQuery(req, attachCtx(ctx), observer);
}
- public boolean hasManagement() {
- return this.management != null;
- }
-
- public Management management() {
- return this.management;
- }
-
- private Executor withMetricPool(final Executor pool, final String name) {
- return pool == null ? null : new MetricExecutor(pool, name);
- }
-
- private Context attachCtx(final Context ctx) {
- final Context c = ctx == null ? Context.newDefault() : ctx;
- return c.with(ID_KEY, id()).with(VERSION_KEY, version());
+ public static List instances() {
+ return new ArrayList<>(INSTANCES.values());
}
public int id() {
@@ -203,26 +173,10 @@ public String version() {
return VERSION;
}
- public Executor asyncWritePool() {
- return this.asyncWritePool;
- }
-
- public Executor asyncReadPool() {
- return this.asyncReadPool;
- }
-
public RouterClient routerClient() {
return this.routerClient;
}
- public WriteClient writeClient() {
- return this.writeClient;
- }
-
- public QueryClient queryClient() {
- return this.queryClient;
- }
-
@Override
public void display(final Printer out) {
out.println("--- CeresDBClient ---") //
@@ -232,8 +186,8 @@ public void display(final Printer out) {
.println(version()) //
.print("clusterAddress=") //
.println(this.opts.getClusterAddress()) //
- .print("tenant=") //
- .println(this.opts.getTenant().getTenant()) //
+ .print("database=") //
+ .println(this.opts.getDatabase()) //
.print("userAsyncWritePool=") //
.println(this.opts.getAsyncWritePool()) //
.print("userAsyncReadPool=") //
@@ -254,11 +208,6 @@ public void display(final Printer out) {
this.queryClient.display(out);
}
- if (this.management != null) {
- out.println("");
- this.management.display(out);
- }
-
out.println("");
}
@@ -266,7 +215,7 @@ public void display(final Printer out) {
public String toString() {
return "CeresDBClient{" + //
"id=" + id + //
- "version=" + version() + //
+ ", version=" + version() + //
", started=" + started + //
", opts=" + opts + //
", writeClient=" + writeClient + //
@@ -275,13 +224,17 @@ public String toString() {
'}';
}
- public static List instances() {
- return new ArrayList<>(INSTANCES.values());
+ private Executor withMetricPool(final Executor pool, final String name) {
+ return pool == null ? null : new MetricExecutor(pool, name);
+ }
+
+ private Context attachCtx(final Context ctx) {
+ final Context c = ctx == null ? Context.newDefault() : ctx;
+ return c.with(ID_KEY, id()).with(VERSION_KEY, version());
}
private static RpcClient initRpcClient(final CeresDBOptions opts) {
final RpcOptions rpcOpts = opts.getRpcOptions();
- rpcOpts.setTenant(opts.getTenant());
final RpcClient rpcClient = RpcFactoryProvider.getRpcFactory().createRpcClient();
if (!rpcClient.init(rpcOpts)) {
throw new IllegalStateException("Fail to start RPC client");
@@ -293,8 +246,18 @@ private static RpcClient initRpcClient(final CeresDBOptions opts) {
private static RouterClient initRouteClient(final CeresDBOptions opts, final RpcClient rpcClient) {
final RouterOptions routerOpts = opts.getRouterOptions();
routerOpts.setRpcClient(rpcClient);
- final RouterClient routerClient = routerOpts.getRouteMode().equals(RouteMode.CLUSTER) ? new RouterClient() :
- new StandaloneRouterClient();
+
+ RouterClient routerClient;
+ switch (routerOpts.getRouteMode()) {
+ case DIRECT:
+ routerClient = new RouterClient();
+ break;
+ case PROXY:
+ routerClient = new ProxyRouterClient();
+ break;
+ default:
+ throw new IllegalArgumentException("Invalid Route mode " + routerOpts.getRouteMode());
+ }
if (!routerClient.init(routerOpts)) {
throw new IllegalStateException("Fail to start router client");
}
@@ -305,6 +268,7 @@ private static WriteClient initWriteClient(final CeresDBOptions opts, //
final RouterClient routerClient, //
final Executor asyncPool) {
final WriteOptions writeOpts = opts.getWriteOptions();
+ writeOpts.setDatabase(opts.getDatabase());
writeOpts.setRoutedClient(routerClient);
writeOpts.setAsyncPool(asyncPool);
final WriteClient writeClient = new WriteClient();
@@ -318,6 +282,7 @@ private static QueryClient initQueryClient(final CeresDBOptions opts, //
final RouterClient routerClient, //
final Executor asyncPool) {
final QueryOptions queryOpts = opts.getQueryOptions();
+ queryOpts.setDatabase(opts.getDatabase());
queryOpts.setRouterClient(routerClient);
queryOpts.setAsyncPool(asyncPool);
final QueryClient queryClient = new QueryClient();
@@ -327,22 +292,6 @@ private static QueryClient initQueryClient(final CeresDBOptions opts, //
return queryClient;
}
- private static Management initManagementClient(final CeresDBOptions opts, final RouterClient routerClient) {
- final ManagementOptions mOpts = opts.getManagementOptions();
- if (mOpts == null) {
- return null;
- }
- if (!CeresDBManagementProvider.hasManagement()) {
- return null;
- }
- final Management management = CeresDBManagementProvider.createManagement();
- mOpts.setRouterClient(routerClient);
- if (!management.init(mOpts)) {
- return null;
- }
- return management;
- }
-
private static String loadVersion() {
try {
return Utils //
diff --git a/ceresdb-protocol/src/main/java/io/ceresdb/CeresDBManagementProvider.java b/ceresdb-protocol/src/main/java/io/ceresdb/CeresDBManagementProvider.java
deleted file mode 100644
index 148ae38..0000000
--- a/ceresdb-protocol/src/main/java/io/ceresdb/CeresDBManagementProvider.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package io.ceresdb;
-
-import io.ceresdb.common.util.Requires;
-import io.ceresdb.common.util.ServiceLoader;
-
-/**
- *
- * @author jiachun.fjc
- */
-final class CeresDBManagementProvider {
-
- private static final Class MANAGEMENT_CLS;
-
- static {
- Class _managementCls;
- try {
- _managementCls = ServiceLoader.load(Management.class).firstClass();
- } catch (final Throwable ignored) {
- _managementCls = null;
- }
- MANAGEMENT_CLS = _managementCls;
- }
-
- static boolean hasManagement() {
- return MANAGEMENT_CLS != null;
- }
-
- static Management createManagement() {
- Requires.requireTrue(hasManagement(), "Do not have a management!");
- try {
- return MANAGEMENT_CLS.newInstance();
- } catch (final Throwable t) {
- throw new IllegalStateException("Fail to create management instance", t);
- }
- }
-}
diff --git a/ceresdb-protocol/src/main/java/io/ceresdb/Management.java b/ceresdb-protocol/src/main/java/io/ceresdb/Management.java
deleted file mode 100644
index bbd8a71..0000000
--- a/ceresdb-protocol/src/main/java/io/ceresdb/Management.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package io.ceresdb;
-
-import io.ceresdb.common.Display;
-import io.ceresdb.common.Lifecycle;
-import io.ceresdb.models.SqlResult;
-import io.ceresdb.options.ManagementOptions;
-import io.ceresdb.rpc.Context;
-
-/**
- * CeresDB client for management API.
- *
- * @author jiachun.fjc
- */
-public interface Management extends Lifecycle, Display {
-
- /**
- * @see #executeSql(boolean, Context, String, Object...)
- */
- default SqlResult executeSql(final String fmtSql, final Object... args) {
- return executeSql(true, Context.newDefault(), fmtSql, args);
- }
-
- /**
- * Execute a SQL.
- *
- * CREATE TABLE:
- * ```
- * CREATE TABLE my_first_table(
- * ts TIMESTAMP NOT NULL,
- * c1 STRING TAG NOT NULL,
- * c2 STRING TAG NOT NULL,
- * c3 DOUBLE NULL,
- * c4 STRING NULL,
- * c5 INT64 NULL,
- * c6 FLOAT NULL,
- * c7 INT32 NULL,
- * c8 INT16 NULL,
- * c9 INT8 NULL,
- * c10 BOOLEAN NULL,
- * c11 UINT64 NULL,
- * c12 UINT32 NULL,
- * c13 UINT16 NULL,
- * c14 UINT8 NULL,
- * c15 TIMESTAMP NULL,
- * c16 VARBINARY NULL,
- * TIMESTAMP KEY(ts)
- * ) ENGINE=Analytic
- * ```
- *
- * DESCRIBE TABLE:
- * ```
- * DESCRIBE TABLE my_table
- * ```
- *
- * @param autoRouting automatic routing to server
- * @param ctx the invoke context, will automatically be placed in HTTP Headers
- * @param fmtSql format sql string
- * @param args arguments referenced by the format specifiers in the format
- * sql string. If there are more arguments than format specifiers,
- * the extra arguments are ignored. The number of arguments is
- * variable and may be zero.
- * @return the sql result.
- */
- SqlResult executeSql(final boolean autoRouting, final Context ctx, final String fmtSql, final Object... args);
-}
diff --git a/ceresdb-protocol/src/main/java/io/ceresdb/MetricParserFactory.java b/ceresdb-protocol/src/main/java/io/ceresdb/MetricParserFactory.java
deleted file mode 100644
index 36eb954..0000000
--- a/ceresdb-protocol/src/main/java/io/ceresdb/MetricParserFactory.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package io.ceresdb;
-
-/**
- *
- * @author jiachun.fjc
- */
-public interface MetricParserFactory {
-
- MetricParserFactory DEFAULT = new NoopFactory();
-
- MetricParser getParser(final String ql);
-
- class NoopFactory implements MetricParserFactory {
-
- @Override
- public MetricParser getParser(final String ql) {
- return MetricParser.DEFAULT;
- }
- }
-}
diff --git a/ceresdb-protocol/src/main/java/io/ceresdb/MetricParserFactoryProvider.java b/ceresdb-protocol/src/main/java/io/ceresdb/MetricParserFactoryProvider.java
deleted file mode 100644
index 9a33971..0000000
--- a/ceresdb-protocol/src/main/java/io/ceresdb/MetricParserFactoryProvider.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package io.ceresdb;
-
-import io.ceresdb.common.util.ServiceLoader;
-
-/**
- *
- * @author jiachun.fjc
- */
-public class MetricParserFactoryProvider {
-
- private static final MetricParserFactory METRIC_PARSER_FACTORY = ServiceLoader //
- .load(MetricParserFactory.class) //
- .firstOrDefault(() -> MetricParserFactory.DEFAULT);
-
- public static MetricParserFactory getMetricParserFactory() {
- return METRIC_PARSER_FACTORY;
- }
-}
diff --git a/ceresdb-protocol/src/main/java/io/ceresdb/ProxyRouterClient.java b/ceresdb-protocol/src/main/java/io/ceresdb/ProxyRouterClient.java
new file mode 100644
index 0000000..87cc6a2
--- /dev/null
+++ b/ceresdb-protocol/src/main/java/io/ceresdb/ProxyRouterClient.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.
+ */
+package io.ceresdb;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+
+import io.ceresdb.models.RequestContext;
+import io.ceresdb.util.Utils;
+
+/**
+ * A route rpc client which implement RouteMode.Proxy
+ *
+ * cached nothing about table information, and return
+ * clusterAddress directly
+ */
+public class ProxyRouterClient extends RouterClient {
+
+ @Override
+ public CompletableFuture