Compare commits
7 commits
master
...
fix_qodana
Author | SHA1 | Date | |
---|---|---|---|
a305ba5202 | |||
c9afdbe089 | |||
a23f268c09 | |||
37be724dc2 | |||
0664d39a71 | |||
729ff2a08c | |||
7db9944be9 |
33 changed files with 51 additions and 74 deletions
|
@ -31,7 +31,6 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
defaultNamespace = ""
|
|
||||||
namespaceTarget = "namespace"
|
namespaceTarget = "namespace"
|
||||||
containerTarget = "container"
|
containerTarget = "container"
|
||||||
userTarget = "user"
|
userTarget = "user"
|
||||||
|
|
|
@ -52,7 +52,7 @@ func Address(c *config.Config) string {
|
||||||
return AddressDefault
|
return AddressDefault
|
||||||
}
|
}
|
||||||
|
|
||||||
// BlockRates returns the value of "block_rate" config parameter
|
// BlockRate returns the value of "block_rate" config parameter
|
||||||
// from "pprof" section.
|
// from "pprof" section.
|
||||||
func BlockRate(c *config.Config) int {
|
func BlockRate(c *config.Config) int {
|
||||||
s := c.Sub(subsection)
|
s := c.Sub(subsection)
|
||||||
|
|
|
@ -117,7 +117,7 @@ func (i *delNetInfo) TombstoneLifetime() (uint64, error) {
|
||||||
return i.cfg.cfgObject.tombstoneLifetime.Load(), nil
|
return i.cfg.cfgObject.tombstoneLifetime.Load(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns node owner ID calculated from configured private key.
|
// LocalNodeID returns node owner ID calculated from configured private key.
|
||||||
//
|
//
|
||||||
// Implements method needed for Object.Delete service.
|
// Implements method needed for Object.Delete service.
|
||||||
func (i *delNetInfo) LocalNodeID() user.ID {
|
func (i *delNetInfo) LocalNodeID() user.ID {
|
||||||
|
|
|
@ -14,8 +14,6 @@ const (
|
||||||
InterruptPlacementIterationByContext = "interrupt placement iteration by context"
|
InterruptPlacementIterationByContext = "interrupt placement iteration by context"
|
||||||
|
|
||||||
Notification = "notification"
|
Notification = "notification"
|
||||||
|
|
||||||
SkipDeprecatedNotification = "skip deprecated notification"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -41,8 +39,6 @@ const (
|
||||||
InnerringCantUpdatePersistentState = "can't update persistent state"
|
InnerringCantUpdatePersistentState = "can't update persistent state"
|
||||||
InnerringCloserError = "closer error"
|
InnerringCloserError = "closer error"
|
||||||
InnerringReadConfigFromBlockchain = "read config from blockchain"
|
InnerringReadConfigFromBlockchain = "read config from blockchain"
|
||||||
NotificatorNotificatorStartProcessingObjectNotifications = "notificator: start processing object notifications"
|
|
||||||
NotificatorNotificatorProcessingObjectNotification = "notificator: processing object notification"
|
|
||||||
PolicerCouldNotGetContainer = "could not get container"
|
PolicerCouldNotGetContainer = "could not get container"
|
||||||
PolicerCouldNotConfirmContainerRemoval = "could not confirm container removal"
|
PolicerCouldNotConfirmContainerRemoval = "could not confirm container removal"
|
||||||
PolicerCouldNotInhumeObjectWithMissingContainer = "could not inhume object with missing container"
|
PolicerCouldNotInhumeObjectWithMissingContainer = "could not inhume object with missing container"
|
||||||
|
@ -61,7 +57,6 @@ const (
|
||||||
ReplicatorCouldNotReplicateObject = "could not replicate object"
|
ReplicatorCouldNotReplicateObject = "could not replicate object"
|
||||||
ReplicatorObjectSuccessfullyReplicated = "object successfully replicated"
|
ReplicatorObjectSuccessfullyReplicated = "object successfully replicated"
|
||||||
TreeRedirectingTreeServiceQuery = "redirecting tree service query"
|
TreeRedirectingTreeServiceQuery = "redirecting tree service query"
|
||||||
TreeBearerPresentedButNotAllowedByACL = "bearer presented but not allowed by ACL"
|
|
||||||
TreeCouldNotGetLastSynchronizedHeightForATree = "could not get last synchronized height for a tree"
|
TreeCouldNotGetLastSynchronizedHeightForATree = "could not get last synchronized height for a tree"
|
||||||
TreeCouldNotUpdateLastSynchronizedHeightForATree = "could not update last synchronized height for a tree"
|
TreeCouldNotUpdateLastSynchronizedHeightForATree = "could not update last synchronized height for a tree"
|
||||||
TreeSynchronizeTree = "synchronize tree"
|
TreeSynchronizeTree = "synchronize tree"
|
||||||
|
@ -107,7 +102,6 @@ const (
|
||||||
GetUnableToGetAllPartsECObject = "unable to get all parts, continue to reconstruct with existed"
|
GetUnableToGetAllPartsECObject = "unable to get all parts, continue to reconstruct with existed"
|
||||||
GetUnableToGetPartECObject = "unable to get part of the erasure-encoded object"
|
GetUnableToGetPartECObject = "unable to get part of the erasure-encoded object"
|
||||||
GetUnableToHeadPartECObject = "unable to head part of the erasure-encoded object"
|
GetUnableToHeadPartECObject = "unable to head part of the erasure-encoded object"
|
||||||
GetUnableToGetECObjectContainer = "unable to get container for erasure-coded object"
|
|
||||||
GetUnableToHeadPartsECObject = "unable to head parts of the erasure-encoded object"
|
GetUnableToHeadPartsECObject = "unable to head parts of the erasure-encoded object"
|
||||||
GetAssemblingSplittedObjectCompleted = "assembling splitted object completed"
|
GetAssemblingSplittedObjectCompleted = "assembling splitted object completed"
|
||||||
GetAssemblingECObjectCompleted = "assembling erasure-coded object completed"
|
GetAssemblingECObjectCompleted = "assembling erasure-coded object completed"
|
||||||
|
@ -271,9 +265,7 @@ const (
|
||||||
ShardFailureToMarkLockersAsGarbage = "failure to mark lockers as garbage"
|
ShardFailureToMarkLockersAsGarbage = "failure to mark lockers as garbage"
|
||||||
ShardFailureToGetExpiredUnlockedObjects = "failure to get expired unlocked objects"
|
ShardFailureToGetExpiredUnlockedObjects = "failure to get expired unlocked objects"
|
||||||
ShardCouldNotMarkObjectToDeleteInMetabase = "could not mark object to delete in metabase"
|
ShardCouldNotMarkObjectToDeleteInMetabase = "could not mark object to delete in metabase"
|
||||||
WritecacheTriedToFlushItemsFromWritecache = "tried to flush items from write-cache"
|
|
||||||
WritecacheWaitingForChannelsToFlush = "waiting for channels to flush"
|
WritecacheWaitingForChannelsToFlush = "waiting for channels to flush"
|
||||||
WritecacheCantRemoveObjectsFromTheDatabase = "can't remove objects from the database"
|
|
||||||
WritecacheCantRemoveObjectFromWritecache = "can't remove object from write-cache"
|
WritecacheCantRemoveObjectFromWritecache = "can't remove object from write-cache"
|
||||||
BlobovniczatreeCouldNotGetObjectFromLevel = "could not get object from level"
|
BlobovniczatreeCouldNotGetObjectFromLevel = "could not get object from level"
|
||||||
BlobovniczatreeCouldNotCloseBlobovnicza = "could not close Blobovnicza"
|
BlobovniczatreeCouldNotCloseBlobovnicza = "could not close Blobovnicza"
|
||||||
|
@ -413,11 +405,6 @@ const (
|
||||||
FrostFSNodeReadNewlyCreatedContainerAfterTheNotification = "read newly created container after the notification"
|
FrostFSNodeReadNewlyCreatedContainerAfterTheNotification = "read newly created container after the notification"
|
||||||
FrostFSNodeContainerCreationEventsReceipt = "container creation event's receipt"
|
FrostFSNodeContainerCreationEventsReceipt = "container creation event's receipt"
|
||||||
FrostFSNodeContainerRemovalEventsReceipt = "container removal event's receipt"
|
FrostFSNodeContainerRemovalEventsReceipt = "container removal event's receipt"
|
||||||
FrostFSNodeNotificatorCouldNotListContainers = "notificator: could not list containers"
|
|
||||||
FrostFSNodeNotificatorCouldNotSelectObjectsFromContainer = "notificator: could not select objects from container"
|
|
||||||
FrostFSNodeNotificatorCouldNotProcessObject = "notificator: could not process object"
|
|
||||||
FrostFSNodeNotificatorFinishedProcessingObjectNotifications = "notificator: finished processing object notifications"
|
|
||||||
FrostFSNodeCouldNotWriteObjectNotification = "could not write object notification"
|
|
||||||
FrostFSNodeCouldNotGetMaxObjectSizeValue = "could not get max object size value"
|
FrostFSNodeCouldNotGetMaxObjectSizeValue = "could not get max object size value"
|
||||||
FrostFSNodeCouldNotInhumeMarkRedundantCopyAsGarbage = "could not inhume mark redundant copy as garbage"
|
FrostFSNodeCouldNotInhumeMarkRedundantCopyAsGarbage = "could not inhume mark redundant copy as garbage"
|
||||||
FrostFSNodeFailedInitTracing = "failed init tracing"
|
FrostFSNodeFailedInitTracing = "failed init tracing"
|
||||||
|
@ -461,7 +448,6 @@ const (
|
||||||
FSTreeCantUnmarshalObject = "can't unmarshal an object"
|
FSTreeCantUnmarshalObject = "can't unmarshal an object"
|
||||||
FSTreeCantFushObjectBlobstor = "can't flush an object to blobstor"
|
FSTreeCantFushObjectBlobstor = "can't flush an object to blobstor"
|
||||||
FSTreeCantUpdateID = "can't update object storage ID"
|
FSTreeCantUpdateID = "can't update object storage ID"
|
||||||
FSTreeCantDecodeDBObjectAddress = "can't decode object address from the DB"
|
|
||||||
PutSingleRedirectFailure = "failed to redirect PutSingle request"
|
PutSingleRedirectFailure = "failed to redirect PutSingle request"
|
||||||
StorageIDRetrievalFailure = "can't get storage ID from metabase"
|
StorageIDRetrievalFailure = "can't get storage ID from metabase"
|
||||||
ObjectRemovalFailureBlobStor = "can't remove object from blobStor"
|
ObjectRemovalFailureBlobStor = "can't remove object from blobStor"
|
||||||
|
|
|
@ -2,6 +2,6 @@ package netmap
|
||||||
|
|
||||||
// AnnouncedKeys is an interface of utility for working with the announced public keys of the storage nodes.
|
// AnnouncedKeys is an interface of utility for working with the announced public keys of the storage nodes.
|
||||||
type AnnouncedKeys interface {
|
type AnnouncedKeys interface {
|
||||||
// Checks if the key was announced by a local node.
|
// IsLocalKey checks if the key was announced by a local node.
|
||||||
IsLocalKey(key []byte) bool
|
IsLocalKey(key []byte) bool
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,7 +95,7 @@ func TestProcessorEmitsGasToNetmapIfNoParsedWallets(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
var emission uint64 = 100_000
|
var emission uint64 = 100_000
|
||||||
var index int = 5
|
var index int = 5
|
||||||
var parsedWallets []util.Uint160 = []util.Uint160{}
|
var parsedWallets []util.Uint160
|
||||||
|
|
||||||
alphabetContracts := innerring.NewAlphabetContracts()
|
alphabetContracts := innerring.NewAlphabetContracts()
|
||||||
for i := range index + 1 {
|
for i := range index + 1 {
|
||||||
|
@ -167,7 +167,7 @@ func TestProcessorDoesntEmitGasIfNoNetmapOrParsedWallets(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
var emission uint64 = 100_000
|
var emission uint64 = 100_000
|
||||||
var index int = 5
|
var index int = 5
|
||||||
var parsedWallets []util.Uint160 = []util.Uint160{}
|
var parsedWallets []util.Uint160
|
||||||
|
|
||||||
alphabetContracts := innerring.NewAlphabetContracts()
|
alphabetContracts := innerring.NewAlphabetContracts()
|
||||||
for i := range index + 1 {
|
for i := range index + 1 {
|
||||||
|
@ -176,7 +176,7 @@ func TestProcessorDoesntEmitGasIfNoNetmapOrParsedWallets(t *testing.T) {
|
||||||
|
|
||||||
morphClient := &testMorphClient{}
|
morphClient := &testMorphClient{}
|
||||||
|
|
||||||
nodes := []netmap.NodeInfo{}
|
var nodes []netmap.NodeInfo
|
||||||
network := &netmap.NetMap{}
|
network := &netmap.NetMap{}
|
||||||
network.SetNodes(nodes)
|
network.SetNodes(nodes)
|
||||||
|
|
||||||
|
|
|
@ -8,38 +8,38 @@ import (
|
||||||
// Record is an interface of read-only
|
// Record is an interface of read-only
|
||||||
// FrostFS LOCODE database single entry.
|
// FrostFS LOCODE database single entry.
|
||||||
type Record interface {
|
type Record interface {
|
||||||
// Must return ISO 3166-1 alpha-2
|
// CountryCode must return ISO 3166-1 alpha-2
|
||||||
// country code.
|
// country code.
|
||||||
//
|
//
|
||||||
// Must not return nil.
|
// Must not return nil.
|
||||||
CountryCode() *locodedb.CountryCode
|
CountryCode() *locodedb.CountryCode
|
||||||
|
|
||||||
// Must return English short country name
|
// CountryName must return English short country name
|
||||||
// officially used by the ISO 3166
|
// officially used by the ISO 3166
|
||||||
// Maintenance Agency (ISO 3166/MA).
|
// Maintenance Agency (ISO 3166/MA).
|
||||||
CountryName() string
|
CountryName() string
|
||||||
|
|
||||||
// Must return UN/LOCODE 3-character code
|
// LocationCode must return UN/LOCODE 3-character code
|
||||||
// for the location (numerals 2-9 may also
|
// for the location (numerals 2-9 may also
|
||||||
// be used).
|
// be used).
|
||||||
//
|
//
|
||||||
// Must not return nil.
|
// Must not return nil.
|
||||||
LocationCode() *locodedb.LocationCode
|
LocationCode() *locodedb.LocationCode
|
||||||
|
|
||||||
// Must return name of the location which
|
// LocationName must return name of the location which
|
||||||
// have been allocated a UN/LOCODE without
|
// have been allocated a UN/LOCODE without
|
||||||
// diacritic sign.
|
// diacritic sign.
|
||||||
LocationName() string
|
LocationName() string
|
||||||
|
|
||||||
// Must return ISO 1-3 character alphabetic
|
// SubDivCode Must return ISO 1-3 character alphabetic
|
||||||
// and/or numeric code for the administrative
|
// and/or numeric code for the administrative
|
||||||
// division of the country concerned.
|
// division of the country concerned.
|
||||||
SubDivCode() string
|
SubDivCode() string
|
||||||
|
|
||||||
// Must return subdivision name.
|
// SubDivName must return subdivision name.
|
||||||
SubDivName() string
|
SubDivName() string
|
||||||
|
|
||||||
// Must return existing continent where is
|
// Continent must return existing continent where is
|
||||||
// the location.
|
// the location.
|
||||||
//
|
//
|
||||||
// Must not return nil.
|
// Must not return nil.
|
||||||
|
@ -49,7 +49,7 @@ type Record interface {
|
||||||
// DB is an interface of read-only
|
// DB is an interface of read-only
|
||||||
// FrostFS LOCODE database.
|
// FrostFS LOCODE database.
|
||||||
type DB interface {
|
type DB interface {
|
||||||
// Must find the record that corresponds to
|
// Get must find the record that corresponds to
|
||||||
// LOCODE and provides the Record interface.
|
// LOCODE and provides the Record interface.
|
||||||
//
|
//
|
||||||
// Must return an error if Record is nil.
|
// Must return an error if Record is nil.
|
||||||
|
|
|
@ -43,7 +43,7 @@ type (
|
||||||
// of information about the node and its finalization for adding
|
// of information about the node and its finalization for adding
|
||||||
// to the network map.
|
// to the network map.
|
||||||
NodeValidator interface {
|
NodeValidator interface {
|
||||||
// Must verify and optionally update NodeInfo structure.
|
// VerifyAndUpdate must verify and optionally update NodeInfo structure.
|
||||||
//
|
//
|
||||||
// Must return an error if NodeInfo input is invalid.
|
// Must return an error if NodeInfo input is invalid.
|
||||||
// Must return an error if it is not possible to correctly
|
// Must return an error if it is not possible to correctly
|
||||||
|
|
|
@ -56,9 +56,6 @@ func (s EvacuateScope) String() string {
|
||||||
var sb strings.Builder
|
var sb strings.Builder
|
||||||
first := true
|
first := true
|
||||||
if s&EvacuateScopeObjects == EvacuateScopeObjects {
|
if s&EvacuateScopeObjects == EvacuateScopeObjects {
|
||||||
if !first {
|
|
||||||
sb.WriteString(";")
|
|
||||||
}
|
|
||||||
sb.WriteString("objects")
|
sb.WriteString("objects")
|
||||||
first = false
|
first = false
|
||||||
}
|
}
|
||||||
|
|
|
@ -453,7 +453,7 @@ func delFKBTIndexItem(tx *bbolt.Tx, item namedBucketItem) error {
|
||||||
func hasAnyItem(b *bbolt.Bucket) bool {
|
func hasAnyItem(b *bbolt.Bucket) bool {
|
||||||
var hasAnyItem bool
|
var hasAnyItem bool
|
||||||
c := b.Cursor()
|
c := b.Cursor()
|
||||||
for k, _ := c.First(); k != nil; k, _ = c.Next() {
|
for k, _ := c.First(); k != nil; {
|
||||||
hasAnyItem = true
|
hasAnyItem = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,6 @@ func (p *PutPrm) SetIndexAttributes(v bool) {
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrUnknownObjectType = errors.New("unknown object type")
|
ErrUnknownObjectType = errors.New("unknown object type")
|
||||||
ErrIncorrectSplitInfoUpdate = errors.New("updating split info on object without it")
|
|
||||||
ErrIncorrectRootObject = errors.New("invalid root object")
|
ErrIncorrectRootObject = errors.New("invalid root object")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -368,7 +368,7 @@ func (s *Shard) Close() error {
|
||||||
if s.rb != nil {
|
if s.rb != nil {
|
||||||
s.rb.Stop(s.log)
|
s.rb.Stop(s.log)
|
||||||
}
|
}
|
||||||
components := []interface{ Close() error }{}
|
var components []interface{ Close() error }
|
||||||
|
|
||||||
if s.pilorama != nil {
|
if s.pilorama != nil {
|
||||||
components = append(components, s.pilorama)
|
components = append(components, s.pilorama)
|
||||||
|
|
|
@ -126,7 +126,7 @@ func TestRefillMetabaseCorrupted(t *testing.T) {
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
|
|
||||||
mm := NewMetricStore()
|
mm := newMetricStore()
|
||||||
|
|
||||||
sh := New(
|
sh := New(
|
||||||
WithID(NewIDFromBytes([]byte{})),
|
WithID(NewIDFromBytes([]byte{})),
|
||||||
|
@ -190,7 +190,7 @@ func TestRefillMetabase(t *testing.T) {
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
|
|
||||||
mm := NewMetricStore()
|
mm := newMetricStore()
|
||||||
|
|
||||||
sh := New(
|
sh := New(
|
||||||
WithID(NewIDFromBytes([]byte{})),
|
WithID(NewIDFromBytes([]byte{})),
|
||||||
|
|
|
@ -22,7 +22,7 @@ type MetricsWriter interface {
|
||||||
// SetShardID must set (update) the shard identifier that will be used in
|
// SetShardID must set (update) the shard identifier that will be used in
|
||||||
// metrics.
|
// metrics.
|
||||||
SetShardID(id string)
|
SetShardID(id string)
|
||||||
// SetReadonly must set shard mode.
|
// SetMode set mode of shard.
|
||||||
SetMode(mode mode.Mode)
|
SetMode(mode mode.Mode)
|
||||||
// SetContainerObjectsCount sets container object count.
|
// SetContainerObjectsCount sets container object count.
|
||||||
SetContainerObjectsCount(cnrID string, objectType string, value uint64)
|
SetContainerObjectsCount(cnrID string, objectType string, value uint64)
|
||||||
|
|
|
@ -35,7 +35,7 @@ type metricsStore struct {
|
||||||
refillStatus string
|
refillStatus string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewMetricStore() *metricsStore {
|
func newMetricStore() *metricsStore {
|
||||||
return &metricsStore{
|
return &metricsStore{
|
||||||
objCounters: map[string]uint64{
|
objCounters: map[string]uint64{
|
||||||
"phy": 0,
|
"phy": 0,
|
||||||
|
@ -404,7 +404,7 @@ func shardWithMetrics(t *testing.T, path string) (*Shard, *metricsStore) {
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
|
|
||||||
mm := NewMetricStore()
|
mm := newMetricStore()
|
||||||
|
|
||||||
sh := New(
|
sh := New(
|
||||||
WithID(NewIDFromBytes([]byte{})),
|
WithID(NewIDFromBytes([]byte{})),
|
||||||
|
|
|
@ -51,7 +51,7 @@ func TestShardReload(t *testing.T) {
|
||||||
WithMetaBaseOptions(metaOpts...),
|
WithMetaBaseOptions(metaOpts...),
|
||||||
WithPiloramaOptions(
|
WithPiloramaOptions(
|
||||||
pilorama.WithPath(filepath.Join(p, "pilorama"))),
|
pilorama.WithPath(filepath.Join(p, "pilorama"))),
|
||||||
WithMetricsWriter(NewMetricStore()),
|
WithMetricsWriter(newMetricStore()),
|
||||||
}
|
}
|
||||||
|
|
||||||
sh := New(opts...)
|
sh := New(opts...)
|
||||||
|
|
|
@ -16,7 +16,7 @@ type actorProvider interface {
|
||||||
GetRPCActor() actor.RPCActor
|
GetRPCActor() actor.RPCActor
|
||||||
}
|
}
|
||||||
|
|
||||||
// Client switches an established connection with neo-go if it is broken.
|
// SwitchRPCGuardedActor switches an established connection with neo-go if it is broken.
|
||||||
// This leads to an invalidation of an rpc actor within Client. That means the
|
// This leads to an invalidation of an rpc actor within Client. That means the
|
||||||
// components that are initilized with the rpc actor may unintentionally use
|
// components that are initilized with the rpc actor may unintentionally use
|
||||||
// it when it is already invalidated. SwitchRPCGuardedActor is used to prevent
|
// it when it is already invalidated. SwitchRPCGuardedActor is used to prevent
|
||||||
|
|
|
@ -33,7 +33,6 @@ const (
|
||||||
startEstimationMethod = "startContainerEstimation"
|
startEstimationMethod = "startContainerEstimation"
|
||||||
stopEstimationMethod = "stopContainerEstimation"
|
stopEstimationMethod = "stopContainerEstimation"
|
||||||
|
|
||||||
putSizeMethod = "putContainerSize"
|
|
||||||
listSizesMethod = "listContainerSizes"
|
listSizesMethod = "listContainerSizes"
|
||||||
getSizeMethod = "getContainerSize"
|
getSizeMethod = "getContainerSize"
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ const (
|
||||||
// put container requests.
|
// put container requests.
|
||||||
PutNotaryEvent = "put"
|
PutNotaryEvent = "put"
|
||||||
|
|
||||||
// PutNotaryEvent is an ID of notary "put named container" notification.
|
// PutNamedNotaryEvent is an ID of notary "put named container" notification.
|
||||||
PutNamedNotaryEvent = "putNamed"
|
PutNamedNotaryEvent = "putNamed"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ var (
|
||||||
alphaKeys keys.PublicKeys
|
alphaKeys keys.PublicKeys
|
||||||
wrongAlphaKeys keys.PublicKeys
|
wrongAlphaKeys keys.PublicKeys
|
||||||
|
|
||||||
dummyAlphabetInvocationScript = []byte{} // expected to be empty if generated by Notary Actor, as requester can't fill it in
|
dummyAlphabetInvocationScript []byte
|
||||||
dummyAlphabetInvocationScriptOld = append([]byte{byte(opcode.PUSHDATA1), 64}, make([]byte, 64)...) // expected to be dummy if generated manually
|
dummyAlphabetInvocationScriptOld = append([]byte{byte(opcode.PUSHDATA1), 64}, make([]byte, 64)...) // expected to be dummy if generated manually
|
||||||
wrongDummyInvocationScript = append([]byte{byte(opcode.PUSHDATA1), 64, 1}, make([]byte, 63)...)
|
wrongDummyInvocationScript = append([]byte{byte(opcode.PUSHDATA1), 64, 1}, make([]byte, 63)...)
|
||||||
|
|
||||||
|
|
|
@ -67,11 +67,11 @@ func (x AddressGroup) Swap(i, j int) {
|
||||||
|
|
||||||
// MultiAddressIterator is an interface of network address group.
|
// MultiAddressIterator is an interface of network address group.
|
||||||
type MultiAddressIterator interface {
|
type MultiAddressIterator interface {
|
||||||
// Must iterate over network addresses and pass each one
|
// IterateAddresses must iterate over network addresses and pass each one
|
||||||
// to the handler until it returns true.
|
// to the handler until it returns true.
|
||||||
IterateAddresses(func(string) bool)
|
IterateAddresses(func(string) bool)
|
||||||
|
|
||||||
// Must return number of addresses in group.
|
// NumberOfAddresses must return number of addresses in group.
|
||||||
NumberOfAddresses() int
|
NumberOfAddresses() int
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import control "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/control/
|
||||||
// HealthChecker is component interface for calculating
|
// HealthChecker is component interface for calculating
|
||||||
// the current health status of a node.
|
// the current health status of a node.
|
||||||
type HealthChecker interface {
|
type HealthChecker interface {
|
||||||
// Must calculate and return current health status of the IR application.
|
// HealthStatus must calculate and return current health status of the IR application.
|
||||||
//
|
//
|
||||||
// If status can not be calculated for any reason,
|
// If status can not be calculated for any reason,
|
||||||
// control.HealthStatus_HEALTH_STATUS_UNDEFINED should be returned.
|
// control.HealthStatus_HEALTH_STATUS_UNDEFINED should be returned.
|
||||||
|
|
|
@ -292,7 +292,7 @@ func ListTargetsLocalOverrides(cli *client.Client, req *ListTargetsLocalOverride
|
||||||
return wResp.message, nil
|
return wResp.message, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// RemoveChainLocalOverride executes ControlService.RemoveChainLocalOverride RPC.
|
// GetChainLocalOverride executes ControlService.RemoveChainLocalOverride RPC.
|
||||||
func GetChainLocalOverride(cli *client.Client, req *GetChainLocalOverrideRequest, opts ...client.CallOption) (*GetChainLocalOverrideResponse, error) {
|
func GetChainLocalOverride(cli *client.Client, req *GetChainLocalOverrideRequest, opts ...client.CallOption) (*GetChainLocalOverrideResponse, error) {
|
||||||
wResp := newResponseWrapper[GetChainLocalOverrideResponse]()
|
wResp := newResponseWrapper[GetChainLocalOverrideResponse]()
|
||||||
wReq := &requestWrapper{m: req}
|
wReq := &requestWrapper{m: req}
|
||||||
|
|
|
@ -26,13 +26,13 @@ type Server struct {
|
||||||
// HealthChecker is component interface for calculating
|
// HealthChecker is component interface for calculating
|
||||||
// the current health status of a node.
|
// the current health status of a node.
|
||||||
type HealthChecker interface {
|
type HealthChecker interface {
|
||||||
// Must calculate and return current status of the node in FrostFS network map.
|
// NetmapStatus must calculate and return current status of the node in FrostFS network map.
|
||||||
//
|
//
|
||||||
// If status can not be calculated for any reason,
|
// If status can not be calculated for any reason,
|
||||||
// control.netmapStatus_STATUS_UNDEFINED should be returned.
|
// control.netmapStatus_STATUS_UNDEFINED should be returned.
|
||||||
NetmapStatus() control.NetmapStatus
|
NetmapStatus() control.NetmapStatus
|
||||||
|
|
||||||
// Must calculate and return current health status of the node application.
|
// HealthStatus must calculate and return current health status of the node application.
|
||||||
//
|
//
|
||||||
// If status can not be calculated for any reason,
|
// If status can not be calculated for any reason,
|
||||||
// control.HealthStatus_HEALTH_STATUS_UNDEFINED should be returned.
|
// control.HealthStatus_HEALTH_STATUS_UNDEFINED should be returned.
|
||||||
|
|
|
@ -26,7 +26,7 @@ type executorSvc struct {
|
||||||
// NodeState encapsulates information
|
// NodeState encapsulates information
|
||||||
// about current node state.
|
// about current node state.
|
||||||
type NodeState interface {
|
type NodeState interface {
|
||||||
// Must return current node state
|
// LocalNodeInfo must return current node state
|
||||||
// in FrostFS API v2 NodeInfo structure.
|
// in FrostFS API v2 NodeInfo structure.
|
||||||
LocalNodeInfo() (*netmap.NodeInfo, error)
|
LocalNodeInfo() (*netmap.NodeInfo, error)
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ type NodeState interface {
|
||||||
// NetworkInfo encapsulates source of the
|
// NetworkInfo encapsulates source of the
|
||||||
// recent information about the FrostFS network.
|
// recent information about the FrostFS network.
|
||||||
type NetworkInfo interface {
|
type NetworkInfo interface {
|
||||||
// Must return recent network information in FrostFS API v2 NetworkInfo structure.
|
// Dump must return recent network information in FrostFS API v2 NetworkInfo structure.
|
||||||
//
|
//
|
||||||
// If protocol version is <=2.9, MillisecondsPerBlock and network config should be unset.
|
// If protocol version is <=2.9, MillisecondsPerBlock and network config should be unset.
|
||||||
Dump(versionsdk.Version) (*netmapSDK.NetworkInfo, error)
|
Dump(versionsdk.Version) (*netmapSDK.NetworkInfo, error)
|
||||||
|
|
|
@ -28,7 +28,7 @@ type distributedWriter struct {
|
||||||
resetSuccessAfterOnBroadcast bool
|
resetSuccessAfterOnBroadcast bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// parameters and state of container Traversal.
|
// Traversal parameters and state of container.
|
||||||
type Traversal struct {
|
type Traversal struct {
|
||||||
Opts []placement.Option
|
Opts []placement.Option
|
||||||
|
|
||||||
|
|
|
@ -27,11 +27,11 @@ type Option func(*cfg)
|
||||||
type NetworkInfo interface {
|
type NetworkInfo interface {
|
||||||
netmap.State
|
netmap.State
|
||||||
|
|
||||||
// Must return the lifespan of the tombstones
|
// TombstoneLifetime must return the lifespan of the tombstones
|
||||||
// in the FrostFS epochs.
|
// in the FrostFS epochs.
|
||||||
TombstoneLifetime() (uint64, error)
|
TombstoneLifetime() (uint64, error)
|
||||||
|
|
||||||
// Returns user ID of the local storage node. Result must not be nil.
|
// LocalNodeID returns user ID of the local storage node. Result must not be nil.
|
||||||
// New tombstone objects will have the result as an owner ID if removal is executed w/o a session.
|
// New tombstone objects will have the result as an owner ID if removal is executed w/o a session.
|
||||||
LocalNodeID() user.ID
|
LocalNodeID() user.ID
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ func NewService(cfg *objectwriter.Config,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Put calls internal service and returns v2 object streamer.
|
// Patch calls internal service and returns v2 object streamer.
|
||||||
func (s *Service) Patch() (object.PatchObjectStream, error) {
|
func (s *Service) Patch() (object.PatchObjectStream, error) {
|
||||||
nodeKey, err := s.Config.KeyStorage.GetKey(nil)
|
nodeKey, err := s.Config.KeyStorage.GetKey(nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -2,7 +2,6 @@ package object
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
clientcore "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/client"
|
clientcore "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/client"
|
||||||
|
@ -35,8 +34,6 @@ type RemoteRequestPrm struct {
|
||||||
|
|
||||||
const remoteOpTTL = 1
|
const remoteOpTTL = 1
|
||||||
|
|
||||||
var ErrNotFound = errors.New("object header not found")
|
|
||||||
|
|
||||||
// NewRemoteReader creates, initializes and returns new RemoteHeader instance.
|
// NewRemoteReader creates, initializes and returns new RemoteHeader instance.
|
||||||
func NewRemoteReader(keyStorage *util.KeyStorage, cache ClientConstructor) *RemoteReader {
|
func NewRemoteReader(keyStorage *util.KeyStorage, cache ClientConstructor) *RemoteReader {
|
||||||
return &RemoteReader{
|
return &RemoteReader{
|
||||||
|
|
|
@ -143,7 +143,7 @@ func WithPlacementBuilder(v placement.Builder) Option {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithRemoteObjectHeader returns option to set remote object header receiver of Policer.
|
// WithRemoteObjectHeaderFunc returns option to set remote object header receiver of Policer.
|
||||||
func WithRemoteObjectHeaderFunc(v RemoteObjectHeaderFunc) Option {
|
func WithRemoteObjectHeaderFunc(v RemoteObjectHeaderFunc) Option {
|
||||||
return func(c *cfg) {
|
return func(c *cfg) {
|
||||||
c.remoteHeader = v
|
c.remoteHeader = v
|
||||||
|
|
|
@ -13,7 +13,7 @@ func Uint64() uint64 {
|
||||||
return source.Uint64()
|
return source.Uint64()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Uint64 returns a random uint32 value.
|
// Uint32 returns a random uint32 value.
|
||||||
func Uint32() uint32 {
|
func Uint32() uint32 {
|
||||||
return source.Uint32()
|
return source.Uint32()
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ var (
|
||||||
errSocketIsNotInitialized = errors.New("socket is not initialized")
|
errSocketIsNotInitialized = errors.New("socket is not initialized")
|
||||||
)
|
)
|
||||||
|
|
||||||
// Initializes socket with provided name of
|
// InitSocket initializes socket with provided name of
|
||||||
// environment variable.
|
// environment variable.
|
||||||
func InitSocket() error {
|
func InitSocket() error {
|
||||||
notifySocket := os.Getenv("NOTIFY_SOCKET")
|
notifySocket := os.Getenv("NOTIFY_SOCKET")
|
||||||
|
|
|
@ -18,7 +18,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func GeneratePayloadPool(count uint, size uint) [][]byte {
|
func GeneratePayloadPool(count uint, size uint) [][]byte {
|
||||||
pool := [][]byte{}
|
var pool [][]byte
|
||||||
for i := uint(0); i < count; i++ {
|
for i := uint(0); i < count; i++ {
|
||||||
payload := make([]byte, size)
|
payload := make([]byte, size)
|
||||||
_, _ = rand.Read(payload)
|
_, _ = rand.Read(payload)
|
||||||
|
@ -29,7 +29,7 @@ func GeneratePayloadPool(count uint, size uint) [][]byte {
|
||||||
}
|
}
|
||||||
|
|
||||||
func GenerateAttributePool(count uint) []objectSDK.Attribute {
|
func GenerateAttributePool(count uint) []objectSDK.Attribute {
|
||||||
pool := []objectSDK.Attribute{}
|
var pool []objectSDK.Attribute
|
||||||
for i := uint(0); i < count; i++ {
|
for i := uint(0); i < count; i++ {
|
||||||
for j := uint(0); j < count; j++ {
|
for j := uint(0); j < count; j++ {
|
||||||
attr := *objectSDK.NewAttribute()
|
attr := *objectSDK.NewAttribute()
|
||||||
|
@ -42,7 +42,7 @@ func GenerateAttributePool(count uint) []objectSDK.Attribute {
|
||||||
}
|
}
|
||||||
|
|
||||||
func GenerateOwnerPool(count uint) []user.ID {
|
func GenerateOwnerPool(count uint) []user.ID {
|
||||||
pool := []user.ID{}
|
var pool []user.ID
|
||||||
for i := uint(0); i < count; i++ {
|
for i := uint(0); i < count; i++ {
|
||||||
pool = append(pool, usertest.ID())
|
pool = append(pool, usertest.ID())
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ func WithPayloadFromPool(pool [][]byte) ObjectOption {
|
||||||
|
|
||||||
func WithAttributesFromPool(pool []objectSDK.Attribute, count uint) ObjectOption {
|
func WithAttributesFromPool(pool []objectSDK.Attribute, count uint) ObjectOption {
|
||||||
return func(obj *objectSDK.Object) {
|
return func(obj *objectSDK.Object) {
|
||||||
attrs := []objectSDK.Attribute{}
|
var attrs []objectSDK.Attribute
|
||||||
for i := uint(0); i < count; i++ {
|
for i := uint(0); i < count; i++ {
|
||||||
attrs = append(attrs, pool[rand.Intn(len(pool))])
|
attrs = append(attrs, pool[rand.Intn(len(pool))])
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue