@Override public void close() throws IOException { permanentBlobCache.close(); transientBlobCache.close(); }
@Override public TransientBlobKey putTransient(InputStream inputStream) throws IOException { try (BlobClient bc = createClient()) { return (TransientBlobKey) bc.putInputStream(null, inputStream, TRANSIENT_BLOB); } }
@Override public boolean deleteFromCache(TransientBlobKey key) { return deleteInternal(null, key); }
@Override public File getFile(TransientBlobKey key) throws IOException { return getFileInternal(null, key); }
/** * Instantiates a new BLOB cache. * * @param blobClientConfig * global configuration * @param blobView * (distributed) blob store file system to retrieve files from first * @param serverAddress * address of the {@link BlobServer} to use for fetching files from or {@code null} if none yet * @throws IOException * thrown if the (local or distributed) file storage cannot be created or is not usable */ public BlobCacheService( final Configuration blobClientConfig, final BlobView blobView, @Nullable final InetSocketAddress serverAddress) throws IOException { this(new PermanentBlobCache(blobClientConfig, blobView, serverAddress), new TransientBlobCache(blobClientConfig, serverAddress)); }
(Integer port) -> { try { return new TransientBlobCache(config, new InetSocketAddress(jobManagerGateway.getHostname(), port)); } catch (IOException e) { throw new CompletionException(new FlinkException("Could not create TransientBlobCache.", e)); if (!blobCache.deleteFromCache(lastSubmittedFile.get(taskManagerId))) { throw new CompletionException(new FlinkException("Could not delete file for " + taskManagerId + '.')); return blobCache.getFile(blobKey).getAbsolutePath(); } catch (IOException e) { throw new CompletionException(new FlinkException("Could not retrieve blob for " + blobKey + '.', e));
/** * Sets the address of the {@link BlobServer}. * * @param blobServerAddress address of the {@link BlobServer}. */ public void setBlobServerAddress(InetSocketAddress blobServerAddress) { permanentBlobCache.setBlobServerAddress(blobServerAddress); transientBlobCache.setBlobServerAddress(blobServerAddress); }
blobCacheService.getTransientBlobService().putTransient(logFileInputStream);
@Override public File getFile(TransientBlobKey key) throws IOException { return getFileInternal(null, key); }
/** * Instantiates a new BLOB cache. * * @param blobClientConfig * global configuration * @param blobView * (distributed) blob store file system to retrieve files from first * @param serverAddress * address of the {@link BlobServer} to use for fetching files from or {@code null} if none yet * @throws IOException * thrown if the (local or distributed) file storage cannot be created or is not usable */ public BlobCacheService( final Configuration blobClientConfig, final BlobView blobView, @Nullable final InetSocketAddress serverAddress) throws IOException { this(new PermanentBlobCache(blobClientConfig, blobView, serverAddress), new TransientBlobCache(blobClientConfig, serverAddress)); }
/** * Sets the address of the {@link BlobServer}. * * @param blobServerAddress address of the {@link BlobServer}. */ public void setBlobServerAddress(InetSocketAddress blobServerAddress) { permanentBlobCache.setBlobServerAddress(blobServerAddress); transientBlobCache.setBlobServerAddress(blobServerAddress); }
final TransientBlobKey transientBlobKey; try (FileInputStream fileInputStream = new FileInputStream(file)) { transientBlobKey = transientBlobService.putTransient(fileInputStream); } catch (IOException e) { log.debug("Could not upload file {}.", fileType, e);
@Override public TransientBlobKey putTransient(byte[] value) throws IOException { try (BlobClient bc = createClient()) { return (TransientBlobKey) bc.putBuffer(null, value, 0, value.length, TRANSIENT_BLOB); } }
@Override public File getFile(TransientBlobKey key) throws IOException { return getFileInternal(null, key); }
@Override public boolean deleteFromCache(TransientBlobKey key) { return deleteInternal(null, key); }
@Override public void close() throws IOException { permanentBlobCache.close(); transientBlobCache.close(); }
/** * Instantiates a new BLOB cache. * * @param blobClientConfig * global configuration * @param blobView * (distributed) blob store file system to retrieve files from first * @param serverAddress * address of the {@link BlobServer} to use for fetching files from or {@code null} if none yet * @throws IOException * thrown if the (local or distributed) file storage cannot be created or is not usable */ public BlobCacheService( final Configuration blobClientConfig, final BlobView blobView, @Nullable final InetSocketAddress serverAddress) throws IOException { this(new PermanentBlobCache(blobClientConfig, blobView, serverAddress), new TransientBlobCache(blobClientConfig, serverAddress)); }
/** * Sets the address of the {@link BlobServer}. * * @param blobServerAddress address of the {@link BlobServer}. */ public void setBlobServerAddress(InetSocketAddress blobServerAddress) { permanentBlobCache.setBlobServerAddress(blobServerAddress); transientBlobCache.setBlobServerAddress(blobServerAddress); }
final TransientBlobKey transientBlobKey; try (FileInputStream fileInputStream = new FileInputStream(file)) { transientBlobKey = transientBlobService.putTransient(fileInputStream); } catch (IOException e) { log.debug("Could not upload file {}.", fileType, e);
@Override public TransientBlobKey putTransient(byte[] value) throws IOException { try (BlobClient bc = createClient()) { return (TransientBlobKey) bc.putBuffer(null, value, 0, value.length, TRANSIENT_BLOB); } }