ssdb / javassdb Goto Github PK
View Code? Open in Web Editor NEWSSDB Java client
SSDB Java client
public void buildMap(){
for(int i=1; i byte[] k = raw.get(i);
byte[] v = raw.get(i+1);
keys.add(k);
items.put(k, v);
}
}
====> java.lang.IndexOutOfBoundsException: Index: 2, Size: 2
Must be for(int i= 0; i<raw.size(); i+=2){
I had use request method of SSDB as follows: request("set","key","value"),then ,I shut down the network of SSDB Server.And some socket problems occurred,I thought that was not a big problem because I went to restart the network.But it become a big problem because the client won't reconnect,is something wrong while I using it? codes belows:
final SSDB sdb=new SSDB("cent1", 8888);
for(int i=0;i<1000;i++){
new Thread(new Runnable() {
@OverRide
public void run() {
while(true){
try {
String id=UUID.randomUUID().toString();
sdb.request("set",id,id);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}).start();
}
and I also found some exception below:
java.lang.Exception: Parse body_len error
at com.udpwork.ssdb.Link.parse(Link.java:136)
at com.udpwork.ssdb.Link.recv(Link.java:85)
at com.udpwork.ssdb.Link.request(Link.java:71)
at com.udpwork.ssdb.Link.request(Link.java:51)
at com.udpwork.ssdb.SSDB.request(SSDB.java:36)
这网络部分的代码像是java入门教程里的
你好,ideawu,
python和c++都有,java的api中找不到
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: path] with root cause
java.lang.ClassNotFoundException: path
Method recv() in Link has serious performace problem.
private MemoryStream input = new MemoryStream();
this is your defination in your class Link.
Then looked up method "request", recv() return a list of <byte[]>. But in recv(), a "while(true)" is always running. Everytime I have read some data from sock.getInputStream(), parse() will be executed. When I need read big data, for example 1000w entries, every parse() execution blocks read and consume a lot of resource. I assume that is a performace problem.
public void buildMap(){
for(int i=1; i<raw.size()+1; i+=2){
byte[] k = raw.get(i);
byte[] v = raw.get(i+1);
keys.add(k);
items.put(k, v);
}
}
i think you should use i<raw.size() or i<raw.size()-1
Link 类中
sock = new Socket(host, port);
......
-->
sock = new Socket();
......
sock.connect(new InetSocketAddress(host, port), connect_timeout);
如题,只找到了一个Ssdb4j,请问下official版的是下掉了吗?
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.