You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jclouds.apache.org by Logan Widick <lo...@gmail.com> on 2018/02/22 01:02:39 UTC
jclouds BlobStore - hierarchy within given (Provider, Location,
Container) tuple
After looking at the Javadocs for version 2.0.x, I noticed that
createDirectory() was deprecated. How should I go about creating some sort
of hierarchy within a container stored in a given location by a given
provider?
A line of example code and its associated comment (reproduced below) from
the BlobStore start guide (https://jclouds.apache.org/start/blobstore/)
suggests that one can pass to the BlobStore.blobBuilder() method arbitrary
paths separated by forward slashes (like "folderName/sushi.jpg" or
"folderName/anotherFolderName/sushi.gif"). Is this the recommended approach
for every provider, or just Amazon S3? Is there another approach?
blob = blobStore.blobBuilder("test") // you can use folders via
blobBuilder(folderName + "/sushi.jpg")
Thanks,
Logan Widick
Re: jclouds BlobStore - hierarchy within given (Provider, Location,
Container) tuple
Posted by Andrew Gaul <ga...@apache.org>.
All major providers (Azure, B2, GCS, S3, Swift) allow names
/like/this/one.jpg, natively support / as a delimiter, and support
listing via arbitrary prefixes. Atmos is the oddball which actually
supports directories as a concept. While has similarities, it cannot
list all objects which start with "a" or use non-/ delimiters.
On Thu, Feb 22, 2018 at 08:19:49AM -0600, Logan Widick wrote:
> So I can assume that all providers would either allow names
> "/like/this/one.jpg" or change such names on my behalf to whatever
> delimiters are supported? Or is there a way to get a provider's suggested
> delimiters for "directory emulation" (like the forward slash in the above
> example) and "file extension emulation" (like the period in the above
> example)?
--
Andrew Gaul
http://gaul.org/
Re: jclouds BlobStore - hierarchy within given (Provider, Location,
Container) tuple
Posted by Logan Widick <lo...@gmail.com>.
So I can assume that all providers would either allow names
"/like/this/one.jpg" or change such names on my behalf to whatever
delimiters are supported? Or is there a way to get a provider's suggested
delimiters for "directory emulation" (like the forward slash in the above
example) and "file extension emulation" (like the period in the above
example)?
Logan
On Feb 22, 2018 2:15 AM, "Andrew Gaul" <ga...@apache.org> wrote:
Hi Logan, the good news is that you mostly need not change your workflow
at all. Blobstores generally do not support directories; instead they
emulate them using prefixes and delimiters. Previously jclouds emulated
directory support to accommodate corner-case providers such as Atmos and
the filesystem, while most providers used these prefixes and delimiters
natively. One of our contributers did a bunch of work to realign
jclouds with the blobstore reality. What does this mean practically?
Likely very litter -- you can continue to create /blobs/like/this but
need not call createDirectory. getBlob remains the same but in list()
you should use prefix and delimiter to limit queries to only the blobs
you have interest in.
On Wed, Feb 21, 2018 at 07:02:39PM -0600, Logan Widick wrote:
> After looking at the Javadocs for version 2.0.x, I noticed that
> createDirectory() was deprecated. How should I go about creating some sort
> of hierarchy within a container stored in a given location by a given
> provider?
>
> A line of example code and its associated comment (reproduced below) from
> the BlobStore start guide (https://jclouds.apache.org/start/blobstore/)
> suggests that one can pass to the BlobStore.blobBuilder() method arbitrary
> paths separated by forward slashes (like "folderName/sushi.jpg" or
> "folderName/anotherFolderName/sushi.gif"). Is this the recommended
approach
> for every provider, or just Amazon S3? Is there another approach?
>
> blob = blobStore.blobBuilder("test") // you can use folders via
> blobBuilder(folderName + "/sushi.jpg")
>
>
> Thanks,
>
> Logan Widick
--
Andrew Gaul
http://gaul.org/
Re: jclouds BlobStore - hierarchy within given (Provider, Location,
Container) tuple
Posted by Andrew Gaul <ga...@apache.org>.
Hi Logan, the good news is that you mostly need not change your workflow
at all. Blobstores generally do not support directories; instead they
emulate them using prefixes and delimiters. Previously jclouds emulated
directory support to accommodate corner-case providers such as Atmos and
the filesystem, while most providers used these prefixes and delimiters
natively. One of our contributers did a bunch of work to realign
jclouds with the blobstore reality. What does this mean practically?
Likely very litter -- you can continue to create /blobs/like/this but
need not call createDirectory. getBlob remains the same but in list()
you should use prefix and delimiter to limit queries to only the blobs
you have interest in.
On Wed, Feb 21, 2018 at 07:02:39PM -0600, Logan Widick wrote:
> After looking at the Javadocs for version 2.0.x, I noticed that
> createDirectory() was deprecated. How should I go about creating some sort
> of hierarchy within a container stored in a given location by a given
> provider?
>
> A line of example code and its associated comment (reproduced below) from
> the BlobStore start guide (https://jclouds.apache.org/start/blobstore/)
> suggests that one can pass to the BlobStore.blobBuilder() method arbitrary
> paths separated by forward slashes (like "folderName/sushi.jpg" or
> "folderName/anotherFolderName/sushi.gif"). Is this the recommended approach
> for every provider, or just Amazon S3? Is there another approach?
>
> blob = blobStore.blobBuilder("test") // you can use folders via
> blobBuilder(folderName + "/sushi.jpg")
>
>
> Thanks,
>
> Logan Widick
--
Andrew Gaul
http://gaul.org/