slfan1989 commented on code in PR #5609: URL: https://github.com/apache/hadoop/pull/5609#discussion_r1182651785
########## hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/federation/cache/FederationGuavaCache.java: ########## @@ -0,0 +1,117 @@ +/** + * 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 + * <p> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p> + * 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.hadoop.yarn.server.federation.cache; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.thirdparty.com.google.common.cache.Cache; Review Comment: I added a description of the cache configuration in `Federation.md`. <img width="1257" alt="image" src="https://user-images.githubusercontent.com/55643692/235699094-7c7e46d3-5df3-4dd8-a488-482817edd738.png"> We initialize the cache in `FederationStateStoreFacade`. If the user does not set the specific implementation class of the cache, but sets the ttl-time of the cache, we will use the default cache `(JCache)`. FederationStateStoreFacade#initializeFacadeInternal ``` // We check the configuration of Cache, // if the configuration is null, set it to FederationJCache this.federationCache = createInstance(conf, YarnConfiguration.FEDERATION_FACADE_CACHE_CLASS, YarnConfiguration.DEFAULT_FEDERATION_FACADE_CACHE_CLASS, FederationCache.class); this.federationCache.initCache(config, stateStore); ``` -- 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: common-issues-unsubscr...@hadoop.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org