mirror of https://github.com/minio/minio.git
fix: rename some function names to avoid confusion (#14262)
This commit is contained in:
parent
0cac868a36
commit
3c87e1e60d
|
@ -74,7 +74,7 @@ func prepareAdminErasureTestBed(ctx context.Context) (*adminErasureTestBed, erro
|
||||||
|
|
||||||
globalEndpoints = mustGetPoolEndpoints(erasureDirs...)
|
globalEndpoints = mustGetPoolEndpoints(erasureDirs...)
|
||||||
|
|
||||||
newAllSubsystems()
|
initAllSubsystems()
|
||||||
|
|
||||||
initConfigSubsystem(ctx, objLayer)
|
initConfigSubsystem(ctx, objLayer)
|
||||||
|
|
||||||
|
|
|
@ -362,7 +362,7 @@ func TestIsReqAuthenticated(t *testing.T) {
|
||||||
t.Fatalf("unable initialize config file, %s", err)
|
t.Fatalf("unable initialize config file, %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
newAllSubsystems()
|
initAllSubsystems()
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
@ -455,7 +455,7 @@ func TestValidateAdminSignature(t *testing.T) {
|
||||||
t.Fatalf("unable initialize config file, %s", err)
|
t.Fatalf("unable initialize config file, %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
newAllSubsystems()
|
initAllSubsystems()
|
||||||
|
|
||||||
initConfigSubsystem(ctx, objLayer)
|
initConfigSubsystem(ctx, objLayer)
|
||||||
|
|
||||||
|
|
|
@ -291,7 +291,7 @@ func StartGateway(ctx *cli.Context, gw Gateway) {
|
||||||
newObject = NewGatewayLayerWithLocker(newObject)
|
newObject = NewGatewayLayerWithLocker(newObject)
|
||||||
|
|
||||||
// Calls all New() for all sub-systems.
|
// Calls all New() for all sub-systems.
|
||||||
newAllSubsystems()
|
initAllSubsystems()
|
||||||
|
|
||||||
// Once endpoints are finalized, initialize the new object api in safe mode.
|
// Once endpoints are finalized, initialize the new object api in safe mode.
|
||||||
globalObjLayerMutex.Lock()
|
globalObjLayerMutex.Lock()
|
||||||
|
@ -307,7 +307,7 @@ func StartGateway(ctx *cli.Context, gw Gateway) {
|
||||||
}
|
}
|
||||||
logger.FatalIf(globalBucketMetadataSys.Init(GlobalContext, buckets, newObject), "Unable to initialize bucket metadata")
|
logger.FatalIf(globalBucketMetadataSys.Init(GlobalContext, buckets, newObject), "Unable to initialize bucket metadata")
|
||||||
|
|
||||||
logger.FatalIf(globalNotificationSys.Init(GlobalContext, newObject), "Unable to initialize notification system")
|
logger.FatalIf(globalNotificationSys.InitBucketTargets(GlobalContext, newObject), "Unable to initialize bucket targets for notification system")
|
||||||
}
|
}
|
||||||
|
|
||||||
if globalCacheConfig.Enabled {
|
if globalCacheConfig.Enabled {
|
||||||
|
|
|
@ -673,8 +673,8 @@ func (sys *NotificationSys) set(bucket BucketInfo, meta BucketMetadata) {
|
||||||
sys.AddRulesMap(bucket.Name, config.ToRulesMap())
|
sys.AddRulesMap(bucket.Name, config.ToRulesMap())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Init - initializes notification system from notification.xml and listenxl.meta of all buckets.
|
// InitBucketTargets - initializes notification system from notification.xml of all buckets.
|
||||||
func (sys *NotificationSys) Init(ctx context.Context, objAPI ObjectLayer) error {
|
func (sys *NotificationSys) InitBucketTargets(ctx context.Context, objAPI ObjectLayer) error {
|
||||||
if objAPI == nil {
|
if objAPI == nil {
|
||||||
return errServerNotInitialized
|
return errServerNotInitialized
|
||||||
}
|
}
|
||||||
|
|
|
@ -1894,7 +1894,7 @@ func initFSObjectsB(disk string, t *testing.B) (obj ObjectLayer) {
|
||||||
|
|
||||||
newTestConfig(globalMinioDefaultRegion, obj)
|
newTestConfig(globalMinioDefaultRegion, obj)
|
||||||
|
|
||||||
newAllSubsystems()
|
initAllSubsystems()
|
||||||
|
|
||||||
return obj
|
return obj
|
||||||
}
|
}
|
||||||
|
|
|
@ -216,7 +216,7 @@ func serverHandleEnvVars() {
|
||||||
|
|
||||||
var globalHealStateLK sync.RWMutex
|
var globalHealStateLK sync.RWMutex
|
||||||
|
|
||||||
func newAllSubsystems() {
|
func initAllSubsystems() {
|
||||||
if globalIsErasure {
|
if globalIsErasure {
|
||||||
globalHealStateLK.Lock()
|
globalHealStateLK.Lock()
|
||||||
// New global heal state
|
// New global heal state
|
||||||
|
@ -225,7 +225,7 @@ func newAllSubsystems() {
|
||||||
globalHealStateLK.Unlock()
|
globalHealStateLK.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create new notification system and initialize notification targets
|
// Create new notification system and initialize notification peer targets
|
||||||
globalNotificationSys = NewNotificationSys(globalEndpoints)
|
globalNotificationSys = NewNotificationSys(globalEndpoints)
|
||||||
|
|
||||||
// Create new bucket metadata system.
|
// Create new bucket metadata system.
|
||||||
|
@ -421,7 +421,7 @@ func serverMain(ctx *cli.Context) {
|
||||||
initHelp()
|
initHelp()
|
||||||
|
|
||||||
// Initialize all sub-systems
|
// Initialize all sub-systems
|
||||||
newAllSubsystems()
|
initAllSubsystems()
|
||||||
|
|
||||||
// Is distributed setup, error out if no certificates are found for HTTPS endpoints.
|
// Is distributed setup, error out if no certificates are found for HTTPS endpoints.
|
||||||
if globalIsDistErasure {
|
if globalIsDistErasure {
|
||||||
|
@ -587,8 +587,8 @@ func serverMain(ctx *cli.Context) {
|
||||||
// Initialize bucket metadata sub-system.
|
// Initialize bucket metadata sub-system.
|
||||||
globalBucketMetadataSys.Init(GlobalContext, buckets, newObject)
|
globalBucketMetadataSys.Init(GlobalContext, buckets, newObject)
|
||||||
|
|
||||||
// Initialize bucket notification sub-system.
|
// Initialize bucket notification targets.
|
||||||
globalNotificationSys.Init(GlobalContext, newObject)
|
globalNotificationSys.InitBucketTargets(GlobalContext, newObject)
|
||||||
|
|
||||||
// initialize the new disk cache objects.
|
// initialize the new disk cache objects.
|
||||||
if globalCacheConfig.Enabled {
|
if globalCacheConfig.Enabled {
|
||||||
|
|
|
@ -42,7 +42,7 @@ func TestCheckValid(t *testing.T) {
|
||||||
t.Fatalf("unable initialize config file, %s", err)
|
t.Fatalf("unable initialize config file, %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
newAllSubsystems()
|
initAllSubsystems()
|
||||||
|
|
||||||
initConfigSubsystem(ctx, objLayer)
|
initConfigSubsystem(ctx, objLayer)
|
||||||
|
|
||||||
|
|
|
@ -223,7 +223,7 @@ func initFSObjects(disk string, t *testing.T) (obj ObjectLayer) {
|
||||||
|
|
||||||
newTestConfig(globalMinioDefaultRegion, obj)
|
newTestConfig(globalMinioDefaultRegion, obj)
|
||||||
|
|
||||||
newAllSubsystems()
|
initAllSubsystems()
|
||||||
return obj
|
return obj
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -355,7 +355,7 @@ func initTestServerWithBackend(ctx context.Context, t TestErrHandler, testServer
|
||||||
globalMinioPort = port
|
globalMinioPort = port
|
||||||
globalMinioAddr = getEndpointsLocalAddr(testServer.Disks)
|
globalMinioAddr = getEndpointsLocalAddr(testServer.Disks)
|
||||||
|
|
||||||
newAllSubsystems()
|
initAllSubsystems()
|
||||||
|
|
||||||
globalEtcdClient = nil
|
globalEtcdClient = nil
|
||||||
|
|
||||||
|
@ -1474,7 +1474,7 @@ func newTestObjectLayer(ctx context.Context, endpointServerPools EndpointServerP
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
newAllSubsystems()
|
initAllSubsystems()
|
||||||
|
|
||||||
return z, nil
|
return z, nil
|
||||||
}
|
}
|
||||||
|
@ -1518,7 +1518,7 @@ func removeDiskN(disks []string, n int) {
|
||||||
// initialies the root and returns its path.
|
// initialies the root and returns its path.
|
||||||
// return credentials.
|
// return credentials.
|
||||||
func initAPIHandlerTest(ctx context.Context, obj ObjectLayer, endpoints []string) (string, http.Handler, error) {
|
func initAPIHandlerTest(ctx context.Context, obj ObjectLayer, endpoints []string) (string, http.Handler, error) {
|
||||||
newAllSubsystems()
|
initAllSubsystems()
|
||||||
|
|
||||||
initConfigSubsystem(ctx, obj)
|
initConfigSubsystem(ctx, obj)
|
||||||
|
|
||||||
|
@ -1799,7 +1799,7 @@ func ExecObjectLayerTest(t TestErrHandler, objTest objTestType) {
|
||||||
}
|
}
|
||||||
setObjectLayer(objLayer)
|
setObjectLayer(objLayer)
|
||||||
|
|
||||||
newAllSubsystems()
|
initAllSubsystems()
|
||||||
|
|
||||||
// initialize the server and obtain the credentials and root.
|
// initialize the server and obtain the credentials and root.
|
||||||
// credentials are necessary to sign the HTTP request.
|
// credentials are necessary to sign the HTTP request.
|
||||||
|
@ -1825,7 +1825,7 @@ func ExecObjectLayerTest(t TestErrHandler, objTest objTestType) {
|
||||||
localMetacacheMgr.deleteAll()
|
localMetacacheMgr.deleteAll()
|
||||||
}
|
}
|
||||||
|
|
||||||
newAllSubsystems()
|
initAllSubsystems()
|
||||||
objLayer, fsDirs, err := prepareErasureSets32(ctx)
|
objLayer, fsDirs, err := prepareErasureSets32(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Initialization of object layer failed for Erasure setup: %s", err)
|
t.Fatalf("Initialization of object layer failed for Erasure setup: %s", err)
|
||||||
|
|
Loading…
Reference in New Issue