gresockj commented on code in PR #7211: URL: https://github.com/apache/nifi/pull/7211#discussion_r1199739139
########## nifi-nar-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/src/main/java/org/apache/nifi/processors/aws/v2/AwsClientCache.java: ########## @@ -0,0 +1,41 @@ +/* + * 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.nifi.processors.aws.v2; + +import com.github.benmanes.caffeine.cache.Cache; +import com.github.benmanes.caffeine.cache.Caffeine; +import org.apache.nifi.processor.ProcessContext; +import software.amazon.awssdk.core.SdkClient; + +public class AwsClientCache<T extends SdkClient> { + + private static final int MAXIMUM_CACHE_SIZE = 10; Review Comment: This was copied from the v1 version of the AwsClientCache, but looking at it now I don't see a strong reason to have a cache size limit. Since the cache key boils down to the AWS region, multiple clients would be cached if a subclass of AbstractAwsProcessor parsed the region from the ProcessContext (as in the case of S3). However, since there are currently only 38 regions, and likely not to be more than a few dozen regions in the future, it doesn't seem like a big risk to remove the limit. -- 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]
