@Test public void testGetIncrementalFiles() throws Exception { DateUtil.DateRange dateRange = new DateUtil.DateRange("202812071820,20281229"); Iterator<AbstractBackupPath> incrementals = metaProxy.getIncrementals(dateRange); int i = 0; while (incrementals.hasNext()) { System.out.println(incrementals.next()); i++; } Assert.assertEquals(3, i); }
@Override public Iterator<AbstractBackupPath> getIncrementals(DateUtil.DateRange dateRange) throws BackupRestoreException { String incrementalPrefix = getMatch(dateRange, AbstractBackupPath.BackupFileType.SST_V2); String marker = getMatch( new DateUtil.DateRange(dateRange.getStartTime(), null), AbstractBackupPath.BackupFileType.SST_V2); logger.info( "Listing filesystem with prefix: {}, marker: {}, daterange: {}", incrementalPrefix, marker, dateRange); Iterator<String> iterator = fs.listFileSystem(incrementalPrefix, null, marker); Iterator<AbstractBackupPath> transformIterator = new TransformIterator<>( iterator, s -> { AbstractBackupPath path = abstractBackupPathProvider.get(); path.parseRemote(s); return path; }); return new FilterIterator<>( transformIterator, abstractBackupPath -> (abstractBackupPath.getLastModified().isAfter(dateRange.getStartTime()) && abstractBackupPath .getLastModified() .isBefore(dateRange.getEndTime())) || abstractBackupPath .getLastModified() .equals(dateRange.getStartTime()) || abstractBackupPath .getLastModified() .equals(dateRange.getEndTime())); }
MetaV2Proxy implements IMetaProxy { @Override public Iterator<AbstractBackupPath> getIncrementals(DateUtil.DateRange dateRange) throws BackupRestoreException { String incrementalPrefix = getMatch(dateRange, AbstractBackupPath.BackupFileType.SST_V2); String marker = getMatch( new DateUtil.DateRange(dateRange.getStartTime(), null), AbstractBackupPath.BackupFileType.SST_V2); logger.info( "Listing filesystem with prefix: {}, marker: {}, daterange: {}", incrementalPrefix, marker, dateRange); Iterator<String> iterator = fs.listFileSystem(incrementalPrefix, null, marker); Iterator<AbstractBackupPath> transformIterator = new TransformIterator<>( iterator, s -> { AbstractBackupPath path = abstractBackupPathProvider.get(); path.parseRemote(s); return path; }); return new FilterIterator<>( transformIterator, abstractBackupPath -> (abstractBackupPath.getLastModified().isAfter(dateRange.getStartTime()) && abstractBackupPath .getLastModified() .isBefore(dateRange.getEndTime())) || abstractBackupPath .getLastModified() .equals(dateRange.getStartTime()) || abstractBackupPath .getLastModified() .equals(dateRange.getEndTime())); } }
MetaV2Proxy implements IMetaProxy { @Override public Iterator<AbstractBackupPath> getIncrementals(DateUtil.DateRange dateRange) throws BackupRestoreException { String incrementalPrefix = getMatch(dateRange, AbstractBackupPath.BackupFileType.SST_V2); String marker = getMatch( new DateUtil.DateRange(dateRange.getStartTime(), null), AbstractBackupPath.BackupFileType.SST_V2); logger.info( "Listing filesystem with prefix: {}, marker: {}, daterange: {}", incrementalPrefix, marker, dateRange); Iterator<String> iterator = fs.listFileSystem(incrementalPrefix, null, marker); Iterator<AbstractBackupPath> transformIterator = new TransformIterator<>( iterator, s -> { AbstractBackupPath path = abstractBackupPathProvider.get(); path.parseRemote(s); return path; }); return new FilterIterator<>( transformIterator, abstractBackupPath -> (abstractBackupPath.getLastModified().isAfter(dateRange.getStartTime()) && abstractBackupPath .getLastModified() .isBefore(dateRange.getEndTime())) || abstractBackupPath .getLastModified() .equals(dateRange.getStartTime()) || abstractBackupPath .getLastModified() .equals(dateRange.getEndTime())); } @Inject  MetaV2Proxy(
            IConfiguration configuration,
            IFileSystemContext backupFileSystemCtx,
            Provider<AbstractBackupPath> abstractBackupPathProvider); }
