Commit Graph

762 Commits

Author SHA1 Message Date
Andrew Gaul 73c566a4c7 JCLOUDS-1635: Update test expectations 2024-11-09 17:46:36 -08:00
Andrew Gaul 9b48d04502 Add ETag to failed conditional GETs in LocalBlobStore 2024-09-06 00:49:39 +09:00
Andrew Gaul d733401ce7 Set version to 2.6.1-SNAPSHOT 2024-04-24 20:29:39 +09:00
Andrew Gaul da1bc06f9e JCLOUDS-1635: Add COOL and COLD to Tier
The former replaces INFREQUENT.  References gaul/s3proxy#625.
2024-04-20 17:31:52 +09:00
Andrew Gaul 4c7fb2c8b9 JCLOUDS-1626: Close stream in MultiBlobInputStream
Otherwise the inner FileInputStream will leak if the caller only reads
part of the stream before closing the outer MultiBlobInputStream.
2024-03-03 13:07:24 +09:00
Andrew Gaul 107741f786 JCLOUDS-1629: Upgrade to Guice 7.0.0
This also changes from javax to jakarta annotations.
2024-02-26 15:27:29 +09:00
Andrew Gaul b5e4e1d0fd JCLOUDS-1627: Upgrade to Jakarta packages
This resolves an issue with newer Guice versions.
2024-02-23 18:04:48 +09:00
Andrew Gaul 6bb738195f Add a test for uploading large objects
This is disabled by default.  Also rework upload helper to avoid using
an unbounded amount of memory.
2024-02-21 21:57:51 +09:00
Jan Vermeulen 47f34770c9 JCLOUDS-1606: JCLOUDS-1608: Fix MPU off-by-one
Previously GCS could not upload large objects due to its 32 part
limit.
2024-02-21 21:35:16 +09:00
jixinchi 9b01dbc983 no need to check contents contains md because it is a set 2023-11-14 21:48:21 +09:00
jixinchi 311a4102da fix typo and add unit test 2023-11-14 21:48:21 +09:00
jixinchi ef09dbb6ad do not remove md in DelimeterFilter then add it by commonPrefixes; just keep it 2023-11-14 21:48:21 +09:00
Andrew Gaul b7f28f1e6a Lazily open parts during LocalBlobStore complete MPU
This removes a previous workaround for opening too many
FileInputStream and exhausting rlimits.
2023-01-29 17:56:15 +09:00
Andrew Gaul 62632c9db6 JCLOUDS-1371: Optimize filesystem delimiter
populateBlobKeysInContainer will no longer recurse when the delimiter
matches "/".  This makes listing deep hierarchies with a delimiter
faster.  Note that the general LocalBlobStore handling is still
required for the general cases.  This requires removing a bogus test
case.  References gaul/s3proxy#473.
2023-01-24 14:44:34 +09:00
Andrew Gaul 57a9e7b7cc Deep copy Blob in LocalBlobStore.getBlob
ByteSourcePayload.openStream is not thread safe and lack of
synchronization can throw ArrayIndexOutOfBoundsExceptions.  Instead
deep copy the underlying Payload.  Fixes gaul/s3proxy#303.
2022-08-04 21:17:44 +09:00
Andrew Gaul f4ec2bb63c Address testng cyclic dependency
Uncovered by newer versions of testng.
2022-08-03 21:24:12 +09:00
Andrew Gaul 5111923566 Specify missing DataProviders
Uncovered by newer versions of testng.
2022-08-03 21:24:12 +09:00
Andrew Gaul 2b217fb2bb Annotate public non-test methods
Newer versions of TestNG try to run these.
2022-08-03 21:24:12 +09:00
Andrew Gaul 65e16c97f5 Annotate test methods as singleThreaded
Newer versions of testng deprecate sequential.
2022-08-03 21:24:12 +09:00
Andrew Gaul 36f351cd18 Next development version 2.6.0-SNAPSHOT 2022-03-26 18:30:06 +09:00
Andrew Gaul e8e78689e6 Next development version 2.4.0-SNAPSHOT 2021-09-19 08:58:25 +09:00
Timur Alperovich a1df0bb1f5 Store the MPU ETag for the transient blobstore
JCLOUDS-1582: fixes a bug in the transient blobstore where after
uploading a multipart upload, GET/HEAD returns the hash of the content,
rather than the MPU ETag.
2021-08-05 18:46:35 +09:00
Andrew Gaul d1bd51f7f1 Re-optimize LocalBlobStore.getBlob with ranges
This fixes a memory regression from
8de7b696e1 where the transient BlobStore
changed from a ByteSource to a byte[].
2021-06-30 08:09:30 +09:00
Andrew Gaul 7ad7890ad0 Next development version 2.4.0-SNAPSHOT 2021-04-14 23:07:54 +09:00
Andrew Gaul dabc0ab6a9 Allow setting BlobAccess in LocalBlobStore.putBlob
This addresses a race condition with filesystem users.
2021-02-01 19:37:47 +09:00
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