mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-19 19:03:54 +01:00
save checkpoint every 2 seconds
This commit is contained in:
1 parent
233ade4187
commit
2ff548a41d
4 files changed
+97
-47
No files matched your search
@@ -12,6 +12,7 @@ import (
|
||||
// SMQOffsetIntegration provides integration between offset management and SMQ broker
|
||||
type SMQOffsetIntegration struct {
|
||||
mu sync.RWMutex
|
||||
registry *PartitionOffsetRegistry
|
||||
offsetAssigner *OffsetAssigner
|
||||
offsetSubscriber *OffsetSubscriber
|
||||
offsetSeeker *OffsetSeeker
|
||||
@@ -23,12 +24,18 @@ func NewSMQOffsetIntegration(storage OffsetStorage) *SMQOffsetIntegration {
|
||||
assigner := &OffsetAssigner{registry: registry}
|
||||
|
||||
return &SMQOffsetIntegration{
|
||||
registry: registry,
|
||||
offsetAssigner: assigner,
|
||||
offsetSubscriber: NewOffsetSubscriber(registry),
|
||||
offsetSeeker: NewOffsetSeeker(registry),
|
||||
}
|
||||
}
|
||||
|
||||
// Close stops all background checkpoint goroutines and performs final checkpoints
|
||||
func (integration *SMQOffsetIntegration) Close() error {
|
||||
return integration.registry.Close()
|
||||
}
|
||||
|
||||
// PublishRecord publishes a record and assigns it an offset
|
||||
func (integration *SMQOffsetIntegration) PublishRecord(
|
||||
namespace, topicName string,
|
||||
|
||||
Reference in new issue
Block a user