mirror of
https://github.com/hwanny1128/HGZero.git
synced 2026-01-21 10:16:24 +00:00
Merge feat/meeting-ai into main - AI 서비스 빌드 에러 수정
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
commit
d854ce6312
@ -1,72 +0,0 @@
|
||||
package com.unicorn.hgzero.ai.infra.config;
|
||||
|
||||
import com.azure.messaging.eventhubs.CheckpointStore;
|
||||
import com.azure.messaging.eventhubs.models.Checkpoint;
|
||||
import com.azure.messaging.eventhubs.models.PartitionOwnership;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* InMemory Checkpoint Store (개발/테스트용)
|
||||
*
|
||||
* MVP 개발용으로 메모리에 checkpoint를 저장합니다.
|
||||
* 운영 환경에서는 Azure Blob Storage 기반 Checkpoint Store 사용 필요.
|
||||
*/
|
||||
public class InMemoryCheckpointStore implements CheckpointStore {
|
||||
|
||||
private final Map<String, PartitionOwnership> ownershipMap = new ConcurrentHashMap<>();
|
||||
private final Map<String, Checkpoint> checkpointMap = new ConcurrentHashMap<>();
|
||||
|
||||
@Override
|
||||
public Flux<PartitionOwnership> listOwnership(String fullyQualifiedNamespace, String eventHubName, String consumerGroup) {
|
||||
return Flux.fromIterable(ownershipMap.values())
|
||||
.filter(po -> po.getFullyQualifiedNamespace().equals(fullyQualifiedNamespace)
|
||||
&& po.getEventHubName().equals(eventHubName)
|
||||
&& po.getConsumerGroup().equals(consumerGroup));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Flux<PartitionOwnership> claimOwnership(List<PartitionOwnership> requestedPartitionOwnerships) {
|
||||
return Flux.fromIterable(requestedPartitionOwnerships)
|
||||
.map(po -> {
|
||||
String key = getOwnershipKey(po);
|
||||
ownershipMap.put(key, po);
|
||||
return po;
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public Flux<Checkpoint> listCheckpoints(String fullyQualifiedNamespace, String eventHubName, String consumerGroup) {
|
||||
return Flux.fromIterable(checkpointMap.values())
|
||||
.filter(cp -> cp.getFullyQualifiedNamespace().equals(fullyQualifiedNamespace)
|
||||
&& cp.getEventHubName().equals(eventHubName)
|
||||
&& cp.getConsumerGroup().equals(consumerGroup));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<Void> updateCheckpoint(Checkpoint checkpoint) {
|
||||
String key = getCheckpointKey(checkpoint);
|
||||
checkpointMap.put(key, checkpoint);
|
||||
return Mono.empty();
|
||||
}
|
||||
|
||||
private String getOwnershipKey(PartitionOwnership ownership) {
|
||||
return String.format("%s/%s/%s/%s",
|
||||
ownership.getFullyQualifiedNamespace(),
|
||||
ownership.getEventHubName(),
|
||||
ownership.getConsumerGroup(),
|
||||
ownership.getPartitionId());
|
||||
}
|
||||
|
||||
private String getCheckpointKey(Checkpoint checkpoint) {
|
||||
return String.format("%s/%s/%s/%s",
|
||||
checkpoint.getFullyQualifiedNamespace(),
|
||||
checkpoint.getEventHubName(),
|
||||
checkpoint.getConsumerGroup(),
|
||||
checkpoint.getPartitionId());
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user