Commit Graph

510 Commits

Author SHA1 Message Date
Andrew Gaul 266d7f847b Prefer ByteSource over deprecated InputSupplier 2014-02-18 22:35:10 -08:00
Andrew Gaul 9416416ff4 Address Checkstyle violations 2014-01-19 20:51:51 -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 Bayer c1ee11d9bd Updating to 1.8.0-SNAPSHOT 2013-12-17 11:31:56 -08:00
Andrew Gaul d25e972344 JCLOUDS-401. Make BlobName Function type-safe 2013-12-16 15:04:14 -08:00
Andrew Gaul ac06e32e72 JCLOUDS-399: Deprecate BlobBuilder.calculateMD5
Callers should instead call BlobBuilder.contentMD5, usually with the
results from Guava Hashing.md5().  This narrows the API and removes a
strange IOException from callers.
2013-12-16 13:40:38 -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 ac1f05ffac Remove unneeded calls to ByteSources.asByteSource 2013-12-15 22:57:32 -08: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
Andrew Gaul 4cef85d1cd Address Checkstyle violations in tests 2013-12-09 14:40:07 -08:00
Andrew Gaul 6c5effcdb1 Address error-prone empty statement warnings 2013-11-05 16:22:44 -08:00
Zack Shoylev cb9a6b9413 Reduces parallelism to make test work better with slower connections Adjusts test timing to work properly and reliably 2013-10-30 10:33:15 -05:00
Andrew Phillips f196ee3b6b Move Expect: 100 stripping after asserts against the request
Follow-up to e30f86521
2013-10-19 20:05:42 -07:00
Andrew Gaul e30f865215 Work around CloudFiles test failures
Java helpfully interprets Expect: 100-continue instead of returning
the response code.  This commit reverts
100afba1d8.
2013-10-17 13:08:02 -07:00
Zack Shoylev 7593935380 JCLOUDS-332 Skips tests broken on windows 2013-10-08 15:07:35 -05:00
Andrew Gaul 7d20658b02 JCLOUDS-334. Return URI only if container created
This allows us to honor the BlobStore.createContainerInLocation
interface and gives consistency with other providers.
2013-10-08 13:03:55 -07:00
Andrew Gaul f1fc63ab76 Add whitespace around keywords and braces 2013-09-30 09:39:29 -07:00
Andrew Gaul 5f8961723f Remove BlobStore Map abstractions
These provide little end-user benefit and make evolving the core API
more difficult.  We deprecated these in 1.6.0.
2013-09-25 20:46:31 -07:00
Andrew Gaul 94452a97cd Skip unimplemented test with transient blobstore 2013-09-16 02:48:57 -07:00
Andrew Gaul 6cc8e36f43 Add test for correct and incorrect contentMD5
Tested against atmos (skipped), aws-s3, azureblob, cloudfiles-us, and
filesystem (skipped).
2013-09-11 16:10:45 -07:00
Andrew Gaul 8bdded3222 Delete containers after integration tests
Also return newly allocated containers to the pool.
2013-09-09 16:47:40 -07:00
Andrew Gaul 0d6ef06076 Reduce testFileGetParallel input size to ~160 KB
Previously this test downloaded 45 MB in 30 seconds which failed on
slower connections, causing spurious test failures.  The larger input
size provides no benefit.
2013-09-04 19:49:46 -07:00
Andrew Gaul 3ad6b275d4 Run some filesystem integration tests
Previously no integration tests ran, now we see:

Tests run: 43, Failures: 0, Errors: 0, Skipped: 8
2013-09-04 13:26:46 -07:00
Andrew Gaul e27ae6117c Reduce testPutFileParallel input size to ~160 KB
Previously this test uploaded ~10 MB in 30 seconds which failed on
slower connections, causing spurious test failures.  The larger input
size provides no benefit.
2013-09-02 19:33:15 -07:00
Andrew Gaul 607b178c6b Simplify testPutFileParallel
Create only one temporary file and use explicit delete instead
finalization to remove it.
2013-08-27 23:06:18 -07:00
Andrew Gaul 4ca531aa98 Allocate new container name using prefix
Before we used the previous container name, which kept appending and
hit S3 limits during integration tests like:

