Commit Graph

1369 Commits

Author SHA1 Message Date
Andrew Gaul 67c2b5f6b9 Enable whitespace around Checkstyle rule 2014-05-08 18:31:47 -07:00
Andrew Gaul 2d88f5164e Enforce that all commas have trailing whitespace 2014-05-08 18:28:08 -07:00
Andrew Gaul 3f22f6738d JCLOUDS-534: Upgrade to Guava 17.0
Release notes:

https://code.google.com/p/guava-libraries/wiki/Release17
2014-05-06 17:23:37 -07:00
Andrew Gaul 82e9e9e42f JCLOUDS-534: Upgrade to Guava 17.0-rc2
This commit accommodates changes to Predicates.and.toString and
PublicSuffixPatterns.EXACT.  Release notes:

https://code.google.com/p/guava-libraries/wiki/Release17
2014-04-14 18:38:15 -07:00
Andrew Gaul d0bd30cc15 Address several Guava InputSupplier deprecations
Many remain due to Payload implementing InputSupplier<InputStream>.  Guava 18
will remove InputSupplier.
2014-04-12 12:02:26 -07:00
Andrew Gaul 7af18d4843 JCLOUDS-534: Address Guava 17 compatibility issues
Corrected with:

find -name \*.java | xargs sed -i 's/new Stopwatch();/Stopwatch.createUnstarted();/'
find -name \*.java | xargs sed -i 's/new Stopwatch().start();/Stopwatch.createStarted();/'
2014-04-11 14:24:12 -07:00
Pasi Niemi 85a1a8c1dd JCLOUDS-516: Add ssh agent support via sch agentproxy 2014-03-27 09:04:34 +01:00
Shri Javadekar 655aa444d7 JCLOUDS-510 Delete objects in a container efficiently.
The existing approach for deleting objects in a container suffers
from a head-of-line blocking problem. This commit implements a better
scheme which does not have that problem. This scheme uses a counting
semaphore for making sure that a certain number of futures are
issued in parallel. As each of these futures is completed, one
permit of the semaphore is released.

Added unit tests for testing this new scheme.
2014-03-26 13:48:28 -07:00
Andrew Gaul 00847f9ffc JCLOUDS-460: Add jitter to avoid thundering herd
When issuing many simultaneous requests to Synaptic Atmos I observed:

HTTP/1.1 failed with code 500, error: AtmosError
[code=1040, message=The server is busy. Please try again.]

Previously all clients slept for fixed intervals and thus retried
around the same time.  This commit adds a random delay which should
better distribute load on the provider.
2014-03-03 22:30:22 -08:00
Andrew Gaul d7e0b3b10c Remove WriteTo
Guava helpers capture this functionality in a more idiomatic way.
2014-02-21 17:13:31 -08:00
Andrew Gaul 9a1aae8cfc JCLOUDS-410: Remove StreamingPayload
Only two tests use this class.  Callers should use ByteSourcePayload
or InputStreamPayload instead.
2014-02-19 21:27:31 -08:00
Andrew Gaul c035bcd6b2 JCLOUDS-459: Limit maximum user threads
Previously jclouds could use an unlimited number of threads on its
user ExecutorService.  While this ExecutorService will go away when we
complete deasyncafication, we should prevent jclouds from misbehaving
until that time.
2014-02-19 10:04:50 -08:00
Andrew Gaul 266d7f847b Prefer ByteSource over deprecated InputSupplier 2014-02-18 22:35:10 -08:00
Andrew Gaul 1f08b692cd JCLOUDS-473: Close FileInputStream in Wire.copy
FileBackedOutputStream.asByteSource.getInput returns a FileInputStream
which we do not close.  We later call FileBackedOutputStream.reset
which removes the underlying File.  This fails on Windows which does
not support deleting an open file and leaks resources on other
platforms.  Eagerly close to address this issue.
2014-02-18 16:42:40 -08:00
Andrew Phillips 4c07702d29 JCLOUDS-432: Revert "JCLOUDS-427: Avoiding Guava reflection code broken in Java 7u51"
This reverts commit 8ff60020f8.
2014-02-10 10:01:02 -05:00
Andrew Phillips 02615adc4f JCLOUDS-427: Upgrading Guava 16.0 -> 16.0.1
Fixes Guava issue 1635.
2014-02-10 10:01:01 -05:00
Zack Shoylev 30a29cc73e Adds a top-level zone filter. New live tests iterate over all available zones to ensure jclouds is fully compatible. Sometimes we want to filter to specific zones on demand. 2014-02-07 10:37:49 -06:00
Andrew Gaul 241abea734 Store propagatable exceptions in a static field
Also include ResourceAlreadyExistsException.  References JCLOUDS-438.
2014-01-29 10:30:18 -08:00
Andrew Gaul 0098751f42 JCLOUDS-438: Map S3 code BucketAlreadyExists
Mapping to ResourceAlreadyExistsException allows external callers to
handle this situation specifically.
2014-01-28 21:21:46 -08:00
Andrew Phillips ea5128209a JCLOUDS-415: Upgrading Guava 15.0 -> 16.0 2014-01-28 07:57:35 -05:00
Andrew Phillips d77f96bed7 JCLOUDS-415: Preparing for Guava 16.0
Invokable.equals has changed from 15 to 16 so we need to implement the check differently ourselves.
2014-01-28 07:57:34 -05:00
Andrew Phillips 8ff60020f8 JCLOUDS-427: Avoiding Guava reflection code broken in Java 7u51
- Adding a version of TypeToken.where that replaces two parameters in one go
- Avoiding TypeToken type parameter replacement with wildcard bounds

