Skip to content

Commit

Permalink
update default config properties (#575)
Browse files Browse the repository at this point in the history
1. update cache options
2. add default config for hbase
3. make mysql's SSL configuration effective
  • Loading branch information
imbajin authored and javeme committed Jun 24, 2019
1 parent af671fc commit 7e3795b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
18 changes: 14 additions & 4 deletions hugegraph-dist/src/assembly/static/conf/hugegraph.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
gremlin.graph=com.baidu.hugegraph.HugeFactory

# cache config
#schema.cache_capacity=1048576
#graph.cache_capacity=10485760
#graph.cache_expire=600
#schema.cache_capacity=100000
# vertex-cache default is 1000w, 10min expired
#vertex.cache_capacity=10000000
#vertex.cache_expire=600
# edge-cache default is 100w, 10min expired
#edge.cache_capacity=1000000
#edge.cache_expire=600


# schema illegal name template
#schema.illegal_name_regex=\s+|~.*
Expand All @@ -31,6 +36,11 @@ cassandra.password=
#cassandra.keyspace.strategy=SimpleStrategy
#cassandra.keyspace.replication=3

# hbase backend config
#hbase.hosts=localhost
#hbase.port=2181
#hbase.znode_parent=/hbsae
#hbase.threads_max=64

# mysql backend config
#jdbc.driver=com.mysql.jdbc.Driver
Expand All @@ -39,7 +49,7 @@ cassandra.password=
#jdbc.password=
#jdbc.reconnect_max_times=3
#jdbc.reconnect_interval=3
#jdbc.sslmode=disable
#jdbc.sslmode=false

# palo backend config
#palo.host=127.0.0.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ public static synchronized MysqlOptions instance() {
3
);

public static final ConfigOption<String> SSL_MODE =
public static final ConfigOption<String> JDBC_SSL_MODE =
new ConfigOption<>(
"jdbc.ssl_mode",
"The SSL mode of connections with database.",
disallowEmpty(),
"disable"
"false"
);

public static final ConfigOption<String> STORAGE_ENGINE =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,11 @@ private Connection open(boolean autoReconnect) throws SQLException {

int maxTimes = this.config.get(MysqlOptions.JDBC_RECONNECT_MAX_TIMES);
int interval = this.config.get(MysqlOptions.JDBC_RECONNECT_INTERVAL);
String sslMode = this.config.get(MysqlOptions.JDBC_SSL_MODE);

URIBuilder uriBuilder = this.newConnectionURIBuilder();
uriBuilder.setPath(url)
.setParameter("useSSL", sslMode)
.setParameter("characterEncoding", "utf-8")
.setParameter("rewriteBatchedStatements", "true")
.setParameter("useServerPrepStmts", "false")
Expand Down

0 comments on commit 7e3795b

Please sign in to comment.