forked from TrueCloudLab/frostfs-node
[#265] innerring: Generate new audit event
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
8c4e033db3
commit
87e1252065
8 changed files with 158 additions and 1 deletions
|
@ -40,6 +40,8 @@ type (
|
|||
morphClient *client.Client
|
||||
|
||||
netmapSnapshot cleanupTable
|
||||
|
||||
handleNewAudit event.Handler
|
||||
}
|
||||
|
||||
// Params of the processor constructor.
|
||||
|
@ -53,6 +55,7 @@ type (
|
|||
ActiveState ActiveState
|
||||
CleanupEnabled bool
|
||||
CleanupThreshold uint64 // in epochs
|
||||
HandleAudit event.Handler
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -75,6 +78,8 @@ func New(p *Params) (*Processor, error) {
|
|||
return nil, errors.New("ir/netmap: global state is not set")
|
||||
case p.ActiveState == nil:
|
||||
return nil, errors.New("ir/netmap: global state is not set")
|
||||
case p.HandleAudit == nil:
|
||||
return nil, errors.New("ir/netmap: audit handler is not set")
|
||||
}
|
||||
|
||||
p.Log.Debug("netmap worker pool", zap.Int("size", p.PoolSize))
|
||||
|
@ -93,6 +98,7 @@ func New(p *Params) (*Processor, error) {
|
|||
activeState: p.ActiveState,
|
||||
morphClient: p.MorphClient,
|
||||
netmapSnapshot: newCleanupTable(p.CleanupEnabled, p.CleanupThreshold),
|
||||
handleNewAudit: p.HandleAudit,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue