Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-11216. Replace HAUtils#buildCAX509List usages with other direct usages #6981

Merged
merged 11 commits into from
Aug 27, 2024
Prev Previous commit
Next Next commit
Fix minor issues found during review
Galsza committed Aug 27, 2024
commit 79f2e2a9de7c6f648f3eb9c1277b461823fffacf
Original file line number Diff line number Diff line change
@@ -118,13 +118,13 @@ public class ECReconstructionCoordinator implements Closeable {
private final OzoneClientConfig ozoneClientConfig;

public ECReconstructionCoordinator(
ConfigurationSource conf, CertificateClient certClient,
ConfigurationSource conf, CertificateClient certificateClient,
SecretKeySignerClient secretKeyClient, StateContext context,
ECReconstructionMetrics metrics,
String threadNamePrefix) throws IOException {
this.context = context;
this.containerOperationClient = new ECContainerOperationClient(conf,
certClient);
certificateClient);
this.byteBufferPool = new ElasticByteBufferPool();
ozoneClientConfig = conf.getObject(OzoneClientConfig.class);
this.ecReconstructReadExecutor = createThreadPoolExecutor(
Original file line number Diff line number Diff line change
@@ -35,7 +35,6 @@
import org.apache.hadoop.hdds.scm.proxy.SCMClientConfig;
import org.apache.hadoop.hdds.scm.proxy.SCMContainerLocationFailoverProxyProvider;
import org.apache.hadoop.hdds.security.exception.SCMSecurityException;
import org.apache.hadoop.hdds.security.x509.certificate.client.CertificateClient;
import org.apache.hadoop.hdds.tracing.TracingUtil;
import org.apache.hadoop.hdds.utils.db.DBDefinition;
import org.apache.hadoop.hdds.utils.db.DBColumnFamilyDefinition;
@@ -372,13 +371,6 @@ public static List<String> getExistingSstFiles(File db) throws IOException {
return sstList;
}

private static List<X509Certificate> generateCAList(CertificateClient certClient) {
List<X509Certificate> caCertPemList = new ArrayList<>(certClient.getAllRootCaCerts());
caCertPemList.addAll(certClient.getAllCaCerts());
return caCertPemList;
}


/**
* Retry forever until CA list matches expected count.
* @param task - task to get CA list.
Original file line number Diff line number Diff line change
@@ -1610,7 +1610,6 @@ private void persistSCMCertificates() throws IOException {
// TODO: see if we can avoid doing this during every restart.
if (primaryScmNodeId != null && !primaryScmNodeId.equals(
scmStorageConfig.getScmId())) {
getScmSecurityClientWithMaxRetry(configuration, getCurrentUser());
List<String> pemEncodedCerts =
getScmSecurityClientWithMaxRetry(configuration, getCurrentUser()).listCACertificate();
// Write the primary SCM CA and Root CA during startup.
fapifta marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -728,9 +728,9 @@ private void testECReconstructionCoordinator(List<Integer> missingIndexes,
Pipeline p = containerToDeletePipeline.get(j);
org.apache.hadoop.ozone.container.common.helpers.BlockData[]
blockData = ecContainerOperationClient.listBlock(
conID, p.getFirstNode(),
(ECReplicationConfig) p.getReplicationConfig(),
cToken);
conID, p.getFirstNode(),
(ECReplicationConfig) p.getReplicationConfig(),
cToken);
blockDataArrList.add(blockData);
// Delete the first index container
XceiverClientSpi client = xceiverClientManager.acquireClient(
@@ -881,7 +881,7 @@ public void testECReconstructionCoordinatorShouldCleanupContainersOnFailure()
StorageContainerException ex =
assertThrows(StorageContainerException.class, () -> {
try (ECContainerOperationClient client =
new ECContainerOperationClient(config, certClient)) {
new ECContainerOperationClient(config, certClient)) {
client.listBlock(conID, targetDNToCheckContainerCLeaned,
new ECReplicationConfig(3, 2), cToken);
}