Skip to content

Sequencer (Hash-Based Routing) #4

@prosdev

Description

@prosdev

Phase: 4 - Processing Pipeline
Estimated Effort: 2 hours
Tasks: Task 7 from specs/core-pipeline/tasks.md

Checklist

Task 7: Implement Sequencer (2 hours)

  • Create Sequencer class
  • Implement get_partition_id() with FNV-1a hash
  • Implement _get_routing_key() (userId or anonymousId)
  • Handle missing identifiers (fallback)
  • Configurable num_partitions (default: 16)
  • Write unit tests (verify consistent routing)

Acceptance Criteria

  • Same userId always routes to same partition
  • FNV-1a hash algorithm used
  • Partition distribution is even
  • Handles events without identifiers
  • Unit tests pass

Files to Create

src/eventkit/processing/sequencer.py
tests/unit/processing/test_sequencer.py

Dependencies: Issue #1
User Stories: Story 4 (Consistent Ordering per Identity)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions