[ 
https://issues.apache.org/jira/browse/BEAM-14104?focusedWorklogId=753911&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-753911
 ]

ASF GitHub Bot logged work on BEAM-14104:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 07/Apr/22 08:57
            Start Date: 07/Apr/22 08:57
    Worklog Time Spent: 10m 
      Work Description: mosche commented on code in PR #17113:
URL: https://github.com/apache/beam/pull/17113#discussion_r844889941


##########
sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/common/ObjectPool.java:
##########
@@ -0,0 +1,145 @@
+/*
+ * 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.beam.sdk.io.aws2.common;
+
+import static 
org.apache.beam.sdk.io.aws2.common.ClientBuilderFactory.buildClient;
+
+import java.util.function.Function;
+import org.apache.beam.sdk.function.ThrowingConsumer;
+import org.apache.beam.sdk.io.aws2.options.AwsOptions;
+import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.BiMap;
+import 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.HashBiMap;
+import org.apache.commons.lang3.tuple.Pair;
+import org.checkerframework.checker.nullness.qual.NonNull;
+import org.checkerframework.checker.nullness.qual.Nullable;
+import org.slf4j.LoggerFactory;
+import software.amazon.awssdk.awscore.client.builder.AwsClientBuilder;
+import software.amazon.awssdk.core.SdkClient;
+
+/**
+ * Reference counting object pool to easily share & destroy objects.
+ *
+ * <p>NOTE: This relies heavily on the implementation of {@link 
#equals(Object)} for {@link KeyT}.
+ * If not implemented properly, clients can't be shared between instances of 
{@link
+ * org.apache.beam.sdk.transforms.DoFn}.
+ *
+ * @param <KeyT>> Key to share objects by
+ * @param <ObjectT>> Shared object
+ */
+public class ObjectPool<KeyT extends @NonNull Object, ObjectT extends @NonNull 
Object> {

Review Comment:
   Unfortunately it has to be public, it's used outside this package in a few 
places.
   I'll make clear it's internal only.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 753911)
    Time Spent: 2h 20m  (was: 2h 10m)

> Shard aware Kinesis record aggregation (AWS Sdk v2)
> ---------------------------------------------------
>
>                 Key: BEAM-14104
>                 URL: https://issues.apache.org/jira/browse/BEAM-14104
>             Project: Beam
>          Issue Type: Improvement
>          Components: io-java-aws
>            Reporter: Moritz Mack
>            Assignee: Moritz Mack
>            Priority: P2
>              Labels: aws-sdk-v2, kinesis
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> Implement advanced Kinesis record aggregation that is aware of active shards 
> in the stream for optimal record aggregation.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to