Works around https://code.google.com/p/guava-libraries/issues/detail?id=1635
2014-01-23 23:28:00 -05:00
Andrew Phillips b59457a405 Fixing an error message about an unassignable backend 2014-01-23 09:09:47 -05:00
Andrew Gaul 9416416ff4 Address Checkstyle violations 2014-01-19 20:51:51 -08:00
Andrew Gaul d5fd82500c JCLOUDS-428: Address Java 8 compatibility nits
Tested with JDK 1.6.0_45, 1.7.0_45, and 1.8.0-ea-b123.
2014-01-19 20:37:45 -08:00
Ignasi Barrera 09a430744a Added OkHttp driver to support modern HTTP verbs 2014-01-13 10:47:39 +01:00
Andrew Gaul 3143e43a27 Remove erroneous deprecation of ByteSource method 2013-12-26 08:24:04 -08:00
Andrew Gaul c7b0f66544 Replace calls to Closeables.closeQuietly
Guava 16 removes this API.  Replace with Closeables2.closeQuietly.
References JCLOUDS-413 and JCLOUDS-415.
2013-12-21 12:30:59 -08:00
Andrew Gaul f9e98681b6 Address miscellaneous Guava deprecations
References JCLOUDS-415.
2013-12-20 14:05:44 -08:00
Andrew Bayer c1ee11d9bd Updating to 1.8.0-SNAPSHOT 2013-12-17 11:31:56 -08:00
Andrew Gaul 9d2e4759a3 JCLOUDS-410. Correctly override getInput
Payload.getInput must always call openStream to handle overridden
methods correctly.  Previously this caused errors in jclouds-chef in
BaseCipherPayload.
2013-12-17 08:02:03 -08:00
Andrew Gaul e48d4985ea JCLOUDS-410. Add support for ByteSource Payloads
Also deprecate byte[], File, InputSupplier<InputStream>, and String
Payloads.  Callers should instead provide a ByteSource via
ByteSource.wrap(byte[]) and Files.asByteSource(File)
2013-12-16 13:06:30 -08:00
Andrew Gaul f3dcd3fe86 JCLOUDS-410. Deprecate Payload.getInput
We plan to transition Payload to ByteSource in the next major release.
Unfortunately Payload.getInput masks its checked exception and
ByteSource.getInput is final so we cannot continue to mask the
exceptions.  Deprecation of getInput and addition openStream allows us
to transition callers from the former to the latter.
2013-12-16 13:02:37 -08:00
Andrew Gaul ac1f05ffac Remove unneeded calls to ByteSources.asByteSource 2013-12-15 22:57:32 -08:00
Andrew Gaul 8bf23069d9 Prefer Math.max over Ints.max to avoid varargs 2013-12-12 17:53:34 -08:00
Ignasi Barrera cec0981bb9 Properly set the request method in HTTPS connections 2013-12-12 12:30:06 -06:00
Andrew Gaul 828d8790c2 Enforce no unused imports via Checkstyle
Removed with:

