xiaoyuyao commented on a change in pull request #1969:
URL: https://github.com/apache/ozone/pull/1969#discussion_r583761940



##########
File path: 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMCertStore.java
##########
@@ -122,19 +150,16 @@ public X509Certificate getCertificateByID(BigInteger 
serialID,
   public List<X509Certificate> listCertificate(HddsProtos.NodeType role,
       BigInteger startSerialID, int count, CertType certType)
       throws IOException {
-    // TODO: Filter by role
     List<? extends Table.KeyValue<BigInteger, X509Certificate>> certs;
+
     if (startSerialID.longValue() == 0) {
       startSerialID = null;
     }
-    if (certType == CertType.VALID_CERTS) {
-      certs = scmMetadataStore.getValidCertsTable().getRangeKVs(
-          startSerialID, count);
-    } else {
-      certs = scmMetadataStore.getRevokedCertsTable().getRangeKVs(
-          startSerialID, count);
-    }
+
+    certs = getCertTableList(role, certType, startSerialID, count);
+
     List<X509Certificate> results = new ArrayList<>(certs.size());
+
     for (Table.KeyValue<BigInteger, X509Certificate> kv : certs) {
       try {
         X509Certificate cert = kv.getValue();

Review comment:
       The TODO: comment below can be removed as we are using different tables 
to do the filtering. 




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to