Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bulk Load CDK Stream Incomplete Prefactor 2: Drop Queue Reader and Si… #46516

Conversation

johnny-schmidt
Copy link
Contributor

What

  • MessageQueueReader is factored away completely
  • MessageQueue interface simplified from <KEY, MESSAGE> to <MESSAGE>. (This is because the next refactor will want an unkeyed queue, also it's just cleaner.)
  • SizedMessageQueue dropped, as well as the inner QueueChannel; now there's just a simple default abstract ChannelMessageQueue class wrapping a kotlin Channel
  • The KEY part of the interface is now in a MessageQueueSupplier<KEY, MESSAGE>, with a default supplier being wrapped records by stream descriptor
  • Memory handling taken out of the queue entirely; the default queue has a message type of Reserved<DestinationRecordWrapped>>
  • Slight refactor on the last MemoryManager PR to make the Reservation into a Reserved wrapper for an associated type
  • Reserved is now acquired by MessageQueueWriter and released by SpillToDiskTask at the end of a use block

Also:

  • test changes for the new code/behaviors

Note

  • Some of the test changes is just throwing mocks away -- the interface around the message queue got so thin that there was no need for them anymore
  • The QueueWriter reserves memory for the queue at the beginning, but never releases it. That's fine for now -- the next refactor will make it elegant for it to do. all its work inside a use block
  • Obviously it would be better to take the reservation in the InputConsumer, not the Writer -- again, the next refactor is going to combine them in a way that will make that convenient

@johnny-schmidt johnny-schmidt requested a review from a team as a code owner October 5, 2024 23:43
Copy link

vercel bot commented Oct 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Oct 5, 2024 11:44pm

@octavia-squidington-iii octavia-squidington-iii added the CDK Connector Development Kit label Oct 5, 2024
@johnny-schmidt johnny-schmidt force-pushed the jschmidt/issue-9972/load-cdk-stream-incomplete-prefactor/drop-reader-sized-queue branch from b9f1049 to 04a512e Compare October 5, 2024 23:44
@@ -37,56 +38,25 @@ data class StreamCompleteWrapped(
override val sizeBytes: Long = 0L
}

class DestinationRecordQueue : ChannelMessageQueue<Reserved<DestinationRecordWrapped>>()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can this just be a type alias? https://kotlinlang.org/docs/type-aliases.html

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think no? Because I need to instantiate it when initializing the QueueSupplier?

@johnny-schmidt johnny-schmidt merged commit 584a289 into master Oct 7, 2024
31 checks passed
@johnny-schmidt johnny-schmidt deleted the jschmidt/issue-9972/load-cdk-stream-incomplete-prefactor/drop-reader-sized-queue branch October 7, 2024 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CDK Connector Development Kit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants