deardeng commented on code in PR #10693:
URL: https://github.com/apache/doris/pull/10693#discussion_r917525593
##########
fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java:
##########
@@ -992,6 +999,57 @@ public TWaitingTxnStatusResult
waitingTxnStatus(TWaitingTxnStatusRequest request
@Override
public TGetStoragePolicyResult refreshStoragePolicy() throws TException {
- throw new TException("not implement");
+ LOG.debug("refresh storage policy request");
+ TGetStoragePolicyResult result = new TGetStoragePolicyResult();
+ TStatus status = new TStatus(TStatusCode.OK);
+ result.setStatus(status);
+
+ List<Policy> policyList =
Catalog.getCurrentCatalog().getPolicyMgr().getPoliciesByType(PolicyTypeEnum.STORAGE);
+ policyList.forEach(
+ iter -> {
+ // default policy not init.
+ if (((StoragePolicy) iter).getStorageResource() == null) {
+ return;
+ }
+ TGetStoragePolicy rEntry = new TGetStoragePolicy();
+ rEntry.setPolicyName(iter.getPolicyName());
+ //java 8 not support ifPresentOrElse
+ final long[] ttlCoolDown = {-1};
+ Optional.ofNullable(((StoragePolicy)
iter).getCooldownTtl())
Review Comment:
ok,i modify it more gracefully
--
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]