@Test public void listContainerNames() throws Exception { BucketTopologyHelper bucketTopologyHelper = loadTopology("topology-test.conf"); assertThat(bucketTopologyHelper.listContainerNames("admin-metadata")).containsExactlyInAnyOrder( "1_unit", "1_objectGroup"); assertThat(bucketTopologyHelper.listContainerNames("prod-default")).isEqualTo( Streams.concat( Arrays.stream(DataCategory.values()) .filter( dataCategory -> !Arrays.asList(DataCategory.UNIT, DataCategory.OBJECTGROUP, DataCategory.OBJECT) .contains(dataCategory)) .map(dataCategory -> "2_" + dataCategory.getFolder()), Arrays.stream(DataCategory.values()) .filter( dataCategory -> !Arrays.asList(DataCategory.UNIT, DataCategory.OBJECTGROUP, DataCategory.OBJECT) .contains(dataCategory)) .map(dataCategory -> "3_" + dataCategory.getFolder()) ).collect(Collectors.toSet()) ); }
public Set<String> listContainerNames(String fileBucketId) { return this.containerToFileBucketMap.entrySet().stream() .filter(entry -> entry.getValue().equals(fileBucketId)) .map(entry -> ContainerUtils .buildContainerName(entry.getKey().getRight(), entry.getKey().getLeft().toString())) .collect(Collectors.toSet()); }
BucketTopologyHelper { public Set<String> listContainerNames(String fileBucketId) { return this.containerToFileBucketMap.entrySet().stream() .filter(entry -> entry.getValue().equals(fileBucketId)) .map(entry -> ContainerUtils .buildContainerName(entry.getKey().getRight(), entry.getKey().getLeft().toString())) .collect(Collectors.toSet()); } }
BucketTopologyHelper { public Set<String> listContainerNames(String fileBucketId) { return this.containerToFileBucketMap.entrySet().stream() .filter(entry -> entry.getValue().equals(fileBucketId)) .map(entry -> ContainerUtils .buildContainerName(entry.getKey().getRight(), entry.getKey().getLeft().toString())) .collect(Collectors.toSet()); } BucketTopologyHelper(TapeLibraryTopologyConfiguration configuration); }
BucketTopologyHelper { public Set<String> listContainerNames(String fileBucketId) { return this.containerToFileBucketMap.entrySet().stream() .filter(entry -> entry.getValue().equals(fileBucketId)) .map(entry -> ContainerUtils .buildContainerName(entry.getKey().getRight(), entry.getKey().getLeft().toString())) .collect(Collectors.toSet()); } BucketTopologyHelper(TapeLibraryTopologyConfiguration configuration); static String getFileBucketId(String bucket, String fileBucket); String getFileBucketFromContainerName(String containerName); String getBucketFromFileBucket(String fileBucket); Set<String> listFileBuckets(); Set<String> listContainerNames(String fileBucketId); Integer getTarBufferingTimeoutInMinutes(String bucketId); }
BucketTopologyHelper { public Set<String> listContainerNames(String fileBucketId) { return this.containerToFileBucketMap.entrySet().stream() .filter(entry -> entry.getValue().equals(fileBucketId)) .map(entry -> ContainerUtils .buildContainerName(entry.getKey().getRight(), entry.getKey().getLeft().toString())) .collect(Collectors.toSet()); } BucketTopologyHelper(TapeLibraryTopologyConfiguration configuration); static String getFileBucketId(String bucket, String fileBucket); String getFileBucketFromContainerName(String containerName); String getBucketFromFileBucket(String fileBucket); Set<String> listFileBuckets(); Set<String> listContainerNames(String fileBucketId); Integer getTarBufferingTimeoutInMinutes(String bucketId); static final String DEFAULT; static final String BACKUP_BUCKET; static final String BACKUP_FILE_BUCKET; }