blobStoreService = new FileSystemBlobStore(flinkFileSystem, haDataDirectory.toString());
@Override public void delete(JobID jobId, String key) { delete(BlobUtils.getRecoveryPath(basePath, jobId, key)); }
@Override public boolean put(File localFile, JobID jobId, BlobKey blobKey) throws IOException { return put(localFile, BlobUtils.getStorageLocationPath(basePath, jobId, blobKey)); }
@Override public void get(BlobKey blobKey, File localFile) throws IOException { get(BlobUtils.getRecoveryPath(basePath, blobKey), localFile); }
@Override public void delete(BlobKey blobKey) { delete(BlobUtils.getRecoveryPath(basePath, blobKey)); }
@Override public void put(File localFile, BlobKey blobKey) throws IOException { put(localFile, BlobUtils.getRecoveryPath(basePath, blobKey)); }
@Override public boolean get(JobID jobId, BlobKey blobKey, File localFile) throws IOException { return get(BlobUtils.getStorageLocationPath(basePath, jobId, blobKey), localFile, blobKey); }
blobStoreService = new FileSystemBlobStore(flinkFileSystem, haDataDirectory.toString());
@Override public boolean delete(JobID jobId, BlobKey blobKey) { return delete(BlobUtils.getStorageLocationPath(basePath, jobId, blobKey)); }
@Override public void put(File localFile, JobID jobId, String key) throws IOException { put(localFile, BlobUtils.getRecoveryPath(basePath, jobId, key)); }
@Override public boolean get(JobID jobId, BlobKey blobKey, File localFile) throws IOException { return get(BlobUtils.getStorageLocationPath(basePath, jobId, blobKey), localFile, blobKey); }
blobStoreService = new FileSystemBlobStore(flinkFileSystem, haDataDirectory.toString());
@Override public boolean deleteAll(JobID jobId) { return delete(BlobUtils.getStorageLocationPath(basePath, jobId)); }
@Override public boolean put(File localFile, JobID jobId, BlobKey blobKey) throws IOException { return put(localFile, BlobUtils.getStorageLocationPath(basePath, jobId, blobKey)); }
@Override public void get(JobID jobId, String key, File localFile) throws IOException { get(BlobUtils.getRecoveryPath(basePath, jobId, key), localFile); }
private static BlobStoreService createFileSystemBlobStore(Configuration configuration) throws IOException { String storagePath = configuration.getValue( HighAvailabilityOptions.HA_STORAGE_PATH); if (isNullOrWhitespaceOnly(storagePath)) { throw new IllegalConfigurationException("Configuration is missing the mandatory parameter: " + HighAvailabilityOptions.HA_STORAGE_PATH); } final Path path; try { path = new Path(storagePath); } catch (Exception e) { throw new IOException("Invalid path for highly available storage (" + HighAvailabilityOptions.HA_STORAGE_PATH.key() + ')', e); } final FileSystem fileSystem; try { fileSystem = path.getFileSystem(); } catch (Exception e) { throw new IOException("Could not create FileSystem for highly available storage (" + HighAvailabilityOptions.HA_STORAGE_PATH.key() + ')', e); } final String clusterId = configuration.getValue(HighAvailabilityOptions.HA_CLUSTER_ID); storagePath += "/" + clusterId; return new FileSystemBlobStore(fileSystem, storagePath); }
@Override public void deleteAll(JobID jobId) { delete(BlobUtils.getRecoveryPath(basePath, jobId)); }
@Override public boolean put(File localFile, JobID jobId, BlobKey blobKey) throws IOException { return put(localFile, BlobUtils.getStorageLocationPath(basePath, jobId, blobKey)); }
@Override public boolean get(JobID jobId, BlobKey blobKey, File localFile) throws IOException { return get(BlobUtils.getStorageLocationPath(basePath, jobId, blobKey), localFile, blobKey); }
private static BlobStoreService createFileSystemBlobStore(Configuration configuration) throws IOException { String storagePath = configuration.getValue( HighAvailabilityOptions.HA_STORAGE_PATH); if (isNullOrWhitespaceOnly(storagePath)) { throw new IllegalConfigurationException("Configuration is missing the mandatory parameter: " + HighAvailabilityOptions.HA_STORAGE_PATH); } final Path path; try { path = new Path(storagePath); } catch (Exception e) { throw new IOException("Invalid path for highly available storage (" + HighAvailabilityOptions.HA_STORAGE_PATH.key() + ')', e); } final FileSystem fileSystem; try { fileSystem = path.getFileSystem(); } catch (Exception e) { throw new IOException("Could not create FileSystem for highly available storage (" + HighAvailabilityOptions.HA_STORAGE_PATH.key() + ')', e); } final String clusterId = configuration.getValue(HighAvailabilityOptions.HA_CLUSTER_ID); storagePath += "/" + clusterId; return new FileSystemBlobStore(fileSystem, storagePath); }