Skip to content

Commit

Permalink
Add a client config to the client that is now needed (#5600)
Browse files Browse the repository at this point in the history
  • Loading branch information
sugmanue authored Sep 16, 2024
1 parent f9372b5 commit d2b33fd
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,20 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.UncheckedIOException;
import java.net.URI;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Param;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.interceptor.ExecutionAttributes;
import software.amazon.awssdk.http.AbortableInputStream;
Expand Down Expand Up @@ -61,11 +69,17 @@
import software.amazon.awssdk.services.dynamodb.model.TableNotFoundException;
import software.amazon.awssdk.services.dynamodb.transform.PutItemRequestMarshaller;


@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
@Fork(1)
public class V2DynamoDbAttributeValue {

private static final AwsJsonProtocolFactory JSON_PROTOCOL_FACTORY = AwsJsonProtocolFactory
.builder()
.clientConfiguration(SdkClientConfiguration
.builder()
.option(SdkClientOption.ENDPOINT, URI.create("https://localhost"))
.build())
.defaultServiceExceptionSupplier(DynamoDbException::builder)
.protocol(AwsJsonProtocol.AWS_JSON)
.protocolVersion("1.0")
Expand Down

0 comments on commit d2b33fd

Please sign in to comment.