chungen0126 commented on code in PR #4089:
URL: https://github.com/apache/ozone/pull/4089#discussion_r1054867179
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/replication/OnDemandContainerReplicationSource.java:
##########
@@ -37,11 +43,16 @@
private final ContainerController controller;
- private final TarContainerPacker packer = new TarContainerPacker();
+ private Map<String, TarContainerPacker> packer = new HashMap<>();
public OnDemandContainerReplicationSource(
ContainerController controller) {
this.controller = controller;
+ this.packer.put("NO_COMPRESSION", new
TarContainerPacker("no_compression"));
+ this.packer.put("GZIP", new TarContainerPacker(GZIP));
+ this.packer.put("LZ4", new TarContainerPacker(LZ4_FRAMED));
+ this.packer.put("SNAPPY", new TarContainerPacker(SNAPPY_FRAMED));
+ this.packer.put("ZSTD", new TarContainerPacker(ZSTANDARD));
Review Comment:
finished
##########
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestTarContainerPacker.java:
##########
@@ -90,17 +93,32 @@ public class TestTarContainerPacker {
private final ContainerLayoutVersion layout;
private final String schemaVersion;
private OzoneConfiguration conf;
+ private String compression;
- public TestTarContainerPacker(ContainerTestVersionInfo versionInfo) {
+
+ public TestTarContainerPacker(
+ ContainerTestVersionInfo versionInfo, String compression) {
this.layout = versionInfo.getLayout();
this.schemaVersion = versionInfo.getSchemaVersion();
this.conf = new OzoneConfiguration();
ContainerTestVersionInfo.setTestSchemaVersion(schemaVersion, conf);
+ this.compression = compression;
+ packer = new TarContainerPacker(compression);
+
}
@Parameterized.Parameters
public static Iterable<Object[]> parameters() {
- return ContainerTestVersionInfo.versionParameters();
+ List<ContainerTestVersionInfo> layoutList =
+ ContainerTestVersionInfo.getLayoutList();
+ List<Object[]> parameterList = new ArrayList<>();
+ for (ContainerTestVersionInfo containerTestVersionInfo : layoutList) {
+ parameterList.add(new Object[]{containerTestVersionInfo, GZIP});
+ parameterList.add(new Object[]{containerTestVersionInfo, LZ4_FRAMED});
+ parameterList.add(new Object[]{containerTestVersionInfo, SNAPPY_FRAMED});
+ parameterList.add(new Object[]{containerTestVersionInfo, ZSTANDARD});
Review Comment:
finished
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]