MetaV2Proxy implements IMetaProxy { @Override public Iterator<AbstractBackupPath> getIncrementals(DateUtil.DateRange dateRange) throws BackupRestoreException { String incrementalPrefix = getMatch(dateRange, AbstractBackupPath.BackupFileType.SST_V2); String marker = getMatch( new DateUtil.DateRange(dateRange.getStartTime(), null), AbstractBackupPath.BackupFileType.SST_V2); logger.info( "Listing filesystem with prefix: {}, marker: {}, daterange: {}", incrementalPrefix, marker, dateRange); Iterator<String> iterator = fs.listFileSystem(incrementalPrefix, null, marker); Iterator<AbstractBackupPath> transformIterator = new TransformIterator<>( iterator, s -> { AbstractBackupPath path = abstractBackupPathProvider.get(); path.parseRemote(s); return path; }); return new FilterIterator<>( transformIterator, abstractBackupPath -> (abstractBackupPath.getLastModified().isAfter(dateRange.getStartTime()) && abstractBackupPath .getLastModified() .isBefore(dateRange.getEndTime())) || abstractBackupPath .getLastModified() .equals(dateRange.getStartTime()) || abstractBackupPath .getLastModified() .equals(dateRange.getEndTime())); } @Inject  MetaV2Proxy(
            IConfiguration configuration,
            IFileSystemContext backupFileSystemCtx,
            Provider<AbstractBackupPath> abstractBackupPathProvider); @Override Path getLocalMetaFileDirectory(); @Override String getMetaPrefix(DateUtil.DateRange dateRange); @Override Iterator<AbstractBackupPath> getIncrementals(DateUtil.DateRange dateRange); @Override List<AbstractBackupPath> findMetaFiles(DateUtil.DateRange dateRange); @Override Path downloadMetaFile(AbstractBackupPath meta); @Override void cleanupOldMetaFiles(); @Override List<String> getSSTFilesFromMeta(Path localMetaPath); @Override BackupVerificationResult isMetaFileValid(AbstractBackupPath metaBackupPath); }
MetaV2Proxy implements IMetaProxy { @Override public Iterator<AbstractBackupPath> getIncrementals(DateUtil.DateRange dateRange) throws BackupRestoreException { String incrementalPrefix = getMatch(dateRange, AbstractBackupPath.BackupFileType.SST_V2); String marker = getMatch( new DateUtil.DateRange(dateRange.getStartTime(), null), AbstractBackupPath.BackupFileType.SST_V2); logger.info( "Listing filesystem with prefix: {}, marker: {}, daterange: {}", incrementalPrefix, marker, dateRange); Iterator<String> iterator = fs.listFileSystem(incrementalPrefix, null, marker); Iterator<AbstractBackupPath> transformIterator = new TransformIterator<>( iterator, s -> { AbstractBackupPath path = abstractBackupPathProvider.get(); path.parseRemote(s); return path; }); return new FilterIterator<>( transformIterator, abstractBackupPath -> (abstractBackupPath.getLastModified().isAfter(dateRange.getStartTime()) && abstractBackupPath .getLastModified() .isBefore(dateRange.getEndTime())) || abstractBackupPath .getLastModified() .equals(dateRange.getStartTime()) || abstractBackupPath .getLastModified() .equals(dateRange.getEndTime())); } @Inject  MetaV2Proxy(
            IConfiguration configuration,
            IFileSystemContext backupFileSystemCtx,
            Provider<AbstractBackupPath> abstractBackupPathProvider); @Override Path getLocalMetaFileDirectory(); @Override String getMetaPrefix(DateUtil.DateRange dateRange); @Override Iterator<AbstractBackupPath> getIncrementals(DateUtil.DateRange dateRange); @Override List<AbstractBackupPath> findMetaFiles(DateUtil.DateRange dateRange); @Override Path downloadMetaFile(AbstractBackupPath meta); @Override void cleanupOldMetaFiles(); @Override List<String> getSSTFilesFromMeta(Path localMetaPath); @Override BackupVerificationResult isMetaFileValid(AbstractBackupPath metaBackupPath);  }