if ( blobStore.createContainerInLocation(null, bucketName) ) { logger.info( "Created bucket {}", bucketName );
if ( blobStore.createContainerInLocation( null, bucketName ) ) { logger.info( "Created bucket " + bucketName );
@Override public boolean createContainerInLocation(Location location, String container, CreateContainerOptions options) { return delegate().createContainerInLocation( location, container, options) && writeStore.createContainerInLocation( location, container, options); }
private void createContainer() { String containerName = CONTAINER_DATE_FORMAT.format(new Date()); blobStore.createContainerInLocation(null, containerName); lastContainerCreated = containerName; }
created = blobStore.createContainerInLocation(location, containerName, options); } catch (AuthorizationException ae) {
@Override public boolean createContainerInLocation(Location location, String container) { return delegate().createContainerInLocation(location, container); }
@Override public boolean createContainerInLocation(Location location, String container, CreateContainerOptions createContainerOptions) { return delegate().createContainerInLocation(location, container, createContainerOptions); }
private String generateRandomContainerName() { String candidate; do { candidate = RandomStringUtils.randomAlphanumeric(12).toLowerCase(); } while(!context.getBlobStore().createContainerInLocation(defaultLocation, candidate)); LOG.info("Created blob cache container '{}' located in '{}'", candidate, defaultLocation); return candidate; }
/** * Checks if container exists and creates one if not. * * @param blobStore The {@link BlobStore} to use. * @param container The container name to check against. * @param locationId The locationId to create the container if not found. */ public static void ensureContainerExists(BlobStore blobStore, String container, String locationId) { if (blobStore != null && !Strings.isNullOrEmpty(container) && !blobStore.containerExists(container)) { blobStore.createContainerInLocation(getLocationById(blobStore, locationId), container); } }
public CompletableFuture<ContainerName> createContainer(ContainerName name) { return CompletableFuture.supplyAsync(() -> blobStore.createContainerInLocation(DEFAULT_LOCATION, name.value())) .thenApply(created -> { if (created) { return name; } else { throw new ObjectStoreException("Unable to create container " + name.value()); } }); }
@Test(groups = { "integration", "live" }) public void testDuplicateCreateContainer() { BlobStore blobStore = view.getBlobStore(); Location location = null; String container = "container"; boolean created; created = blobStore.createContainerInLocation(location, container); assertTrue(created); created = blobStore.createContainerInLocation(location, container); assertFalse(created); } }
public BlobClusterStateStore(ClusterSpec spec) { this.spec = spec; this.context = BlobStoreContextBuilder.build(spec); this.container = checkNotNull(spec.getStateStoreContainer()); this.blobName = checkNotNull(spec.getStateStoreBlob()); /* create container if it does not already exists */ if (!context.getBlobStore().containerExists(container)) { context.getBlobStore().createContainerInLocation(null, container); } }
public BlobClusterStateStore(ClusterSpec spec) { this.spec = spec; this.context = BlobStoreContextBuilder.build(spec); this.container = checkNotNull(spec.getStateStoreContainer()); this.blobName = checkNotNull(spec.getStateStoreBlob()); /* create container if it does not already exists */ if (!context.getBlobStore().containerExists(container)) { context.getBlobStore().createContainerInLocation(null, container); } }
private String generateRandomContainerName(BlobStoreContext context) { String candidate; do { candidate = RandomStringUtils.randomAlphanumeric(12).toLowerCase(); } while(!context.getBlobStore().createContainerInLocation(null, candidate)); LOG.info("Created temporary container '{}'", candidate); return candidate; }
private String generateRandomContainerName(BlobStoreContext context) { String candidate; do { candidate = RandomStringUtils.randomAlphanumeric(12).toLowerCase(); } while(!context.getBlobStore().createContainerInLocation(null, candidate)); return candidate; }
protected static void createContainerAndEnsureEmpty(BlobStoreContext context, final String containerName) throws InterruptedException { context.getBlobStore().createContainerInLocation(null, containerName); if (context.getConsistencyModel() == ConsistencyModel.EVENTUAL) Thread.sleep(1000); context.getBlobStore().clearContainer(containerName); }
public void testLargerThanOnePageNoOptions() { blobstore.createContainerInLocation(null, "goodies"); for (int i = 0; i < 1001; i++) { blobstore.putBlob("goodies", blobstore.blobBuilder(i + "").payload(i + "").build()); } Iterable<? extends StorageMetadata> listing = concatter.execute("goodies", new ListContainerOptions()); assertEquals(Iterables.size(listing), 1001); }
public void test() throws IOException { blobstore.createContainerInLocation(null, "goodies"); for (int i = 0; i < 1001; i++) { blobstore.putBlob("goodies", blobstore.blobBuilder(i + "").payload(i + "").build()); } assertEquals(blobstore.countBlobs("goodies"), 1001); blobstore.clearContainer("goodies"); assertEquals(blobstore.countBlobs("goodies"), 0); }
public void testStrategies() throws IOException { blobstore.createContainerInLocation(null, "poo"); for (int i = 0; i < 1001; i++) { blobstore.putBlob("poo", blobstore.blobBuilder(i + "").payload(i + "").build()); } ListContainerAndRecurseThroughFolders lister = new ListContainerAndRecurseThroughFolders( new ConcatenateContainerLists(blobstore)); assertEquals(lister.execute("poo", ListContainerOptions.NONE).size(), 1001); blobstore.clearContainer("poo"); assertEquals(lister.execute("poo", ListContainerOptions.NONE).size(), 0); }
@Test(groups = { "integration", "live" }) public void testPutTwiceIsOkAndDoesntOverwrite() throws InterruptedException { String containerName = getContainerName(); try { view.getBlobStore().createContainerInLocation(null, containerName); Blob blob = view.getBlobStore().blobBuilder("hello").payload(TEST_STRING).build(); view.getBlobStore().putBlob(containerName, blob); view.getBlobStore().createContainerInLocation(null, containerName); assertEquals(view.getBlobStore().countBlobs(containerName), 1); } finally { returnContainer(containerName); } }