|
@@ -38,7 +38,9 @@ public class DBApiEntry implements AutoCloseable {
|
|
|
|
|
|
private static final double VALUE_INVALID = Double.NaN;
|
|
private static final double VALUE_INVALID = Double.NaN;
|
|
// private static final double VALUE_INVALID = -10000;
|
|
// private static final double VALUE_INVALID = -10000;
|
|
- private final static String TABLE_NAME = "tsdb_cpp";
|
|
|
|
|
|
+ private final static String TABLE_NAME = "tsdb_cpp_dist";
|
|
|
|
+ // ClickHouse HTTP port + 1
|
|
|
|
+ private final static int DEFAULT_PORT = 8124;
|
|
private final Client client;
|
|
private final Client client;
|
|
private String host;
|
|
private String host;
|
|
private int port;
|
|
private int port;
|
|
@@ -66,6 +68,10 @@ public class DBApiEntry implements AutoCloseable {
|
|
secureCertPath = certPath;
|
|
secureCertPath = certPath;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public DBApiEntry(String addressHost) throws IOException {
|
|
|
|
+ this(addressHost, DEFAULT_PORT, "default", TABLE_NAME);
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 初始化数据驱动构造方法
|
|
* 初始化数据驱动构造方法
|
|
*
|
|
*
|
|
@@ -114,6 +120,10 @@ public class DBApiEntry implements AutoCloseable {
|
|
client.register(StckPointVal.class, schema);
|
|
client.register(StckPointVal.class, schema);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public static DBApiEntry initApiEntry(String addressHost) {
|
|
|
|
+ return initApiEntry(addressHost, DEFAULT_PORT, "default", TABLE_NAME);
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 静态方法初始化时序数据源驱动类
|
|
* 静态方法初始化时序数据源驱动类
|
|
*
|
|
*
|