Caused by: java.lang.IllegalArgumentException: Object 'gaul-blobstore27-4348532805015069992-1155797412711190448-1465016400636204031' doesn't match S3 bucket virtual host naming convention. Reason: Can't be null or empty. Length must be 3 to 63 symbols.. For more info, please refer to http://docs.amazonwebservices.com/AmazonS3/latest/index.html?BucketRestrictions.html
2013-08-27 23:02:55 -07:00
Andrew Gaul d387a25113 Enforce a non-negative content length 2013-08-26 20:20:49 -04:00
Francis Devereux d60d2681d1 JCLOUDS-251: Swift: Delete chunks when deleting a multipart blob
Also:
- Make SwiftBlobIntegrationLiveTest.testMultipartChunkedFileStream more realistic by uploading a file large enough to be split into parts.
- JavaDoc fixes for SwiftBlobStore: don't reference nonexistent methods.
2013-08-25 10:20:22 -05:00
Andrew Gaul 1a6be0eb67 Do not repeat array type in initializers 2013-06-18 21:02:50 -07:00
Andrew Gaul 86147cd961 Remove AsyncBlobStore from DeleteAllKeysInList
We deprecated AsyncBlobStore in 1.6.0.  Subsequent commits will
require the caller to provide an ExecutorService.
2013-06-05 10:41:55 -07:00
Andrew Gaul 64e9a4e4c6 Remove Strings2.replaceAll(String, char, String)
String.replace(String, String) serves this purpose better.
2013-06-03 14:41:18 -07:00
adriancole ed2f18a1af JCLOUDS-31. updated to ASF headers via mvn com.mycila.maven-license-plugin:maven-license-plugin:format 2013-05-16 21:30:37 -07:00
adriancole fa10fc4838 JCLOUDS-31. remove malformed, duplicate, or unnecessary headers 2013-05-16 21:30:32 -07:00
Andrew Bayer 7923009eb5 JCLOUDS-37. Fix RAT violations in incubator-jclouds, master branch 2013-05-13 19:17:50 -07:00
Andrew Bayer 446ac67884 JCLOUDS-30. Switch to 2 space indents for POM files. 2013-05-13 12:04:43 -07:00
Andrew Bayer 259b04ff1c JCLOUDS-16. Switch groupId to org.apache.jclouds, change parent POM, remove old distributionManagement content, add ASF repos. 2013-05-13 12:04:42 -07:00
Andrew Gaul 04fad88fd3 Remove duplicate Utils getters
Rename callers as required.
2013-04-12 16:24:37 -07:00
adriancole fbe9f945e7 rename bindMappedApi -> bindSyncToAsyncApi 2013-04-10 08:57:32 -07:00
adriancole 61067d3683 Deprecated remaining code related to RestContext, RestApiMetadata, and RestClientModule for ApiContext, HttpApiMetadata, HttpApiModule 2013-04-09 22:07:43 -07:00
adriancole f56da43db1 deprecated blobstore interfaces that imply complex internal code 2013-04-09 14:37:34 -07:00
Andrew Gaul 648e6c2a8a Remove InputSuppliers.of(InputStream)
This method breaks the contract of an InputSupplier since every call
to getInput returns the same InputStream instance.  This is
particularly dangerous when one of the callers mutates or closes the
InputStream which causes all others callers to fail.
2013-04-03 13:19:42 -07:00
Andrew Gaul 15f4d041b4 Parameterize max errors for clear container
Also use setter injection for max request time.
2013-03-29 13:36:57 -07:00
Andrew Gaul 371db8d18f Address Xlint warnings 2013-03-13 22:23:19 -07:00
Adrian Cole fb69ae0fa9 bump master to 1.7.0-SNAPSHOT 2013-03-08 23:02:40 -08:00
adriancole c31145e42e [maven-release-plugin] prepare for next development iteration 2013-03-04 06:13:59 -08:00
adriancole 0eb3ee8091 [maven-release-plugin] prepare release jclouds-1.6.0-alpha.4 2013-03-04 06:13:57 -08:00
Adrian Cole 941612ad09 add name to blobs in BlobMap tests 2013-03-02 09:16:26 -08:00
Andrew Gaul faf6b2f39e Prohibit null and empty blob names in BlobBuilder 2013-02-27 11:36:29 -08:00
Andrew Gaul ec4cdfda05 Address FindBugs complaints 2013-02-22 09:29:22 -08:00
Andrew Gaul b51ce5994a Expose resource creation date 2013-02-18 11:26:44 -08:00
Andrew Gaul 3734fe8100 Replace unneeded Function with imperative approach
The latter is more concise, faster, and compact.  .class size in bytes
before:

