Skip to content

Port over table admin operations + remaining test infra - #7311

Open
RanVaknin wants to merge 5 commits into
feature/master/DDB-mapperv2from
rvaknin/port-remaining-apis
Open

Port over table admin operations + remaining test infra#7311
RanVaknin wants to merge 5 commits into
feature/master/DDB-mapperv2from
rvaknin/port-remaining-apis

Conversation

@RanVaknin

@RanVaknin RanVaknin commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

This is almost entirely a dependency swap PR. The mapper's Table Admin API (createTable, deleteTable, describeTable, and the generateRequest builders) and its test infrastructure move from the v1 SDK (com.amazonaws.) to v2 (software.amazon.awssdk.*). Most of the diff is repetitive, new X().withY( becomes X.builder().y().build(), .getX() becomes .x(), plus import changes.

additionally, I marked "skipImport": true on the mapper module in the brazil.json file, so the SDK builds can run through (will get re-enabled in the near future)

Two things are worth a closer look:

1. Null vs. empty collections
v1 collection getters return null when unset whereas v2 returns an empty collection and a separate hasXxx() presence check, never null. So a == null check copied from v1 never fires on v2. Response side reads follow the v2 form throughout the port, and this PR is no exception.

The only real UX impact could be if a user reads from generateCreateTableRequest, which returns a low level v2 CreateTableRequest. For a class with no GSIs, request.globalSecondaryIndexes() returns an empty list instead of v1's null. That empty list is the v2 client's own getter contract, identical for anyone calling v2 directly, and the mapper does not control it.

2. Test infrastructure
The test framework and fixtures use ddb.waiter().waitUntilTableExists and waitUntilTableNotExists instead of the old v1 TableUtils polling loops, and compare TableStatus by enum identity instead of string equality. One helper sets the GSI list only when it is non empty, because v2 createTable reject an explicitly empty GSI list that v1 accepted as unset.


DDB mapper v2 roadmap

** BASE PACKAGE SETUP **
+ 1. Source verbatim port ✅
+ 2. Test verbatim port ✅
+ 3. Namespace swap (main + datamodeling tests) ✅ 
+ 4. Namespace swap (remaining test packages) 

** PORTING OPERATIONS **
+ 0. converters (AttributeValue seam) ✅ 
+ 1. load() ✅
+ 2. save() ✅
+ 3. query() + scan() ✅
+ 4. deleteItem() ✅
+ 5. updateItem() ✅
+ 6. Batch operations ✅
+ 7. Transactions ✅
8. S3Link
9. Table Admin (control plane convenience methods) <--- current PR

** PERFORMANCE IMPROVEMENTS **
1. getTableModel caching
2. Wire "fast" createX AV factory methods to convertors
3. ByteBuffer → SdkBytes copy
4. Others

** DEPENDENCY MODERNIZATION **
+ 1. EasyMock -> Mockito ✅
2. Log4j 1.x -> 2.x
3. commons-logging -> SLF4J

@RanVaknin
RanVaknin marked this pull request as ready for review August 24, 2026 22:11
@RanVaknin
RanVaknin requested a review from a team as a code owner August 24, 2026 22:11
@RanVaknin RanVaknin closed this Aug 24, 2026
@github-actions

Copy link
Copy Markdown

This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 24, 2026
@RanVaknin RanVaknin reopened this Aug 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant