You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "szetszwo (via GitHub)" <gi...@apache.org> on 2023/06/06 17:16:39 UTC

[GitHub] [ozone] szetszwo commented on a diff in pull request #4831: HDDS-8761. Support CodecBuffer for X509CertificateCodec.

szetszwo commented on code in PR #4831:
URL: https://github.com/apache/ozone/pull/4831#discussion_r1220034254


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/metadata/X509CertificateCodec.java:
##########
@@ -19,18 +19,27 @@
 
 package org.apache.hadoop.hdds.scm.metadata;
 
+import java.io.ByteArrayInputStream;
 import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.security.cert.CertificateException;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.security.cert.X509Certificate;
+import java.util.function.IntFunction;
+
 import org.apache.hadoop.hdds.security.exception.SCMSecurityException;
 import org.apache.hadoop.hdds.security.x509.certificate.utils.CertificateCodec;
 import org.apache.hadoop.hdds.utils.db.Codec;
+import org.apache.hadoop.hdds.utils.db.CodecBuffer;
+import org.apache.hadoop.hdds.utils.io.LengthOutputStream;
+import org.apache.ratis.util.function.CheckedFunction;
+
+import javax.annotation.Nonnull;
 
 /**
  * Codec to serialize/deserialize {@link X509Certificate}.
  */
 public final class X509CertificateCodec implements Codec<X509Certificate> {
+  private static final int INITIAL_CAPACITY = 1 << 10; // 4 KB

Review Comment:
   It should be 4KB.  I changed it to 1KB for testing and forgot to change it back.



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org