LocalAsyncBlobStore$5.class      1883
LocalAsyncBlobStore.class       20743

and after:

LocalAsyncBlobStore.class       21041
2013-02-05 10:20:24 -08:00
adriancole 89fda8ee28 [maven-release-plugin] prepare for next development iteration 2013-02-04 17:30:46 -08:00
adriancole 2b0ad28f26 [maven-release-plugin] prepare release jclouds-1.6.0-alpha.2 2013-02-04 17:30:44 -08:00
adriancole 267069755e [maven-release-plugin] prepare for next development iteration 2013-02-02 08:41:53 -08:00
adriancole 7c924b312f [maven-release-plugin] prepare release jclouds-1.6.0-alpha.1 2013-02-02 08:41:51 -08:00
adriancole 40d9f8bfe7 changes that facilitate synchronous fallbacks and http invocation 2013-01-29 04:09:45 -08:00
Andrew Gaul 60a7d1b4f8 Call BlobUtils.clearContainer directly
BaseAsyncBlobStore.clearContainer returns a Future which we previously
did not manage correctly, hanging when deleting non-existent
containers.  Call BlobUtils.clearContainer directly to address this.
2013-01-23 22:27:18 -08:00
Andrew Gaul bd7300ad92 Dynamically generate base blobstore input
This removes a single large image from the source tree.
2013-01-22 10:57:14 -08:00
Andrew Gaul af963df92d Use Map.entrySet where possible
Improves run-time efficiency and addresses FindBugs warnings.
2013-01-21 23:59:42 -08:00
Adrian Cole b890e1d36b Merge pull request #1218 from maginatics/delete-container-skip-exponential-backoff
Skip exponential backoff if we exceed maxErrors
2013-01-21 19:59:44 -08:00
Andrew Gaul 25b012587d Skip exponential backoff if we exceed maxErrors 2013-01-21 18:22:41 -08:00
Adrian Cole 37e587ee51 changes related to centralizing construction of invokables 2013-01-19 17:17:30 -08:00
Adrian Cole 4980367991 centralize TypeToken creation 2013-01-19 11:31:55 -08:00
adriancole dc4ca1efbd removed deprecated methods which were easy to do 2013-01-19 08:32:45 -08:00
adriancole 04fe89b75a update to guava 14.0-rc2 2013-01-18 16:02:25 -08:00
Adrian Cole a49a060152 There can be only one retryable predicate; use Predicates2.retry decorator 2013-01-13 20:30:34 -08:00
Adrian Cole 3962b30808 updated to use standard guava Futures and ListenableFuture 2013-01-13 09:31:10 -08:00
Adrian Cole 015fbf22a2 removed redundant retrying assertion code 2013-01-12 14:04:47 -08:00
Adrian Cole 47c215c63c removed custom guava code for scoped binding and type params 2013-01-08 22:48:10 -08:00
Adrian Cole 2480481835 dependent changes on tests and internal classes 2013-01-08 00:32:45 -08:00
Adrian Cole 3089111621 refactored internal code and tests to use FunctionalReflection 2013-01-07 00:36:31 -08:00
Adrian Cole 42c7037a59 removed unused code or duplicated code; moved code only used once to where its used 2013-01-01 00:08:34 -08:00
Adrian Cole 9745e9dc2f fixed covariance and warnings on ApiMetadata subclasses 2012-12-31 19:40:49 -08:00
Adrian Cole bb953c981e fix issue #1101: Move to Guava 14 BaseEncoding and Hashing 2012-12-31 14:48:31 -08:00
Adrian Cole cddd35bc51 removed unnecessary generic types and made RestAnnotationProcessor immutable 2012-12-30 23:18:59 -08:00
Adrian Cole 2523ab54ac removed use of static fields to share type mapping info 2012-12-30 17:22:03 -08:00
Adrian Cole 13d8b9c402 replaced @Timeout w/explicit properties 2012-12-30 12:31:43 -08:00
Adrian Cole 9b1872c6ff removed custom code that duplicates functionality of guava fallbacks 2012-12-27 16:54:31 -08:00
Andrew Gaul 60d61ceb91 Add more logging to DeleteAllKeysInList
This allows monitoring of progress of long deletes via debug logs.
2012-12-26 21:27:13 -08:00
Adrian Cole 20c3426fc8 replaced jersey w/Uris & UriTemplates; removed complexity in url encoding and edge cases like matrix params 2012-12-24 14:32:59 -08:00
Everett Toews 3d83d788af Fixed issue where an Accept header is required when doing HEAD requests to Cloud Files. 2012-12-14 16:50:47 -06:00
Adrian Cole 878ec1bcab undid Serializable and added checkstyle InterfaceIsType:allowMarkerInterfaces=false 2012-11-18 09:23:44 -08:00
Andrew Gaul b16ca139a4 Honor PROPERTY_REQUEST_TIMEOUT in clearContainer 2012-11-13 13:27:18 -08:00
Andrew Gaul 3ad36d25d5 Enforce no unnecessary parentheses via Checkstyle 2012-11-10 13:22:12 -08:00
Adrian Cole c7c27e12e2 improved javadoc including where to look for alternative syntax 2012-11-07 12:02:52 -03:00
Andrew Gaul 3d191253ec Enforce use of Collection helpers via Checkstyle
This ensures that we do not repeat the type name.  Some instances remain
due to auto-generated code in dmtf/cim/Cim*.
2012-11-04 20:45:49 -08:00
Adrian Cole beb36eac75 Merge pull request #940 from andrewgaul/checkstyle-misc
Miscellaneous Checkstyle fixes
2012-11-04 08:50:47 -08:00
Andrew Gaul 38b95f5ad9 Miscellaneous Checkstyle fixes
Nothing can extend a byte[] and remove a previous hidden unused import.
2012-11-01 19:11:59 -07:00
Andrew Gaul 76a5538229 Cancel Futures in clearContainer
This prevents Futures from hanging around on exceptional code paths like
interrupts and timeouts.
2012-11-01 17:18:38 -07:00
Adrian Cole 5da5161485 Merge pull request #909 from andrewgaul/clear-container-timeout-exception
Throw TimeoutException from awaitCompletion
2012-10-30 08:57:20 -07:00
Andrew Gaul 93d69ece2b Enforce newline at end of file via Checkstyle
Also address all warnings, via:

