tonivade / claudb Goto Github PK
View Code? Open in Web Editor NEWClauDB is a REDIS implementation in Java
License: MIT License
ClauDB is a REDIS implementation in Java
License: MIT License
Hi folks, was just wondering if you are open to contributions?
If yes, is there a guide?
Implement the set of command for geospatial indexes
I am trying to add multiple members to a set but from your code, apparently, you do not handle it.
SADD mykey member1 member2 member3
or with Jedis:
jedis.sadd("mykey", "member1", "member2", "member3")
both return cardinality 1 (expected 3)
When using claudb for tests I get an SLF4J error complaining about multiple bindings on the classpath:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/me/.m2/repository/org/slf4j/slf4j-nop/1.7.30/slf4j-nop-1.7.30.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/me/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
mvn dependency:tree
tells me that claudb depends on resp-server which depends on logback.
[INFO] \- com.github.tonivade:claudb:jar:1.7.1:compile
[INFO] +- com.github.tonivade:resp-server:jar:0.16.0:compile
[INFO] | +- io.netty:netty-all:jar:4.1.47.Final:compile
[INFO] | +- io.reactivex.rxjava3:rxjava:jar:3.0.0:compile
[INFO] | +- com.github.tonivade:purefun-core:jar:1.8:compile
[INFO] | | \- com.github.tonivade:purefun-annotation:jar:1.8:compile
[INFO] | \- ch.qos.logback:logback-classic:jar:1.2.3:runtime
[INFO] | \- ch.qos.logback:logback-core:jar:1.2.3:runtime
Can logback be replaced with slf4j-api?
hi, when I test
jedis.eval("if redis.call('get',KEYS[1]) == ARGV[1] then return redis.call('del',KEYS[1]) else return 0 end", Collections.singletonList("key"), Collections.singletonList("value"))
an error got...
org.luaj.vm2.LuaError: script:1 vm error: java.lang.NullPointerException
Implements these commands
Hi
After attempting to bump our claudb dependency from 2.0.1 to 2.1 one of our unit test started failing on what looks like a bug somewhere in lpush
/rpush
/lpop
/rpop
commands.
Simple reproducer (can be copied directly into ClauDBServerTest):
@Test
public void testPushPull() {
execute(jedis -> {
long push = jedis.rpush("key", "val1", "val2");
String pop1 = jedis.rpop("key");
String pop2 = jedis.rpop("key");
assertThat(push, is(2l));
assertThat(pop1, equalTo("val2"));
assertThat(pop2, equalTo("val1"));
});
}
It fails on the last assert where pop2
is null
instead of expected val1.
I checked the changes and the lpush
and rpush
commands were both changed, so I would expect a bug was introduced here.
When I start claudb with persistence enabled and then I quit claudb (and I can see both AOF and RDB files in the directory) , once restarted it looks like claudb overwrite the old files and in this way everything cached in the past is lost
It seems there are some incompatibilities in some java.nio.ByteBuffer methods in java 8 and java 11.
When you use cross compilation with java 11 to java 8, like in this project, the byte code generated is incorrect and not compatible with java 8.
java.lang.NoSuchMethodError: java.nio.ByteBuffer.rewind()Ljava/nio/ByteBuffer;
at com.github.tonivade.resp.protocol.SafeString.append(SafeString.java:106)
at com.github.tonivade.claudb.command.string.AppendCommand.lambda$execute$0(AppendCommand.java:32)
at com.github.tonivade.claudb.data.Database.merge(Database.java:78)
at com.github.tonivade.claudb.command.string.AppendCommand.execute(AppendCommand.java:30)
at com.github.tonivade.claudb.command.DBCommandWrapper.executeDBCommand(DBCommandWrapper.java:94)
at com.github.tonivade.claudb.command.DBCommandWrapper.execute(DBCommandWrapper.java:82)
at com.github.tonivade.claudb.command.CommandRule.execute(CommandRule.java:133)
at com.github.tonivade.claudb.command.string.AppendCommandTest.testExecute(AppendCommandTest.java:24)
by: java.io.IOException: not supported: 172
at com.github.tonivade.claudb.persistence.RDBInputStream.parse(RDBInputStream.java:116)
at com.github.tonivade.claudb.DBServerState.importRDB(DBServerState.java:107)
at com.github.tonivade.claudb.ClauDB.lambda$importRDB$2(ClauDB.java:136)
at io.reactivex.internal.operators.observable.ObservableCreate.subscribeActual(ObservableCreate.java:40)
at io.reactivex.Observable.subscribe(Observable.java:12284)
at io.reactivex.internal.operators.observable.ObservableObserveOn.subscribeActual(ObservableObserveOn.java:45)
at io.reactivex.Observable.subscribe(Observable.java:12284)
at io.reactivex.internal.operators.observable.ObservableBlockingSubscribe.subscribe(ObservableBlockingSubscribe.java:81)
... 20 common frames omitted
Jedis version: 2.9.0
Resp-server 0.10.0
Netty: 4.1.24
claudb: 1.2.0
Caused by: redis.clients.jedis.exceptions.JedisConnectionException: Unexpected end of stream.
at redis.clients.util.RedisInputStream.ensureFill(RedisInputStream.java:199)
at redis.clients.util.RedisInputStream.readByte(RedisInputStream.java:40)
at redis.clients.jedis.Protocol.process(Protocol.java:151)
at redis.clients.jedis.Protocol.read(Protocol.java:215)
at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:340)
at redis.clients.jedis.Connection.getBinaryBulkReply(Connection.java:259)
at redis.clients.jedis.BinaryJedis.rpop(BinaryJedis.java:1260)
at redis.clients.jedis.BinaryShardedJedis.rpop(BinaryShardedJedis.java:303)
Have the ability to support sentinel commands and implements (maybe partially) its functionality.
ClauDB's SHA1 hash is essentially the uppercase of version of the hash that RedisTemplate calculates, which I presume is what Redis also generates. For greater compatibility
with Redis can or even should the SHA1 hashes be the same.
So, it has to save the access time to every key, and also has a process to remove key by this field.
https://redis.io/commands/hscan/
When using Redisson with ClauDB:
org.redisson.client.RedisException: ERR unknown command 'HSCAN'. channel: [id: 0x1b56c5bb, L:/127.0.0.1:54510 - R:127.0.0.1/127.0.0.1:6379] command: (HSCAN), promise: java.util.concurrent.CompletableFuture@3a653de6[Not completed, 1 dependents], params: [JUnit_SESSION_MAP, 0, COUNT, 10]
keyspace events bad info
1) "psubscribe"
2) "__key*__:*"
3) (integer) 1
1) "pmessage"
2) "__key*__:*"
3) "__keyevent__@0__:a"
4) "set"
1) "pmessage"
2) "__key*__:*"
3) "__keyspace__@0__:set"
4) "set"
expected
1) "psubscribe"
2) "__key*__:*"
3) (integer) 1
1) "pmessage"
2) "__key*__:*"
3) "__keyspace@0__:a"
4) "set"
1) "pmessage"
2) "__key*__:*"
3) "__keyevent@0__:set"
4) "a"
If you are using claudb, It would be awesome if you tell me how you are using it.
If you want to help me, please write a comment to this issue with this information.
Thanks a lot!
If you want to run quickly in console the server, you need to checkout the source code, generate the fat jar manually.
It would be nice to have this artifact deployed in maven
Take a look to this link
https://medium.com/graalvm/instant-netty-startup-using-graalvm-native-image-generation-ed6f14ff7692
Add support to lua scripting, compatible with redis, or add new scripting capabilities like javascript, jruby and jithon.
When a key has expired, it's still there
127.0.0.1:7081> keys *
1) "b"
2) "a"
But keys a and b has been expired
127.0.0.1:7081> get a
(nil)
127.0.0.1:7081> get b
(nil)
127.0.0.1:7081> keys *
TinyDB needs a process to remove expired keys before accessing keys
Implements the data structure bitset and it's related commands setbit, getbit, etc...
Collection data types are saved inside TinyDB using this backends:
java.util.LinkedList
java.util.LInkedHashSet
SortedSet
implementationjava.util.LinkedHashMap
The objective is replace each collection with it's counterparts in vavr library
io.vavr.collection.LinkedList
io.vavr.collection.LinkedHashSet
io.vavr.collection.LinkedHashMap
The exception is SortedSet
that is a custom implementation of java.util.NavigableSet
Is it possible to set a password?
If the Spring Redis DefaultScriptExecutor finds NOSCRIPT in the exception message after calling EVALSHA, it will try again with EVAL.
Now, the implementation of set command is too simple and doesn't support additional options added in REDIS
EX seconds -- Set the specified expire time, in seconds.
PX milliseconds -- Set the specified expire time, in milliseconds.
NX -- Only set the key if it does not already exist.
XX -- Only set the key if it already exist.
In RDB serialization implements these to formats
Notify when keys are affected by commands, and commands affecting keys
See link
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.