open-io / oio-api-java Goto Github PK
View Code? Open in Web Editor NEWOpenIO SDS Java client API, giving direct access to the object storage
Home Page: https://www.openio.io/
License: GNU Lesser General Public License v3.0
OpenIO SDS Java client API, giving direct access to the object storage
Home Page: https://www.openio.io/
License: GNU Lesser General Public License v3.0
While using this code:
package it.customer.prova.openio.api;
import io.openio.sds.Client;
import io.openio.sds.ClientBuilder;
import io.openio.sds.models.NamespaceInfo;
public class GetNamespaceInfo {
public static void main(String[] args) {
Client client = ClientBuilder.newClient("OPENIO", "http://192.168.99.100:6007");
NamespaceInfo namespace = client.getNamespaceInfo();
}
}
We got the following error:
Exception in thread "main" com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:221)
at com.google.gson.Gson.fromJson(Gson.java:861)
at io.openio.sds.http.Verifiers.extractError(Verifiers.java:144)
at io.openio.sds.http.Verifiers.access$000(Verifiers.java:26)
at io.openio.sds.http.Verifiers$4.verify(Verifiers.java:105)
at io.openio.sds.http.OioHttp$RequestBuilder.execute(OioHttp.java:217)
at io.openio.sds.http.OioHttp$RequestBuilder.execute(OioHttp.java:191)
at io.openio.sds.http.OioHttp$RequestBuilder.execute(OioHttp.java:240)
at io.openio.sds.proxy.ProxyClient.getNamespaceInfo(ProxyClient.java:135)
at io.openio.sds.DefaultClient.getNamespaceInfo(DefaultClient.java:55)
at it.customer.prova.openio.api.GetNamespaceInfo.main(GetNamespaceInfo.java:11)
Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
It seems that the JSON return by getNamespaceInfo()
is not matching anymore.
I didnt see any thing about login / password, how can I authenticate?
(swift client options: --os-tenant-name --os-username --os-password
)
Thanks you.
When building the doc (17.04 branch) Iget this warning:
With gradle-4.3.1:
+ gradle javadocJar
The ConfigurableReport.setDestination(Object) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the method ConfigurableReport.setDestination(File) instead.
at build_exkyn9y6uida8hg3qylcooyn0$_run_closure9$_closure19.doCall(/home/test/repo/oio-docs/repositories.work/oio-api-java/build.gradle:70)
(Run with --stacktrace to get the full stack trace of this deprecation warning.)
:compileJavawarning: [options] bootstrap class path not set in conjunction with -source 1.6
1 warning
:processResources NO-SOURCE
:classes
:javadoc
:javadocJar
BUILD SUCCESSFUL in 3s
3 actionable tasks: 3 executed
With gradle-4.6:
+ gradle javadocJar
Starting a Gradle Daemon (subsequent builds will be faster)
:compileJavawarning: [options] bootstrap class path not set in conjunction with -source 1.6
1 warning
:processResources NO-SOURCE
:classes
:javadoc
:javadocJar
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.6/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 16s
3 actionable tasks: 3 executed
After some period of inactivity, it seems that a connection can be reused after it has been closed server-side, leading to IOException: Unexpected end of stream
. Following is a shortened stack trace.
2016-12-07 10:54:12 Failed to perform request
io.openio.sds.exceptions.OioSystemException: Http request execution error
at io.openio.sds.http.OioHttp$RequestBuilder.execute(OioHttp.java:235)
at io.openio.sds.http.OioHttp$RequestBuilder.execute(OioHttp.java:191)
at io.openio.sds.proxy.ProxyClient.getObjectInfo(ProxyClient.java:711)
at io.openio.sds.DefaultClient.getObjectInfo(DefaultClient.java:169)
at io.openio.sds.DefaultClient.getObjectInfo(DefaultClient.java:162)
...
Caused by: java.io.IOException: Unexpected end of stream
at io.openio.sds.http.OioHttpResponse.read(OioHttpResponse.java:125)
at io.openio.sds.http.OioHttpResponse.next(OioHttpResponse.java:108)
at io.openio.sds.http.OioHttpResponse.readHeaders(OioHttpResponse.java:101)
at io.openio.sds.http.OioHttpResponse.responseHead(OioHttpResponse.java:91)
at io.openio.sds.http.OioHttpResponse.build(OioHttpResponse.java:46)
at io.openio.sds.http.OioHttp$RequestBuilder.readResponse(OioHttp.java:255)
at io.openio.sds.http.OioHttp$RequestBuilder.execute(OioHttp.java:214)
... 11 more
it should provide automatic fallback in case of failures
Here :
Use long to avoid this limitation.
As a user I want to list containers within an account so that I can let clients of my application discover the object space without having to know where they have put objects months ago.
As a user I want to call "close()" or "shutdown()" to explicitly release any resources so that I can create a new client with a different configuration at runtime.
At some load testing, I came across the following issue:
io.openio.sds.exceptions.OioException: Failed to schedule rawx upload
at io.openio.sds.storage.rawx.RawxClient.uploadPosition(RawxClient.java:286)
at io.openio.sds.storage.rawx.RawxClient.uploadChunks(RawxClient.java:132)
at io.openio.sds.DefaultClient.putObject(DefaultClient.java:150)
at io.openio.sds.DefaultClient.putObject(DefaultClient.java:129)
... 56 more
Caused by: java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@1e06266b rejected from java.util.concurrent.ThreadPoolExecutor@1900ae28[Running, pool size = 100, active threads = 100, queued tasks = 0, completed tasks = 675]
at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2047)[:1.8.0_111]
at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:823)[:1.8.0_111]
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1369)[:1.8.0_111]
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)[:1.8.0_111]
at io.openio.sds.storage.rawx.RawxClient.uploadPosition(RawxClient.java:272)
... 52 more
For the active rawx threads I see stack traces like the following:
"RawxClient-Worker" Id=1134 in TIMED_WAITING on lock=java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@1ff6eed
at sun.misc.Unsafe.park(Native Method)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
at java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467)
at io.openio.sds.common.FeedableInputStream.read(FeedableInputStream.java:64)
at io.openio.sds.common.FeedableInputStream.read(FeedableInputStream.java:69)
at io.openio.sds.common.FeedableInputStream.read(FeedableInputStream.java:69)
at io.openio.sds.common.FeedableInputStream.read(FeedableInputStream.java:69)
at io.openio.sds.common.FeedableInputStream.read(FeedableInputStream.java:69)
at io.openio.sds.common.FeedableInputStream.read(FeedableInputStream.java:69)
at io.openio.sds.http.OioHttp$RequestBuilder.stream(OioHttp.java:322)
at io.openio.sds.http.OioHttp$RequestBuilder.sendRequest(OioHttp.java:272)
at io.openio.sds.http.OioHttp$RequestBuilder.execute(OioHttp.java:213)
at io.openio.sds.http.OioHttp$RequestBuilder.execute(OioHttp.java:183)
at io.openio.sds.storage.rawx.RawxClient$2.call(RawxClient.java:261)
at io.openio.sds.storage.rawx.RawxClient$2.call(RawxClient.java:236)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
After some minutes, stack traces have enlarged massively and will eventually (every 10 seconds an additional stack frame) die with a StackOverflowError:
"RawxClient-Worker" Id=1134 in TIMED_WAITING on lock=java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@1ff6eed
at sun.misc.Unsafe.park(Native Method)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
at java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467)
at io.openio.sds.common.FeedableInputStream.read(FeedableInputStream.java:64)
at io.openio.sds.common.FeedableInputStream.read(FeedableInputStream.java:69)
at io.openio.sds.common.FeedableInputStream.read(FeedableInputStream.java:69)
at io.openio.sds.common.FeedableInputStream.read(FeedableInputStream.java:69)
at io.openio.sds.common.FeedableInputStream.read(FeedableInputStream.java:69)
at io.openio.sds.common.FeedableInputStream.read(FeedableInputStream.java:69)
at io.openio.sds.common.FeedableInputStream.read(FeedableInputStream.java:69)
at io.openio.sds.common.FeedableInputStream.read(FeedableInputStream.java:69)
... ~200 times more ...
at io.openio.sds.common.FeedableInputStream.read(FeedableInputStream.java:69)
at io.openio.sds.common.FeedableInputStream.read(FeedableInputStream.java:69)
at io.openio.sds.common.FeedableInputStream.read(FeedableInputStream.java:69)
at io.openio.sds.http.OioHttp$RequestBuilder.stream(OioHttp.java:322)
at io.openio.sds.http.OioHttp$RequestBuilder.sendRequest(OioHttp.java:272)
at io.openio.sds.http.OioHttp$RequestBuilder.execute(OioHttp.java:213)
at io.openio.sds.http.OioHttp$RequestBuilder.execute(OioHttp.java:183)
at io.openio.sds.storage.rawx.RawxClient$2.call(RawxClient.java:261)
at io.openio.sds.storage.rawx.RawxClient$2.call(RawxClient.java:236)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
This results in a complete denial of service for any data operations.
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.