@Override public SegmentArchiveReader forceOpen(String archiveName) throws IOException { CloudBlobDirectory archiveDirectory = getDirectory(archiveName); return new AzureSegmentArchiveReader(archiveDirectory, ioMonitor); }
@Override public ManifestFile getManifestFile() throws IOException { return new AzureManifestFile(getBlockBlob("manifest")); }
@Override public GCJournalFile getGCJournalFile() throws IOException { return new AzureGCJournalFile(getAppendBlob("gc.log")); }
public static String getSegmentFileName(AzureSegmentArchiveEntry indexEntry) { return getSegmentFileName(indexEntry.getPosition(), indexEntry.getMsb(), indexEntry.getLsb()); }
@Override public RepositoryLock lockRepository() throws IOException { return new AzureRepositoryLock(getBlockBlob("repo.lock"), () -> { log.warn("Lost connection to the Azure. The client will be closed."); // TODO close the connection }).lock(); }
@Override public SegmentArchiveWriter create(String archiveName) throws IOException { return new AzureSegmentArchiveWriter(getDirectory(archiveName), ioMonitor, monitor); }
@Override public JournalFileReader openJournalReader() throws IOException { return new CombinedReader(getJournalBlobs()); }
private Stream<CloudBlob> getBlobs(String archiveName) throws IOException { return AzureUtilities.getBlobs(getDirectory(archiveName)); }
@Override public JournalFile getJournalFile() { return new AzureJournalFile(segmentstoreDirectory, "journal.log"); }
@Override public boolean hasGraph() { if (hasGraph == null) { try { getGraph(); } catch (IOException ignore) { } } return hasGraph; }
@Override public boolean isCreated() { return created || !queueIsEmpty(); }
@Override public String getName() { return AzureUtilities.getName(archiveDirectory); }
public static String getSegmentFileName(AzureSegmentArchiveEntry indexEntry) { return getSegmentFileName(indexEntry.getPosition(), indexEntry.getMsb(), indexEntry.getLsb()); }
@Override public RepositoryLock lockRepository() throws IOException { return new AzureRepositoryLock(getBlockBlob("repo.lock"), () -> { log.warn("Lost connection to the Azure. The client will be closed."); // TODO close the connection }).lock(); }
@Override public SegmentArchiveReader forceOpen(String archiveName) throws IOException { CloudBlobDirectory archiveDirectory = getDirectory(archiveName); return new AzureSegmentArchiveReader(archiveDirectory, ioMonitor); }
@Override public ManifestFile getManifestFile() throws IOException { return new AzureManifestFile(getBlockBlob("manifest")); }
@Override public GCJournalFile getGCJournalFile() throws IOException { return new AzureGCJournalFile(getAppendBlob("gc.log")); }
@Override public SegmentArchiveWriter create(String archiveName) throws IOException { return new AzureSegmentArchiveWriter(getDirectory(archiveName), ioMonitor, monitor); }
@Override public JournalFileReader openJournalReader() throws IOException { return new CombinedReader(getJournalBlobs()); }