SteNicholas commented on code in PR #2363:
URL: 
https://github.com/apache/incubator-celeborn/pull/2363#discussion_r1516058180


##########
worker/src/main/java/org/apache/celeborn/service/deploy/worker/WorkerSecretRegistryImpl.java:
##########
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.celeborn.service.deploy.worker;
+
+import com.google.common.base.Preconditions;
+import com.google.common.cache.Cache;
+import com.google.common.cache.CacheBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.celeborn.common.client.MasterClient;
+import org.apache.celeborn.common.network.sasl.SecretRegistry;
+import org.apache.celeborn.common.protocol.PbApplicationMeta;
+import org.apache.celeborn.common.protocol.PbApplicationMetaRequest;
+
+/** A secret registry that fetches the secret from the master if it is not 
found locally. */
+public class WorkerSecretRegistryImpl implements SecretRegistry {
+  private static final Logger LOG = 
LoggerFactory.getLogger(WorkerSecretRegistryImpl.class);
+
+  // MasterClient is created in Worker after the secret registry is created 
and this order currently
+  // cannot be changed.
+  // So, we need to set the masterClient after the secret registry is created.
+  private MasterClient masterClient;
+  private final Cache<String, String> secretCache;
+
+  public WorkerSecretRegistryImpl(long maxCacheSize) {
+    secretCache = CacheBuilder.newBuilder().maximumSize(maxCacheSize).build();

Review Comment:
   Does `secretCache` need to support expiring?



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

Reply via email to