bruno-roustant commented on code in PR #115:
URL: https://github.com/apache/solr-sandbox/pull/115#discussion_r1908468426
##########
encryption/src/test/java/org/apache/solr/encryption/EncryptionTestUtil.java:
##########
@@ -130,13 +143,29 @@ public EncryptionStatus encrypt(String keyId) throws
Exception {
params.set(PARAM_KEY_ID, keyId);
params.set(PARAM_TENANT_ID, TENANT_ID);
params.set(PARAM_ENCRYPTION_KEY_BLOB, generateKeyBlob(keyId));
+ if (shouldDistributeEncryptRequest()) {
+ return encryptDistrib(params);
+ }
GenericSolrRequest encryptRequest = new
GenericSolrRequest(SolrRequest.METHOD.GET, "/admin/encrypt", params);
EncryptionStatus encryptionStatus = new EncryptionStatus();
forAllReplicas(replica -> {
NamedList<Object> response = requestCore(encryptRequest, replica);
+ EncryptionRequestHandler.State state =
EncryptionRequestHandler.State.fromValue(response.get(ENCRYPTION_STATE).toString());
encryptionStatus.success &= response.get(STATUS).equals(STATUS_SUCCESS);
- encryptionStatus.complete &=
response.get(ENCRYPTION_STATE).equals(STATE_COMPLETE);
- });
+ encryptionStatus.complete &= state ==
EncryptionRequestHandler.State.COMPLETE;
+ }, false);
+ return encryptionStatus;
+ }
+
+ private EncryptionStatus encryptDistrib(ModifiableSolrParams params) throws
SolrServerException, IOException {
+ params.set(DISTRIB, "true");
Review Comment:
Thanks, I didn't know the SolrParams.wrapDefaults technique.
--
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]