Skip to content

Commit 3bc5d30

Browse files
committed
Make it clear that bean and immutable table schemas are moderately expensive to create.
1 parent b543435 commit 3bc5d30

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/TableSchema.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public interface TableSchema<T> {
3939
/**
4040
* Returns a builder for the {@link StaticTableSchema} implementation of this interface which allows all attributes,
4141
* tags and table structure to be directly declared in the builder.
42+
*
4243
* @param itemClass The class of the item this {@link TableSchema} will map records to.
4344
* @param <T> The type of the item this {@link TableSchema} will map records to.
4445
* @return A newly initialized {@link StaticTableSchema.Builder}.
@@ -50,6 +51,7 @@ static <T> StaticTableSchema.Builder<T> builder(Class<T> itemClass) {
5051
/**
5152
* Returns a builder for the {@link StaticImmutableTableSchema} implementation of this interface which allows all
5253
* attributes, tags and table structure to be directly declared in the builder.
54+
*
5355
* @param immutableItemClass The class of the immutable item this {@link TableSchema} will map records to.
5456
* @param immutableBuilderClass The class that can be used to construct immutable items this {@link TableSchema}
5557
* maps records to.
@@ -66,6 +68,10 @@ static <T, B> StaticImmutableTableSchema.Builder<T, B> builder(Class<T> immutabl
6668
* Scans a bean class that has been annotated with DynamoDb bean annotations and then returns a
6769
* {@link BeanTableSchema} implementation of this interface that can map records to and from items of that bean
6870
* class.
71+
*
72+
* Creating a {@link BeanTableSchema} is a moderately expensive operation, and should be performed sparingly. This is
73+
* usually done once at application startup.
74+
*
6975
* @param beanClass The bean class this {@link TableSchema} will map records to.
7076
* @param <T> The type of the item this {@link TableSchema} will map records to.
7177
* @return An initialized {@link BeanTableSchema}.
@@ -79,6 +85,9 @@ static <T> BeanTableSchema<T> fromBean(Class<T> beanClass) {
7985
* {@link ImmutableTableSchema} implementation of this interface that can map records to and from items of that
8086
* immutable class.
8187
*
88+
* Creating a {@link ImmutableTableSchema} is a moderately expensive operation, and should be performed sparingly. This is
89+
* usually done once at application startup.
90+
*
8291
* @param immutableClass The immutable class this {@link TableSchema} will map records to.
8392
* @param <T> The type of the item this {@link TableSchema} will map records to.
8493
* @return An initialized {@link ImmutableTableSchema}.
@@ -95,6 +104,9 @@ static <T> ImmutableTableSchema<T> fromImmutableClass(Class<T> immutableClass) {
95104
* {@link software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbBean}<br>
96105
* {@link software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbImmutable}
97106
*
107+
* This is a moderately expensive operation, and should be performed sparingly. This is usually done once at
108+
* application startup.
109+
*
98110
* @param annotatedClass A class that has been annotated with DynamoDb enhanced client annotations.
99111
* @param <T> The type of the item this {@link TableSchema} will map records to.
100112
* @return An initialized {@link TableSchema}

services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/mapper/BeanTableSchema.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@
8888
*
8989
* </pre>
9090
*
91+
* Creating an {@link BeanTableSchema} is a moderately expensive operation, and should be performed sparingly. This is
92+
* usually done once at application startup.
93+
*
9194
* @param <T> The type of object that this {@link TableSchema} maps to.
9295
*/
9396
@SdkPublicApi
@@ -101,6 +104,10 @@ private BeanTableSchema(StaticTableSchema<T> staticTableSchema) {
101104
/**
102105
* Scans a bean class and builds a {@link BeanTableSchema} from it that can be used with the
103106
* {@link DynamoDbEnhancedClient}.
107+
*
108+
* Creating an {@link BeanTableSchema} is a moderately expensive operation, and should be performed sparingly. This is
109+
* usually done once at application startup.
110+
*
104111
* @param beanClass The bean class to build the table schema from.
105112
* @param <T> The bean class type.
106113
* @return An initialized {@link BeanTableSchema}

services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/mapper/ImmutableTableSchema.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,11 @@
8686
* public Customer build() { ... };
8787
* }
8888
* }
89-
*
9089
* </pre>
90+
*
91+
* Creating an {@link ImmutableTableSchema} is a moderately expensive operation, and should be performed sparingly. This is
92+
* usually done once at application startup.
93+
*
9194
* @param <T> The type of object that this {@link TableSchema} maps to.
9295
*/
9396
@SdkPublicApi
@@ -101,6 +104,10 @@ private ImmutableTableSchema(StaticImmutableTableSchema<T, ?> wrappedTableSchema
101104
/**
102105
* Scans an immutable class and builds an {@link ImmutableTableSchema} from it that can be used with the
103106
* {@link DynamoDbEnhancedClient}.
107+
*
108+
* Creating an {@link ImmutableTableSchema} is a moderately expensive operation, and should be performed sparingly. This is
109+
* usually done once at application startup.
110+
*
104111
* @param immutableClass The annotated immutable class to build the table schema from.
105112
* @param <T> The immutable class type.
106113
* @return An initialized {@link ImmutableTableSchema}

0 commit comments

Comments
 (0)