@@ -65,6 +65,7 @@ | |||||
<dependency> | <dependency> | ||||
<groupId>org.rocksdb</groupId> | <groupId>org.rocksdb</groupId> | ||||
<artifactId>rocksdbjni</artifactId> | <artifactId>rocksdbjni</artifactId> | ||||
<version>${rocksdb.version}</version> | |||||
</dependency> | </dependency> | ||||
<dependency> | <dependency> | ||||
@@ -67,7 +67,7 @@ | |||||
<disruptor.version>3.3.6</disruptor.version> | <disruptor.version>3.3.6</disruptor.version> | ||||
<kryo.version>3.0.1</kryo.version> | <kryo.version>3.0.1</kryo.version> | ||||
<jedis.version>2.9.0</jedis.version> | <jedis.version>2.9.0</jedis.version> | ||||
<rocksdb.version>5.15.10</rocksdb.version> | |||||
<rocksdb.version>6.3.6</rocksdb.version> | |||||
<zookeeper.version>3.4.6</zookeeper.version> | <zookeeper.version>3.4.6</zookeeper.version> | ||||
<javaparser.version>3.5.12</javaparser.version> | <javaparser.version>3.5.12</javaparser.version> | ||||
<ehcache.version>3.5.3</ehcache.version> | <ehcache.version>3.5.3</ehcache.version> | ||||
@@ -56,7 +56,7 @@ | |||||
<!--<dependency> | <!--<dependency> | ||||
<groupId>org.rocksdb</groupId> | <groupId>org.rocksdb</groupId> | ||||
<artifactId>rocksdbjni</artifactId> | <artifactId>rocksdbjni</artifactId> | ||||
<version>5.15.10</version> | |||||
<version>${rocksdb.version}</version> | |||||
</dependency>--> | </dependency>--> | ||||
<!--<dependency> | <!--<dependency> | ||||
<groupId>redis.clients</groupId> | <groupId>redis.clients</groupId> | ||||
@@ -25,6 +25,7 @@ | |||||
<dependency> | <dependency> | ||||
<groupId>org.rocksdb</groupId> | <groupId>org.rocksdb</groupId> | ||||
<artifactId>rocksdbjni</artifactId> | <artifactId>rocksdbjni</artifactId> | ||||
<version>${rocksdb.version}</version> | |||||
</dependency> | </dependency> | ||||
<dependency> | <dependency> | ||||
@@ -38,7 +39,7 @@ | |||||
<!-- <dependency> | <!-- <dependency> | ||||
<groupId>org.rocksdb</groupId> | <groupId>org.rocksdb</groupId> | ||||
<artifactId>rocksdbjni-osx</artifactId> | <artifactId>rocksdbjni-osx</artifactId> | ||||
<version>5.15.10</version> | |||||
<version>${rocksdb.version}</version> | |||||
</dependency> --> | </dependency> --> | ||||
</dependencies> | </dependencies> | ||||
</project> | </project> |
@@ -26,7 +26,7 @@ public class RocksDBConnectionFactory implements DbConnectionFactory { | |||||
public static final String URI_SCHEME = "rocksdb"; | public static final String URI_SCHEME = "rocksdb"; | ||||
public static final Pattern URI_PATTER = Pattern | public static final Pattern URI_PATTER = Pattern | ||||
.compile("^\\w+\\://(/)?\\w+(/.*)*$"); | |||||
.compile("^\\w+\\://(/)?\\w+(\\:)?([/\\\\].*)*$"); | |||||
private Map<String, RocksDBConnection> connections = new ConcurrentHashMap<>(); | private Map<String, RocksDBConnection> connections = new ConcurrentHashMap<>(); | ||||
@@ -40,7 +40,7 @@ public class RocksDBConnectionFactory implements DbConnectionFactory { | |||||
if (!URI_PATTER.matcher(dbConnectionString).matches()) { | if (!URI_PATTER.matcher(dbConnectionString).matches()) { | ||||
throw new IllegalArgumentException("Illegal format of rocksdb connection string!"); | throw new IllegalArgumentException("Illegal format of rocksdb connection string!"); | ||||
} | } | ||||
URI dbUri = URI.create(dbConnectionString); | |||||
URI dbUri = URI.create(dbConnectionString.replace("\\", "/")); | |||||
if (!support(dbUri.getScheme())) { | if (!support(dbUri.getScheme())) { | ||||
throw new IllegalArgumentException( | throw new IllegalArgumentException( | ||||
String.format("Not supported db connection string with scheme \"%s\"!", dbUri.getScheme())); | String.format("Not supported db connection string with scheme \"%s\"!", dbUri.getScheme())); | ||||
@@ -49,9 +49,6 @@ public class RocksDBConnectionFactory implements DbConnectionFactory { | |||||
String uriHead = dbPrefix(); | String uriHead = dbPrefix(); | ||||
int beginIndex = dbConnectionString.indexOf(uriHead); | int beginIndex = dbConnectionString.indexOf(uriHead); | ||||
String dbPath = dbConnectionString.substring(beginIndex + uriHead.length()); | String dbPath = dbConnectionString.substring(beginIndex + uriHead.length()); | ||||
if (!dbPath.startsWith(File.separator)) { | |||||
dbPath = File.separator + dbPath; | |||||
} | |||||
RocksDBConnection conn = connections.get(dbPath); | RocksDBConnection conn = connections.get(dbPath); | ||||
if (conn != null) { | if (conn != null) { | ||||