Commit Graph

737 Commits

Author SHA1 Message Date
gurkerl83 8ac994c2b5 Integrate GSON library in Clouds Core Bundle Final
In the last commit (last section of squashed commit), the GSON library was integrated into the JClouds core module using maven-bundle plugins include resource instruction. Building OSGi instruction variables from the respective modules show a weakness when resources such as script builder shell scripts are required to be integrated into the bundle but not provide a dedicated variable declaration for the resource section.

The following commit demonstrates a change in strategy in declaration and integration of OSGi metadata.

- Replace old bundle-plugin with newest bnd-plugin (bundle-plugin uses bnd-plugin internally)
- Move OSGi metadata declarations from a maven variable passing strategy into dedicated bnd.bnd files
+ Cleaner pom files, no bundle packaging
+ Intellisense / Autocomplete support for .bnd files in terms of package exports etc.

For demonstration, the overall OSGi adjustments are limited to project, core, script builder, compute, blob store, and load balancer because most custom OSGi metadata is defined here.

Note: Other modules are currently disabled from build because some feedback is needed first.

Make GSON integration work.
To understand the changes, see the core modules' bnd file. GSON internal packages also define a version. Both already exported and new export declarations are fused. The global JClouds core module exports defined the entire set of GSON packages available.

Some minor modifications were made in the module project; replace maven jar plugin with a minified version of the declaration, outsourced in projects bnd file.
2020-10-26 19:58:41 +09:00
Andrew Gaul 3ea2cce5f2 Optimize MultiBlobInputStream.read()
Previously this allocated a byte array for every call.
2020-08-01 18:37:17 +09:00
Andrew Gaul 9c21bf2cc2 JCLOUDS-1367: Do not open open InputStream in copyBlob
This avoids an unneeded call to ByteStreams2.toByteArrayAndClose in
getBlob for range requests and elides a large memory allocation.
2020-08-01 18:37:04 +09:00
Andrew Gaul 8de7b696e1 Store transient Blob data with ByteArrayPayload
This avoids a race condition due to sharing the same Closer instance
and unbounded growth of its Closeable Deque.  References
gaul/s3proxy#303.
2020-07-12 05:13:48 +09:00
Andrew Gaul 62767a1461 JCLOUDS-1333: JCLOUDS-1334: JCLOUDS-1470: Require Java 8 and Guava 22
This allows compatibility with Guava 29.  Also unwind some older
workarounds.
2020-06-25 08:11:30 +09:00
Andrew Gaul 6e6f8ebf77 JCLOUDS-912: JCLOUDS-1547: GCS InputStream single-part upload
Previously this provider worked around a RestAnnotationProcessor quirk
by using multi-part uploads for InputStream payloads.  Instead work
around the quirk another way which allows a single-part upload.  This
allows inclusion of the Content-MD5 header during object creation.
Backfill tests with both ByteSource and InputStream inputs.
2020-05-31 17:48:31 +09:00
roded d220b245d7 JCLOUDS-1543: remove unused imports from FetchBlobMetadataTest.java (#70)
Co-authored-by: Roded Bahat <roded.bahat@model9.io>
2020-04-22 10:32:54 +02:00
Roded Bahat 5ac92111c4 JCLOUDS-1543: change FetchBlobMetadata to retain original blob order 2020-04-17 19:24:15 +09:00
Timur Alperovich 8d0e9dc962 Hash the content for fs MPU ETag if no xattr.
If there is no extended attribute support in the file system, the blobs
will not have their associated ETags available. In that case, the file
system blob store should rehash the content while producing the combined
blob and return the expected S3-style ETag.
2020-04-04 18:42:59 +09:00
Andrew Gaul febc9b73df Fix TOCTOU issue when getting blob during removal
Fixes gaul/s3proxy#318.
2019-11-09 12:08:40 +09:00
Ignasi Barrera f5b29c7028 Next development version 2.3.0-SNAPSHOT 2019-10-21 10:32:43 +02:00
Ignasi Barrera 7221844fac Apache jclouds 2.2.0-rc1 release 2019-10-21 10:32:43 +02:00
Andrew Gaul 222fb84f5c Add test for aborting a single part MPU
Also tighten up checks to ensure there is no litter, mostly for
transient and filesystem blobstores.
2019-02-06 17:13:05 -08:00
Andrew Gaul fd7bacbfd3 Correct some Checkstyle violations
Follow-on to 13f32b28c9.
2019-02-01 08:57:57 -08:00
Andrew Gaul 13f32b28c9 Lazily open InputStream during complete MPU
Previously the filesystem provider could exhaust file descriptors by
eagerly opening up to 10,000 parts.  This partially undoes
JCLOUDS-1367.
2019-01-29 21:54:47 -08:00
Andrew Gaul 29eec441e9 JCLOUDS-1371: JCLOUDS-1488: list optimize prefix
Previously getBlobKeysInsideContainer returned all keys and filtered
in LocalBlobStore.  Now getBlobKeysInsideContainer filters via prefix
which can dramatically decrease the number of keys returned,
especially for the filesystem provider.  Further optimizations are
possible for delimiter.
2019-01-29 17:39:51 -08:00
Andrew Gaul 2393c7920b JCLOUDS-1366: JCLOUDS-1472: Fix InputStream MPU
Previously jclouds attempted to slice non-repeatable InputStream
Payloads in order to upload sequentially.  This never worked due to
mutating the single stream via skip and close.  Also backfill test
which spuriously succeeded.
2019-01-04 15:42:17 -08:00
Joe Meiring a36c9dcef0 Fix for FileSystem blob store clearContainer with options 2019-01-04 14:17:00 -08:00
Timur Alperovich 896e99df09 Filesystem: Fix the MPU ETags to match S3.
Prior commit introduced a bug in the computation of the MPU ETag value,
where it was concatenating strings, rather than operating on the bytes
of the integer value.
2018-11-02 12:25:17 -07:00
Joe Meiring 22ce5484a4 Removed unneeded check for prefix in clearContainer 2018-11-02 12:19:01 -07:00
Timur Alperovich 539a9854c1 JCLOUDS-1450: Use S3-style ETags for MPUs.
S3 uses a different ETag for multipart uploads (MPUs) than regular
objects. The ETag consists of the md5 hash of the concatenated ETags of
individual parts followed by the number of parts (separated by "-").

The patch changes the LocalBlobStore's implementation of
CompleteMultipartUpload to set the S3-style ETag before calling
putBlob() and return that ETag to the caller.

To simplify testing, a new protected method with a default NOOP
implementation is added to the BaseBlobIntegrationTest. It allows
providers to further verify MPUs (i.e. ensuring the correct ETag has
been stored alongside the object).
2018-10-24 13:25:00 -07:00
Andrew Gaul cc65957997 Error-prone 2.3.2 fixes 2018-10-12 23:28:00 -07:00
Jesse Glick 36353d6157 [JCLOUDS-1422] Ensure that LocalBlobStore.list honors !recursive even when a prefix is defined. 2018-06-06 22:47:56 -07:00
Jesse Glick 11fac4f020 Include the delimiter field in ListContainerOptions.toString. 2018-06-06 22:47:56 -07:00
Andrew Gaul 7d40cedb20 JCLOUDS-1400: Test PUT signed URL Content-Type 2018-04-12 22:43:43 -07:00
Andrew Gaul f6d47b9c0e JCLOUDS-1333: Fix Java 8 and Guava 21 issues 2018-04-10 08:17:35 -07:00
Andrew Gaul 1eec2b6e01 JCLOUDS-1367: Return InputStream from getBlob
Previously filesystem and transient returned ByteSource while all
other providers returned InputStream.
2018-03-24 12:13:25 -07:00
Andrew Gaul 90fac3b683 JCLOUDS-1271: Remove BlobStore.signRemoveBlob
Most providers never supported this functionality and the portable
abstraction should not have included it.
2018-03-09 20:52:12 -08:00
Alin Dreghiciu 584ca19fad JCLOUDS-1392: Do not filter non BLOBs during list 2018-03-08 22:39:26 -08:00
andreaturli d17487b223 fix typo in project.version
- from 2.2.0-SNAPSHOST to 2.2.0-SNAPSHOT
2018-02-21 16:45:43 +01:00
andreaturli a5db565581 Next development version 2.2.0-SNAPSHOST 2018-02-16 11:23:12 +01:00
andreaturli 9273bd56ad Apache jclouds 2.1.0-rc3 release 2018-02-16 11:20:21 +01:00
Andrew Gaul eb5db026da JCLOUDS-1368: Fix off-by-one in slicing algorithm 2018-02-08 21:00:33 -08:00
Andrew Gaul 8cd68a3503 JCLOUDS-1369: improving slicing with many parts
Previously with GCS and its maximum 32 parts, the slicing algorithm
would sliced 3.2 GB blobs into (31) 32 MB parts and (1) 2.3 GB part.
With this algorithm it creates (31) 100 MB parts and (1) smaller part.
2018-01-09 12:56:00 -08:00
Andrew Gaul d05be89614 JCLOUDS-1368: Correct use of slicing algorithm
MultipartUploadSlicingAlgorithm creates multiple equal-sized parts and
a remaining amount.  BaseBlobStore.putMultipartBlob used this
interface incorrectly, which could create more parts than intended
since the remaining size could be larger than the part size.  This
manifested with Google Cloud Storage which only allows 32 parts.
2018-01-09 12:56:00 -08:00
Yuval Kashtan 17cef5652f [JCLOUDS-1363] - Fix case sensitivity of blobstore metadata
HTTP headers are case insensitive by nature (see RFC 2616). When addUserMetadataTo check if this is indeed a user metadata header, it must properly ignore case.
The fix make sure that both metadataPrefix and the header key are compared with toLowerCase().

This solves issue with minio metadata read
2017-12-07 08:52:50 +01:00
Andrew Gaul d29b79674d JCLOUDS-1358: Fix zero byte InputStream test input
Do not use ByteSource.empty() since it is backed by a
ByteArrayInputStream which supports reset.
2017-11-21 10:50:56 -08:00
Andrew Gaul e473d7df6a Tighten up test expectations
Follow on to 8b94febfeb.
2017-11-11 07:45:23 -08:00
Andrew Gaul 26570db680 Include HTTP status code in illegal range error 2017-11-10 22:49:45 -08:00
Andrew Gaul 8b94febfeb Throw consistent exception on invalid range read
Previously S3, Swift, and local blobstores threw a generic
IllegalArgumentException for this uncommon error.  Instead
consistently throw HttpResponseException.
2017-11-10 21:39:47 -08:00
Timur Alperovich 343897d6d8 Use different content on overwrite.
When testing blobstore overwrite behavior, jclouds should use a blob
with different content (but same name).
2017-11-06 17:22:32 -08:00
Andrew Gaul 83d10e8194 JCLOUDS-1337: restore tier from stub blob
This allows completeMultipartUpload to propagate the tier set in
initiateMultipartUpload.
2017-11-03 09:52:42 -07:00
Andrew Gaul 7fbef10d57 JCLOUDS-1337: Include tier in object listing
This requires hoisting Tier from BlobMetadata to StorageMetadata.
2017-11-02 16:24:34 -07:00
Andrew Gaul 9a0b51a4d4 Include trailing slash in prefix test 2017-10-30 18:31:40 -07:00
Andrew Gaul af05e24ae9 Implement partial prefix support for Atmos
Atmos only supports listing by directories while other blobstores
allow listing via arbitrary prefixes.  Allow requests which list
directories via both prefix and delimiter = "/" to succeed instead of
failing all requests.  Also change a test which specified recursive to
instead be delimiter = "/".  Fixes gaul/s3proxy#244.
2017-10-30 17:51:35 -07:00
Ignasi Barrera f7b74d95c9 Exclude tier tests on OSX 2017-10-25 08:30:49 +02:00
Andrew Gaul f513bf7c40 JCLOUDS-1337: Atmos putBlob portable storage tiers 2017-10-23 21:31:48 -07:00
Andrew Gaul 6158b60954 JCLOUDS-1337: Portable storage tiers 2017-10-11 12:04:02 -07:00
Andrew Gaul 7704893650 Remove Inject on constructors for abstract classes
This is not meaningful since these classes cannot be instantiated.
Found via error-prone.
2017-09-07 23:37:24 -07:00
Andrew Gaul 517323fbd5 JCLOUDS-1225: Address Guava 18 MoreExecutors changes
Fixed with:

find -name \*.java | xargs sed -i 's/sameThreadExecutor/newDirectExecutorService/g'
2017-08-22 17:14:22 -07:00