mvn checkstyle:checkstyle --quiet -Dcheckstyle.output.file=/dev/stdout -Dcheckstyle.output.format=plain | tac | while read i; do echo $i | sed -n 's/\([^:]*\):\([^:]*\):.*/sed -i \2d \1/p' | bash; done
2013-12-11 17:27:43 -08:00
Eric Evans 15a3c04fb7 JCLOUDS-356 multipart uploads with InputStream payloads
This changeset introduces an alternative to PayloadSlicer,
IterablePayloadSlicer, with a method for returning a Payload iterator.

...swift.blobstore.strategy.internal.SequentialMultipartUploadStrategy
has been updated to to use a payload iterator.
2013-12-11 16:34:19 +01:00
Everett Toews c40dc996d9 JCLOUDS-400: Allow the HeaderParam annotation to be used in a Caller.
This allows jclouds to factor out common headers into the Caller so they don't
have to be repeated in the Callee.

The Produces/Consumes annotations (Content-Type/Accept headers) will also
propagate from the Caller to the Callee.
2013-12-11 13:24:07 +01:00
Andrew Gaul 4cef85d1cd Address Checkstyle violations in tests 2013-12-09 14:40:07 -08:00
Ignacio Mulas 6d7bde9676 PATCH HTTP request implementation 2013-11-13 23:23:40 +01:00
Andrew Phillips 4500dbe2ef JCLOUDS-352: Drops support for "-incubating" release versions 2013-11-06 22:31:54 -05:00
Andrew Phillips 29d574ffb2 Fixing typos in test name 2013-11-06 22:31:31 -05:00
Andrew Gaul 6c5effcdb1 Address error-prone empty statement warnings 2013-11-05 16:22:44 -08:00
Andrew Gaul 17ce72794c Enable RedundantModifier for Checkstyle 2013-10-31 10:23:30 -07:00
Niraj Tolia 53146fb7bb [JCLOUD 301]: Make increased use of Invokable params cache
This patch moves the Invokable Parameter cache to Reflection2 and adds
a convenience method for it to allow it to be shared by multiple
callers. The subsequent ability of S3Utils to use this cache results
in a ~40% improvement in performance for generating signed GETs and
PUTs for S3. This commit also converts a few others calls to
Invokable.getParameters() but the observed benefit from those was
small in microbenchmarks.
2013-10-14 17:44:03 -07:00
Andrew Gaul 04c9c6afd2 JCLOUDS-339. Handle zero-length objects in Atmos
Atmos does not return a location header when writing zero-length
objects, which normally throws an HttpResponseException: no uri in
headers or content.
2013-10-08 22:14:37 -07:00
Shri Javadekar af245d67fe JCLOUDS-334. Return correct status while creating containers in Swift.
BlobStore.createContainerInLocation is supposed to return True if the
container was newly created and False if the container already
existed. This commit makes that happen for Swift blobstores.
2013-10-07 21:48:57 -07:00
Andrew Gaul f1fc63ab76 Add whitespace around keywords and braces 2013-09-30 09:39:29 -07:00
Andrew Gaul 06b8cd7ac5 JCLOUDS-305. Disable S3 virtual host buckets for generic S3
Not all S3-compatible providers support virtual host buckets and thus
we should disable this feature by default.  Continue to enable virtual
host buckets for AWS-S3 which supports this although this feature
suffers from DNS settling issues.  Ran ran integration tests against
AWS-S3 and Scality using its S3 API.
2013-09-27 16:22:42 -07:00