Skip to content

Design plan

Tom Kaitchuck edited this page Nov 4, 2019 · 37 revisions

Components

  1. Controller client
    • Use async gRPC calls based on Tonic.
    • Code gen from proto in main repo
  2. Controller command line
    • Use structopt
  3. Connection factory
    • Provide a fixed interface so that additional impls can be added.
  4. Connection pool
    • Use ownership model based on a "connectionGuard" to return connections to pool.
  5. Decode frames of wire commands
  6. Serialization
    • Use ownership to manage borrowing and non-copying.
  7. Client Factory
    • Create other components and act as a meta service interface so they can instantiate appropriate dependencies as needed.
    • Need to manage lifetimes.
  8. RawClient
    • Need layer to connect receiving bytes to reply listener.
    • Use oneshot channel to manage replies (Like a completable future)
  9. Server command line
    • Verify wire compatibility test.
  10. ByteStreamWriter
    • Can use append blocks by feeding into a channel and draining it into a single block in a loop.
  11. ByteStreamReader
    • Always keep a future of a task pending by pushing completed data into a non-buffered channel.
  12. EventSegmentReader
  13. EventStreamWriterImpl
    • Inflight manager - Use enum passed into mpsc on both ends to avoid mutexes and define order.
  14. Segmented Readers
    • Need API to poll for segments
  15. Python bindings.
    • Use Py03
  16. EventStreamReaderImpl
    • Unlike java, doesn't manage segments. These are passed in externally. So group state is independent as opposed to a managed component.
    • Pull from segments into a 'current' buffer. (because individual events are handed to calles not blocks)
    • Caller can fill buffer if room from completed futures and then read from buffer. If no completed futures and empty buffer it can select on them.
    • Read call can return an enum.
  17. TableSegment
    • Need a read mode to receive updates.
  18. TableSynchronizer
    • Ownership + Functions make updates very clean.
  19. Authentication
    • Need a client to talk to keycloak to get a token to send to the controller. (This uses a standard protocol)
  20. Membership tracker
    • Similar to example to automatically detect host failures.
  21. ReaderGroupState
    • Create MultiKeyLatestItemSequentialProcessor for the non-one-off updates.
  22. Checkpoints
    • Use reader group state similar to Java.
    • Needs to call into the event reader. (Inverse dependency)
  23. TxnSegmentWriter
    • Could add support for a per-key transaction... But we need timeout.
  24. TxnEventStreamWriter
    • Needs to take time to pass to the controller
  25. Watermarking
    • EventStreamWriter noteTime
    • Reader side is similar to checkpoints, using reader group. Can call into event stream reader similar to a CP.
  26. Batch client API.
  27. Event pointer support.
  28. Read/Ack API
    • Pull from segment and return as needed, blocking for outstanding on Checkpoint.
    • Auto manage membership with tracker.
  29. Jumbo event support.
    • Stream event from a non-affiliated txn segment.

Unordered

  • Metrics
  • Logging
  • Reactor
  • Internal Serialization
  • Testing tools
  • Integrations with external tools