find -name \*.java | while read i; do if [ x`tail -c 1 $i` != x"" ]; then echo >> $i; fi; done
2012-10-29 22:12:44 -07:00
Andrew Gaul 709ca69a2d Enforce that all imports are used via Checkstyle
Also remove all unused imports, via:

mvn checkstyle:checkstyle -Dcheckstyle.output.file=/dev/stdout -Dcheckstyle.output.format=plain | tac | awk -v FS=: '/warning/{print "sed -i " $2 "d " $1}' | while read i; do $i; done
2012-10-29 17:11:08 -07:00
Andrew Gaul 336ccfa2e6 Throw TimeoutException from awaitCompletion
This is a common error that callers should interpret correctly.  For
DeleteAllKeysInList, we integrate into its retry and backoff logic,
and for other callers, we continue to propagate RuntimeException.
2012-10-25 13:50:29 -07:00
Andrew Gaul 28d7a6f143 Prefer immutable over empty collections
The former does not create an object when calling iterator(), as
discussed here:

https://groups.google.com/d/msg/jclouds-dev/l7BviKDXreA/mP6Ow_RYxIgJ
2012-10-20 15:35:29 -07:00
Adrian Cole 9e8b4756c2 Merge pull request #894 from andrewgaul/files-tostring
Prefer Files.toString over FileInputStream
2012-10-11 02:05:46 -07:00
Andrew Gaul 2b8b72758f Prefer Files.toString over FileInputStream 2012-10-10 21:33:22 -07:00
Andrew Gaul 331c3be2e8 Retry each operation up to maxErrors times
Previously we only allowed maxErrors per directory, which tended to
fail with large directories.  Also rename counter to something more
intuitive.
2012-10-10 17:54:38 -07:00
Adrian Cole ffa9cd3bb0 corrected guice bindings for swift-based blob signatures and backfilled expect tests 2012-10-10 12:03:23 +02:00
Andrew Gaul 9f6b9d4d8a Rename to LocalBlobRequestSigner
Missing commit from the Filesystem and Transient unification.
2012-10-07 22:54:03 -07:00
Adrian Cole a77a80f030 Issue 1092: fix hostname when path-based buckets are used in non-default location 2012-09-25 21:22:17 -07:00