@Test public void testRemoteV2Prefix() throws ParseException { Path path = Paths.get("test_backup"); AbstractBackupPath abstractBackupPath = pathFactory.get(); Assert.assertEquals( "casstestbackup/1049_fake-app/1808575600/META_V2", abstractBackupPath.remoteV2Prefix(path, BackupFileType.META_V2).toString()); path = Paths.get("s3-bucket-name", "fake_base_dir", "-6717_random_fake_app"); Assert.assertEquals( "fake_base_dir/-6717_random_fake_app/1808575600/META_V2", abstractBackupPath.remoteV2Prefix(path, BackupFileType.META_V2).toString()); }
@Override public Path remoteV2Prefix(Path location, BackupFileType fileType) { if (location.getNameCount() <= 1) { baseDir = config.getBackupLocation(); clusterName = config.getAppName(); } else if (location.getNameCount() >= 3) { baseDir = location.getName(1).toString(); clusterName = parseAndValidateAppNameWithHash(location.getName(2).toString()); } token = instanceIdentity.getInstance().getToken(); return Paths.get(getV2Prefix().toString(), fileType.toString()); }
RemoteBackupPath extends AbstractBackupPath { @Override public Path remoteV2Prefix(Path location, BackupFileType fileType) { if (location.getNameCount() <= 1) { baseDir = config.getBackupLocation(); clusterName = config.getAppName(); } else if (location.getNameCount() >= 3) { baseDir = location.getName(1).toString(); clusterName = parseAndValidateAppNameWithHash(location.getName(2).toString()); } token = instanceIdentity.getInstance().getToken(); return Paths.get(getV2Prefix().toString(), fileType.toString()); } }
RemoteBackupPath extends AbstractBackupPath { @Override public Path remoteV2Prefix(Path location, BackupFileType fileType) { if (location.getNameCount() <= 1) { baseDir = config.getBackupLocation(); clusterName = config.getAppName(); } else if (location.getNameCount() >= 3) { baseDir = location.getName(1).toString(); clusterName = parseAndValidateAppNameWithHash(location.getName(2).toString()); } token = instanceIdentity.getInstance().getToken(); return Paths.get(getV2Prefix().toString(), fileType.toString()); } @Inject  RemoteBackupPath(IConfiguration config, InstanceIdentity factory); }
RemoteBackupPath extends AbstractBackupPath { @Override public Path remoteV2Prefix(Path location, BackupFileType fileType) { if (location.getNameCount() <= 1) { baseDir = config.getBackupLocation(); clusterName = config.getAppName(); } else if (location.getNameCount() >= 3) { baseDir = location.getName(1).toString(); clusterName = parseAndValidateAppNameWithHash(location.getName(2).toString()); } token = instanceIdentity.getInstance().getToken(); return Paths.get(getV2Prefix().toString(), fileType.toString()); } @Inject  RemoteBackupPath(IConfiguration config, InstanceIdentity factory); @Override String getRemotePath(); @Override void parseRemote(String remoteFilePath); @Override void parsePartialPrefix(String remoteFilePath); @Override String remotePrefix(Date start, Date end, String location); @Override Path remoteV2Prefix(Path location, BackupFileType fileType); @Override String clusterPrefix(String location); }
RemoteBackupPath extends AbstractBackupPath { @Override public Path remoteV2Prefix(Path location, BackupFileType fileType) { if (location.getNameCount() <= 1) { baseDir = config.getBackupLocation(); clusterName = config.getAppName(); } else if (location.getNameCount() >= 3) { baseDir = location.getName(1).toString(); clusterName = parseAndValidateAppNameWithHash(location.getName(2).toString()); } token = instanceIdentity.getInstance().getToken(); return Paths.get(getV2Prefix().toString(), fileType.toString()); } @Inject  RemoteBackupPath(IConfiguration config, InstanceIdentity factory); @Override String getRemotePath(); @Override void parseRemote(String remoteFilePath); @Override void parsePartialPrefix(String remoteFilePath); @Override String remotePrefix(Date start, Date end, String location); @Override Path remoteV2Prefix(Path location, BackupFileType fileType); @Override String clusterPrefix(String location);  }