@Override public void execute(String containerName, Iterable<? extends Blob> blobs) { Map<Blob, ListenableFuture<?>> responses = Maps.newLinkedHashMap(); for (Blob blob : blobs) { responses.put(blob, ablobstore.putBlob(containerName, blob)); } Map<Blob, Exception> exceptions; try { exceptions = awaitCompletion(responses, userExecutor, maxTime, logger, String.format("putting into containerName: %s", containerName)); } catch (TimeoutException te) { throw propagate(te); } if (exceptions.size() > 0) throw new BlobRuntimeException(String.format("error putting into container %s: %s", containerName, exceptions)); }
@Override public void execute(final String containerName, Iterable<? extends Blob> blobs) { Map<Blob, ListenableFuture<?>> responses = Maps.newLinkedHashMap(); for (final Blob blob : blobs) { responses.put(blob, userExecutor.submit(new Callable<Object>() { @Override public Object call() throws Exception { return blobstore.putBlob(containerName, blob); } })); } Map<Blob, Exception> exceptions; try { exceptions = awaitCompletion(responses, userExecutor, maxTime, logger, String.format("putting into containerName: %s", containerName)); } catch (TimeoutException te) { throw propagate(te); } if (!exceptions.isEmpty()) throw new BlobRuntimeException(String.format("error putting into container %s: %s", containerName, exceptions)); }
@Override public void execute(String containerName, Iterable<? extends Blob> blobs) { Map<Blob, ListenableFuture<?>> responses = Maps.newLinkedHashMap(); for (Blob blob : blobs) { responses.put(blob, ablobstore.putBlob(containerName, blob)); } Map<Blob, Exception> exceptions; try { exceptions = awaitCompletion(responses, userExecutor, maxTime, logger, String.format("putting into containerName: %s", containerName)); } catch (TimeoutException te) { throw propagate(te); } if (exceptions.size() > 0) throw new BlobRuntimeException(String.format("error putting into container %s: %s", containerName, exceptions)); }
@Override public void execute(final String containerName, Iterable<? extends Blob> blobs) { Map<Blob, ListenableFuture<?>> responses = Maps.newLinkedHashMap(); for (final Blob blob : blobs) { responses.put(blob, userExecutor.submit(new Callable<Object>() { @Override public Object call() throws Exception { return blobstore.putBlob(containerName, blob); } })); } Map<Blob, Exception> exceptions; try { exceptions = awaitCompletion(responses, userExecutor, maxTime, logger, String.format("putting into containerName: %s", containerName)); } catch (TimeoutException te) { throw propagate(te); } if (!exceptions.isEmpty()) throw new BlobRuntimeException(String.format("error putting into container %s: %s", containerName, exceptions)); }
@Override public void execute(final String containerName, Iterable<? extends Blob> blobs) { Map<Blob, ListenableFuture<?>> responses = Maps.newLinkedHashMap(); for (final Blob blob : blobs) { responses.put(blob, userExecutor.submit(new Callable<Object>() { @Override public Object call() throws Exception { return blobstore.putBlob(containerName, blob); } })); } Map<Blob, Exception> exceptions; try { exceptions = awaitCompletion(responses, userExecutor, maxTime, logger, String.format("putting into containerName: %s", containerName)); } catch (TimeoutException te) { throw propagate(te); } if (!exceptions.isEmpty()) throw new BlobRuntimeException(String.format("error putting into container %s: %s", containerName, exceptions)); }
@Override public void execute(final String containerName, Iterable<? extends Blob> blobs) { Map<Blob, ListenableFuture<?>> responses = Maps.newLinkedHashMap(); for (final Blob blob : blobs) { responses.put(blob, userExecutor.submit(new Callable<Object>() { @Override public Object call() throws Exception { return blobstore.putBlob(containerName, blob); } })); } Map<Blob, Exception> exceptions; try { exceptions = awaitCompletion(responses, userExecutor, maxTime, logger, String.format("putting into containerName: %s", containerName)); } catch (TimeoutException te) { throw propagate(te); } if (!exceptions.isEmpty()) throw new BlobRuntimeException(String.format("error putting into container %s: %s", containerName, exceptions)); }
@Override public void execute(String containerName, Iterable<? extends Blob> blobs) { Map<Blob, ListenableFuture<?>> responses = Maps.newLinkedHashMap(); for (Blob blob : blobs) { responses.put(blob, ablobstore.putBlob(containerName, blob)); } Map<Blob, Exception> exceptions; try { exceptions = awaitCompletion(responses, userExecutor, maxTime, logger, String.format("putting into containerName: %s", containerName)); } catch (TimeoutException te) { throw propagate(te); } if (exceptions.size() > 0) throw new BlobRuntimeException(String.format("error putting into container %s: %s", containerName, exceptions)); }
public void execute(final String containerName, String directory) { Set<String> names = Sets.newHashSet(); names.add(directory); for (String suffix : BlobStoreConstants.DIRECTORY_SUFFIXES) { names.add(directory + suffix); } Map<String, ListenableFuture<?>> responses = Maps.newHashMap(); for (final String name : names) { responses.put(name, userExecutor.submit(new Callable<Void>() { @Override public Void call() throws Exception { blobstore.removeBlob(containerName, name); return null; } })); } String message = String.format("deleting directory %s in containerName: %s", directory, containerName); Map<String, Exception> exceptions; try { exceptions = awaitCompletion(responses, userExecutor, maxTime, logger, message); } catch (TimeoutException te) { throw propagate(te); } if (!exceptions.isEmpty()) throw new BlobRuntimeException(String.format("error %s: %s", message, exceptions)); assert !blobstore.directoryExists(containerName, directory) : String.format( "still exists %s: %s", message, exceptions); } }
public void execute(final String containerName, String directory) { Set<String> names = Sets.newHashSet(); names.add(directory); for (String suffix : BlobStoreConstants.DIRECTORY_SUFFIXES) { names.add(directory + suffix); } Map<String, ListenableFuture<?>> responses = Maps.newHashMap(); for (final String name : names) { responses.put(name, userExecutor.submit(new Callable<Void>() { @Override public Void call() throws Exception { blobstore.removeBlob(containerName, name); return null; } })); } String message = String.format("deleting directory %s in containerName: %s", directory, containerName); Map<String, Exception> exceptions; try { exceptions = awaitCompletion(responses, userExecutor, maxTime, logger, message); } catch (TimeoutException te) { throw propagate(te); } if (!exceptions.isEmpty()) throw new BlobRuntimeException(String.format("error %s: %s", message, exceptions)); assert !blobstore.directoryExists(containerName, directory) : String.format( "still exists %s: %s", message, exceptions); } }
public void execute(final String containerName, String directory) { Set<String> names = Sets.newHashSet(); names.add(directory); for (String suffix : BlobStoreConstants.DIRECTORY_SUFFIXES) { names.add(directory + suffix); } Map<String, ListenableFuture<?>> responses = Maps.newHashMap(); for (final String name : names) { responses.put(name, userExecutor.submit(new Callable<Void>() { @Override public Void call() throws Exception { blobstore.removeBlob(containerName, name); return null; } })); } String message = String.format("deleting directory %s in containerName: %s", directory, containerName); Map<String, Exception> exceptions; try { exceptions = awaitCompletion(responses, userExecutor, maxTime, logger, message); } catch (TimeoutException te) { throw propagate(te); } if (!exceptions.isEmpty()) throw new BlobRuntimeException(String.format("error %s: %s", message, exceptions)); assert !blobstore.directoryExists(containerName, directory) : String.format( "still exists %s: %s", message, exceptions); } }
public void execute(String containerName, String directory) { Set<String> names = Sets.newHashSet(); names.add(directory); for (String suffix : BlobStoreConstants.DIRECTORY_SUFFIXES) { names.add(directory + suffix); } Map<String, ListenableFuture<?>> responses = Maps.newHashMap(); for (String name : names) { responses.put(name, ablobstore.removeBlob(containerName, name)); } String message = String.format("deleting directory %s in containerName: %s", directory, containerName); Map<String, Exception> exceptions; try { exceptions = awaitCompletion(responses, userExecutor, maxTime, logger, message); } catch (TimeoutException te) { throw propagate(te); } if (exceptions.size() > 0) throw new BlobRuntimeException(String.format("error %s: %s", message, exceptions)); assert !blobstore.directoryExists(containerName, directory) : String.format( "still exists %s: %s", message, exceptions); } }
public void execute(String containerName, String directory) { Set<String> names = Sets.newHashSet(); names.add(directory); for (String suffix : BlobStoreConstants.DIRECTORY_SUFFIXES) { names.add(directory + suffix); } Map<String, ListenableFuture<?>> responses = Maps.newHashMap(); for (String name : names) { responses.put(name, ablobstore.removeBlob(containerName, name)); } String message = String.format("deleting directory %s in containerName: %s", directory, containerName); Map<String, Exception> exceptions; try { exceptions = awaitCompletion(responses, userExecutor, maxTime, logger, message); } catch (TimeoutException te) { throw propagate(te); } if (exceptions.size() > 0) throw new BlobRuntimeException(String.format("error %s: %s", message, exceptions)); assert !blobstore.directoryExists(containerName, directory) : String.format( "still exists %s: %s", message, exceptions); } }
public void execute(String containerName, String directory) { Set<String> names = Sets.newHashSet(); names.add(directory); for (String suffix : BlobStoreConstants.DIRECTORY_SUFFIXES) { names.add(directory + suffix); } Map<String, ListenableFuture<?>> responses = Maps.newHashMap(); for (String name : names) { responses.put(name, ablobstore.removeBlob(containerName, name)); } String message = String.format("deleting directory %s in containerName: %s", directory, containerName); Map<String, Exception> exceptions; try { exceptions = awaitCompletion(responses, userExecutor, maxTime, logger, message); } catch (TimeoutException te) { throw propagate(te); } if (exceptions.size() > 0) throw new BlobRuntimeException(String.format("error %s: %s", message, exceptions)); assert !blobstore.directoryExists(containerName, directory) : String.format( "still exists %s: %s", message, exceptions); } }
public void execute(final String containerName, String directory) { Set<String> names = Sets.newHashSet(); names.add(directory); for (String suffix : BlobStoreConstants.DIRECTORY_SUFFIXES) { names.add(directory + suffix); } Map<String, ListenableFuture<?>> responses = Maps.newHashMap(); for (final String name : names) { responses.put(name, userExecutor.submit(new Callable<Void>() { @Override public Void call() throws Exception { blobstore.removeBlob(containerName, name); return null; } })); } String message = String.format("deleting directory %s in containerName: %s", directory, containerName); Map<String, Exception> exceptions; try { exceptions = awaitCompletion(responses, userExecutor, maxTime, logger, message); } catch (TimeoutException te) { throw propagate(te); } if (!exceptions.isEmpty()) throw new BlobRuntimeException(String.format("error %s: %s", message, exceptions)); assert !blobstore.directoryExists(containerName, directory) : String.format( "still exists %s: %s", message, exceptions); } }
public boolean execute(String containerName, Object value, ListContainerOptions options) { try { byte[] toSearch = objectMD5.apply(value); for (BlobMetadata metadata : getAllBlobMetadata.execute(containerName, options)) { if (Arrays.equals(toSearch, metadata.getContentMetadata().getContentMD5())) return true; } return false; } catch (Exception e) { Throwables.propagateIfPossible(e, BlobRuntimeException.class); throw new BlobRuntimeException(String.format( "Error searching for ETAG of value: [%2$s] in container:%1$s", containerName, value), e); } }
public boolean execute(String containerName, Object value, ListContainerOptions options) { try { byte[] toSearch = objectMD5.apply(value); for (BlobMetadata metadata : getAllBlobMetadata.execute(containerName, options)) { if (Arrays.equals(toSearch, metadata.getContentMetadata().getContentMD5())) return true; } return false; } catch (Exception e) { Throwables.propagateIfPossible(e, BlobRuntimeException.class); throw new BlobRuntimeException(String.format( "Error searching for ETAG of value: [%2$s] in container:%1$s", containerName, value), e); } }
public boolean execute(String containerName, Object value, ListContainerOptions options) { try { byte[] toSearch = objectMD5.apply(value); for (BlobMetadata metadata : getAllBlobMetadata.execute(containerName, options)) { if (Arrays.equals(toSearch, metadata.getContentMetadata().getContentMD5())) return true; } return false; } catch (Exception e) { Throwables.propagateIfPossible(e, BlobRuntimeException.class); throw new BlobRuntimeException(String.format( "Error searching for ETAG of value: [%2$s] in container:%1$s", containerName, value), e); } }
throw new BlobRuntimeException(String.format("searching for md5 in container %s: %s", containerName, exceptions)); try { } catch (Exception e) { Throwables.propagateIfPossible(e, BlobRuntimeException.class); throw new BlobRuntimeException(String.format("Error searching for ETAG of value: [%s] in container:%s", value, containerName), e);
public boolean execute(String containerName, Object value, ListContainerOptions options) { try { byte[] toSearch = objectMD5.apply(value); for (BlobMetadata metadata : getAllBlobMetadata.execute(containerName, options)) { BlobProperties properties = client.getBlobProperties(containerName, metadata.getName()); if (Arrays.equals(toSearch, properties.getContentMetadata().getContentMD5())) return true; } return false; } catch (Exception e) { Throwables.propagateIfPossible(e, BlobRuntimeException.class); throw new BlobRuntimeException(String.format( "Error searching for ETAG of value: [%2$s] in container:%1$s", containerName, value), e); } }
throw new BlobRuntimeException(String.format("searching for md5 in container %s: %s", containerName, exceptions)); try { } catch (Exception e) { Throwables.propagateIfPossible(e, BlobRuntimeException.class); throw new BlobRuntimeException(String.format("Error searching for ETAG of value: [%s] in container:%s", value, containerName), e);