Skip to content

[Phase2] Issue #2: 데이터 모델 클래스 구현 #2

Description

@724thomas

Phase 목표: 핵심 인터페이스 및 설정 구현

목표: Rate Limiter에서 사용할 기본 데이터 모델 정의

작업 내용

  • UserState 클래스 구현 (사용자별 상태 정보)
  • RateLimitConfig 클래스 구현 (설정 정보)
  • Thread-Safe 자료구조 활용 (ConcurrentHashMap)

완료 기준

  • UserState에 모든 알고리즘 지원 필드 포함
  • RateLimitConfig에 설정값 정의
  • Thread-Safe 동시성 처리 고려

UserState 필수 필드

  • double remainingTokens (Token Bucket용)
  • long lastRefillTime (마지막 토큰 보충 시간)
  • int requestCount (Window 알고리즘용)
  • long windowStartTime (윈도우 시작 시간)
  • Queue<Long> requestTimes (Sliding Window Log용)

파일 위치

  • src/main/java/com/example/demo/ratelimiter/model/UserState.java
  • src/main/java/com/example/demo/ratelimiter/model/RateLimitConfig.java

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions