Package org.apache.druid.data.input.impl
Class CloudObjectLocation
java.lang.Object
org.apache.druid.data.input.impl.CloudObjectLocation
Common type for 'bucket' and 'path' concept of cloud objects to allow code sharing between cloud specific
implementations.
bucket and path should NOT be URL encoded.
The intention is that this is used as a common representation for storage objects as an alternative to dealing in
URI directly, but still provide a mechanism to round-trip with a URI.
In common clouds, bucket names must be dns compliant:
https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html
https://docs.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata
https://cloud.google.com/storage/docs/naming
The constructor ensures that bucket names are DNS compliant by checking that the URL encoded form of the bucket
matches the supplied value. Technically it should probably confirm that the bucket is also all lower-case, but
S3 has a legacy mode where buckets did not have to be compliant so we can't enforce that here unfortunately.-
Constructor Summary
ConstructorsConstructorDescriptionCloudObjectLocation(String bucket, String path) CloudObjectLocation(URI uri) -
Method Summary
-
Constructor Details
-
CloudObjectLocation
-
CloudObjectLocation
-
-
Method Details
-
validateUriScheme
-
toUri
Given a scheme, encodebucketandpathinto aURI. In all clouds bucket names must be dns compliant, so it does not require encoding There is no such restriction on object names, so they will be URL encoded when constructing the URI -
getBucket
-
getPath
-
toString
-
equals
-
hashCode
public int hashCode()
-