diff --git a/app/upgrade.go b/app/upgrade.go index cc12f1a5f..92c104c5f 100644 --- a/app/upgrade.go +++ b/app/upgrade.go @@ -30,6 +30,7 @@ func (app *App) RegisterUpgradeHandlers(chainID string, serverCfg *serverconfig. app.registerHulunbeierPatchUpgradeHandler() app.registerUralUpgradeHandler() app.registerPawneeUpgradeHandler() + app.registerSerengetiUpgradeHandler() // app.register...() // ... return nil @@ -215,3 +216,20 @@ func (app *App) registerPawneeUpgradeHandler() { return nil }) } + +func (app *App) registerSerengetiUpgradeHandler() { + // Register the upgrade handler + app.UpgradeKeeper.SetUpgradeHandler(upgradetypes.Serengeti, + func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + app.Logger().Info("upgrade to ", plan.Name) + app.VirtualgroupKeeper.MigrateGlobalVirtualGroupFamiliesForSP(ctx) + return app.mm.RunMigrations(ctx, app.configurator, fromVM) + }) + + // Register the upgrade initializer + app.UpgradeKeeper.SetUpgradeInitializer(upgradetypes.Serengeti, + func() error { + app.Logger().Info("Init Serengeti upgrade") + return nil + }) +} diff --git a/deployment/localup/localup.sh b/deployment/localup/localup.sh index 4feb91b5a..5553b9ea1 100644 --- a/deployment/localup/localup.sh +++ b/deployment/localup/localup.sh @@ -178,6 +178,7 @@ function generate_genesis() { echo -e '[[upgrade]]\nname = "HulunbeierPatch"\nheight = 21\ninfo = ""' >> ${workspace}/.local/validator${i}/config/app.toml echo -e '[[upgrade]]\nname = "Ural"\nheight = 22\ninfo = ""' >> ${workspace}/.local/validator${i}/config/app.toml echo -e '[[upgrade]]\nname = "Pawnee"\nheight = 23\ninfo = ""' >> ${workspace}/.local/validator${i}/config/app.toml + echo -e '[[upgrade]]\nname = "Serengeti"\nheight = 24\ninfo = ""' >> ${workspace}/.local/validator${i}/config/app.toml done # enable swagger API for validator0 diff --git a/e2e/tests/virtualgroup_test.go b/e2e/tests/virtualgroup_test.go index b491dc331..ef99e0508 100644 --- a/e2e/tests/virtualgroup_test.go +++ b/e2e/tests/virtualgroup_test.go @@ -82,6 +82,27 @@ func (s *VirtualGroupTestSuite) queryGlobalVirtualGroupsByFamily(familyID uint32 return resp.GlobalVirtualGroups } +func (s *VirtualGroupTestSuite) querySpAvailableGlobalVirtualGroupFamilies(spId uint32) []uint32 { + resp, err := s.Client.QuerySpAvailableGlobalVirtualGroupFamilies( + context.Background(), + &virtualgroupmoduletypes.QuerySPAvailableGlobalVirtualGroupFamiliesRequest{ + SpId: spId, + }) + s.Require().NoError(err) + return resp.GlobalVirtualGroupFamilyIds +} + +func (s *VirtualGroupTestSuite) querySpOptimalGlobalVirtualGroupFamily(spId uint32, strategy virtualgroupmoduletypes.PickVGFStrategy) uint32 { + resp, err := s.Client.QuerySpOptimalGlobalVirtualGroupFamily( + context.Background(), + &virtualgroupmoduletypes.QuerySpOptimalGlobalVirtualGroupFamilyRequest{ + SpId: spId, + PickVgfStrategy: strategy, + }) + s.Require().NoError(err) + return resp.GlobalVirtualGroupFamilyId +} + func (s *VirtualGroupTestSuite) queryAvailableGlobalVirtualGroupFamilies(familyIds []uint32) []uint32 { resp, err := s.Client.AvailableGlobalVirtualGroupFamilies( context.Background(), @@ -111,6 +132,11 @@ func (s *VirtualGroupTestSuite) TestBasic() { availableGvgFamilyIds := s.queryAvailableGlobalVirtualGroupFamilies([]uint32{gvg.FamilyId}) s.Require().Equal(availableGvgFamilyIds[0], gvg.FamilyId) + spAvailableGvgFamilyIds := s.querySpAvailableGlobalVirtualGroupFamilies(primarySP.Info.Id) + s.Require().Equal(spAvailableGvgFamilyIds[0], gvg.FamilyId) + + spOptimalGvgFamilyId := s.querySpOptimalGlobalVirtualGroupFamily(primarySP.Info.Id, virtualgroupmoduletypes.Strategy_Maximize_Free_Store_Size) + s.Require().Equal(spOptimalGvgFamilyId, gvg.FamilyId) srcGVGs := s.queryGlobalVirtualGroupsByFamily(gvg.FamilyId) diff --git a/go.mod b/go.mod index d9ed57788..1c6b6fa79 100644 --- a/go.mod +++ b/go.mod @@ -179,7 +179,7 @@ replace ( github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v1.2.0 github.com/cometbft/cometbft-db => github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1 github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 - github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v1.4.1-0.20240221065455-ef1f7f0d2659 + github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v1.4.1-0.20240305064839-3cb07f5a365c github.com/cosmos/iavl => github.com/bnb-chain/greenfield-iavl v0.20.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 github.com/wercker/journalhook => github.com/wercker/journalhook v0.0.0-20230927020745-64542ffa4117 diff --git a/go.sum b/go.sum index c2441884b..71e0663e1 100644 --- a/go.sum +++ b/go.sum @@ -163,8 +163,8 @@ github.com/bnb-chain/greenfield-cometbft v1.2.0 h1:LTStppZS9WkVj0TfEYKkk5OAQDGfY github.com/bnb-chain/greenfield-cometbft v1.2.0/go.mod h1:WVOEZ59UYM2XePQH47/IQfcInspDn8wbRXhFSJrbU1c= github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1 h1:XcWulGacHVRiSCx90Q8Y//ajOrLNBQWR/KDB89dy3cU= github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1/go.mod h1:ey1CiK4bYo1RBNJLRiVbYr5CMdSxci9S/AZRINLtppI= -github.com/bnb-chain/greenfield-cosmos-sdk v1.4.1-0.20240221065455-ef1f7f0d2659 h1:ytOD5CuSsmV9pe9HXXJEsxiDKxHzOYShSG8s21Yw5Xw= -github.com/bnb-chain/greenfield-cosmos-sdk v1.4.1-0.20240221065455-ef1f7f0d2659/go.mod h1:XF8U3VN1euzLkIR5xiSNyQSnBabvnD86oz6fgdrpteQ= +github.com/bnb-chain/greenfield-cosmos-sdk v1.4.1-0.20240305064839-3cb07f5a365c h1:H0Rvx1FTVNgmXnUYvG0z3oFVvixPzlUHGN2JOPoNszM= +github.com/bnb-chain/greenfield-cosmos-sdk v1.4.1-0.20240305064839-3cb07f5a365c/go.mod h1:XF8U3VN1euzLkIR5xiSNyQSnBabvnD86oz6fgdrpteQ= github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230816082903-b48770f5e210 h1:GHPbV2bC+gmuO6/sG0Tm8oGal3KKSRlyE+zPscDjlA8= github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230816082903-b48770f5e210/go.mod h1:vhsZxXE9tYJeYB5JR4hPhd6Pc/uPf7j1T8IJ7p9FdeM= github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230816082903-b48770f5e210 h1:FLVOn4+OVbsKi2+YJX5kmD27/4dRu4FW7xCXFhzDO5s= diff --git a/proto/greenfield/virtualgroup/common.proto b/proto/greenfield/virtualgroup/common.proto new file mode 100644 index 000000000..68114bd50 --- /dev/null +++ b/proto/greenfield/virtualgroup/common.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package greenfield.virtualgroup; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/bnb-chain/greenfield/x/virtualgroup/types"; + +// PickVGFStrategy represents the method for selecting the best global virtual group family based on the strategy +enum PickVGFStrategy { + option (gogoproto.goproto_enum_prefix) = false; + + Strategy_Maximize_Free_Store_Size = 0; +} diff --git a/proto/greenfield/virtualgroup/query.proto b/proto/greenfield/virtualgroup/query.proto index 9a0f289b0..5acfdde90 100644 --- a/proto/greenfield/virtualgroup/query.proto +++ b/proto/greenfield/virtualgroup/query.proto @@ -5,6 +5,7 @@ package greenfield.virtualgroup; import "cosmos/base/query/v1beta1/pagination.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; +import "greenfield/virtualgroup/common.proto"; import "greenfield/virtualgroup/params.proto"; import "greenfield/virtualgroup/types.proto"; @@ -51,6 +52,16 @@ service Query { rpc GVGStatistics(QuerySPGVGStatisticsRequest) returns (QuerySPGVGStatisticsResponse) { option (google.api.http).get = "/greenfield/virtualgroup/sp_gvg_statistics"; } + + // QuerySpAvailableGlobalVirtualGroupFamilies filters a list of GlobalVirtualGroupFamilies IDs under a certain SP that are qualified to create a bucket on + rpc QuerySpAvailableGlobalVirtualGroupFamilies(QuerySPAvailableGlobalVirtualGroupFamiliesRequest) returns (QuerySPAvailableGlobalVirtualGroupFamiliesResponse) { + option (google.api.http).get = "/greenfield/virtualgroup/sp_available_global_virtual_group_families"; + } + + // QuerySpOptimalGlobalVirtualGroupFamily filters the optimal GlobalVirtualGroupFamily under a certain SP that is qualified to create a bucket on + rpc QuerySpOptimalGlobalVirtualGroupFamily(QuerySpOptimalGlobalVirtualGroupFamilyRequest) returns (QuerySpOptimalGlobalVirtualGroupFamilyResponse) { + option (google.api.http).get = "/greenfield/virtualgroup/sp_optimal_global_virtual_group_family"; + } } // QueryParamsRequest is request type for the Query/Params RPC method. @@ -119,3 +130,20 @@ message QuerySPGVGStatisticsRequest { message QuerySPGVGStatisticsResponse { GVGStatisticsWithinSP gvg_stats = 1; } + +message QuerySPAvailableGlobalVirtualGroupFamiliesRequest { + uint32 sp_id = 1; +} + +message QuerySPAvailableGlobalVirtualGroupFamiliesResponse { + repeated uint32 global_virtual_group_family_ids = 1; +} + +message QuerySpOptimalGlobalVirtualGroupFamilyRequest { + uint32 sp_id = 1; + PickVGFStrategy pick_vgf_strategy = 2; +} + +message QuerySpOptimalGlobalVirtualGroupFamilyResponse { + uint32 global_virtual_group_family_id = 1; +} diff --git a/proto/greenfield/virtualgroup/types.proto b/proto/greenfield/virtualgroup/types.proto index 0104d1890..083e0e774 100644 --- a/proto/greenfield/virtualgroup/types.proto +++ b/proto/greenfield/virtualgroup/types.proto @@ -73,6 +73,13 @@ message GVGStatisticsWithinSP { uint32 break_redundancy_reqmt_gvg_count = 4; } +message GVGFamilyStatisticsWithinSP { + // sp_id defines the id of the sp which the statistics associated to + uint32 sp_id = 1; + // global_virtual_group_family_ids is a list of identifiers of the global virtual group family associated with the SP. + repeated uint32 global_virtual_group_family_ids = 2; +} + message SwapOutInfo { // sp_id is the unique id of the storage provider who want to swap out. uint32 sp_id = 1; diff --git a/swagger/static/swagger.yaml b/swagger/static/swagger.yaml index 4f32a9221..b0870d8cf 100644 --- a/swagger/static/swagger.yaml +++ b/swagger/static/swagger.yaml @@ -6310,6 +6310,54 @@ paths: format: byte tags: - Query + /greenfield/virtualgroup/sp_available_global_virtual_group_families: + get: + summary: >- + QuerySpAvailableGlobalVirtualGroupFamilies filters a list of + GlobalVirtualGroupFamilies IDs under a certain SP that are qualified to + create a bucket on + operationId: QuerySpAvailableGlobalVirtualGroupFamilies + responses: + '200': + description: A successful response. + schema: + type: object + properties: + global_virtual_group_family_ids: + type: array + items: + type: integer + format: int64 + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: sp_id + in: query + required: false + type: integer + format: int64 + tags: + - Query /greenfield/virtualgroup/sp_gvg_statistics: get: summary: GVGStatistics gets gvg statistics for a SP @@ -6394,6 +6442,59 @@ paths: format: int64 tags: - Query + /greenfield/virtualgroup/sp_optimal_global_virtual_group_family: + get: + summary: >- + QuerySpOptimalGlobalVirtualGroupFamily filters the optimal + GlobalVirtualGroupFamily under a certain SP that is qualified to create + a bucket on + operationId: QuerySpOptimalGlobalVirtualGroupFamily + responses: + '200': + description: A successful response. + schema: + type: object + properties: + global_virtual_group_family_id: + type: integer + format: int64 + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: sp_id + in: query + required: false + type: integer + format: int64 + - name: pick_vgf_strategy + in: query + required: false + type: string + enum: + - Strategy_Maximize_Free_Store_Size + default: Strategy_Maximize_Free_Store_Size + tags: + - Query /greenfield/virtualgroup/swap_in_info: get: summary: >- @@ -37136,6 +37237,14 @@ definitions: type: string description: the the number of sp allowed to exit concurrently. description: Params defines the parameters for the module. + greenfield.virtualgroup.PickVGFStrategy: + type: string + enum: + - Strategy_Maximize_Free_Store_Size + default: Strategy_Maximize_Free_Store_Size + title: >- + PickVGFStrategy represents the method for selecting the best global + virtual group family based on the strategy greenfield.virtualgroup.QueryGlobalVirtualGroupByFamilyIDResponse: type: object properties: @@ -37376,6 +37485,14 @@ definitions: type: string description: the the number of sp allowed to exit concurrently. description: QueryParamsResponse is response type for the Query/Params RPC method. + greenfield.virtualgroup.QuerySPAvailableGlobalVirtualGroupFamiliesResponse: + type: object + properties: + global_virtual_group_family_ids: + type: array + items: + type: integer + format: int64 greenfield.virtualgroup.QuerySPGVGStatisticsResponse: type: object properties: @@ -37421,6 +37538,12 @@ definitions: unique to all other SP. So this will not be used for swapIn individual GVG as secondary + greenfield.virtualgroup.QuerySpOptimalGlobalVirtualGroupFamilyResponse: + type: object + properties: + global_virtual_group_family_id: + type: integer + format: int64 greenfield.virtualgroup.QuerySwapInInfoResponse: type: object properties: diff --git a/x/storage/keeper/keeper.go b/x/storage/keeper/keeper.go index 2c4927b51..08d8a01e6 100644 --- a/x/storage/keeper/keeper.go +++ b/x/storage/keeper/keeper.go @@ -6,14 +6,6 @@ import ( "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" - "github.com/cometbft/cometbft/libs/log" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/store/prefix" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/cosmos/gogoproto/proto" - "github.com/bnb-chain/greenfield/internal/sequence" gnfdtypes "github.com/bnb-chain/greenfield/types" types2 "github.com/bnb-chain/greenfield/types" @@ -26,6 +18,13 @@ import ( sptypes "github.com/bnb-chain/greenfield/x/sp/types" "github.com/bnb-chain/greenfield/x/storage/types" virtualgroupmoduletypes "github.com/bnb-chain/greenfield/x/virtualgroup/types" + "github.com/cometbft/cometbft/libs/log" + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/store/prefix" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + "github.com/cosmos/gogoproto/proto" ) type ( @@ -117,14 +116,22 @@ func (k Keeper) CreateBucket( return sdkmath.ZeroUint(), errors.Wrap(types.ErrNoSuchStorageProvider, "the storage provider is not in service") } - // check primary sp approval - if opts.PrimarySpApproval.ExpiredHeight < uint64(ctx.BlockHeight()) { - return sdkmath.ZeroUint(), errors.Wrapf(types.ErrInvalidApproval, "The approval of sp is expired.") - } - err = k.VerifySPAndSignature(ctx, sp, opts.ApprovalMsgBytes, opts.PrimarySpApproval.Sig, ownerAcc) - if err != nil { - return sdkmath.ZeroUint(), err + if !ctx.IsUpgraded(upgradetypes.Serengeti) { + // check primary sp approval + if opts.PrimarySpApproval.ExpiredHeight < uint64(ctx.BlockHeight()) { + return sdkmath.ZeroUint(), errors.Wrapf(types.ErrInvalidApproval, "The approval of sp is expired.") + } + err = k.VerifySPAndSignature(ctx, sp, opts.ApprovalMsgBytes, opts.PrimarySpApproval.Sig, ownerAcc) + if err != nil { + return sdkmath.ZeroUint(), err + } + } else { + err = k.VerifySP(ctx, sp, ownerAcc) + if err != nil { + return sdkmath.ZeroUint(), err + } } + gvgFamily, err := k.virtualGroupKeeper.GetAndCheckGVGFamilyAvailableForNewBucket(ctx, opts.PrimarySpApproval.GlobalVirtualGroupFamilyId) if err != nil { return sdkmath.ZeroUint(), err @@ -585,14 +592,19 @@ func (k Keeper) CreateObject( creator = operator } - // check approval - if opts.PrimarySpApproval.ExpiredHeight < uint64(ctx.BlockHeight()) { - return sdkmath.ZeroUint(), errors.Wrapf(types.ErrInvalidApproval, "The approval of sp is expired.") - } - - err = k.VerifySPAndSignature(ctx, sp, opts.ApprovalMsgBytes, opts.PrimarySpApproval.Sig, operator) - if err != nil { - return sdkmath.ZeroUint(), err + if !ctx.IsUpgraded(upgradetypes.Serengeti) { + if opts.PrimarySpApproval.ExpiredHeight < uint64(ctx.BlockHeight()) { + return sdkmath.ZeroUint(), errors.Wrapf(types.ErrInvalidApproval, "The approval of sp is expired.") + } + err = k.VerifySPAndSignature(ctx, sp, opts.ApprovalMsgBytes, opts.PrimarySpApproval.Sig, operator) + if err != nil { + return sdkmath.ZeroUint(), err + } + } else { + err = k.VerifySP(ctx, sp, operator) + if err != nil { + return sdkmath.ZeroUint(), err + } } objectKey := types.GetObjectKey(bucketName, objectName) @@ -1618,6 +1630,13 @@ func (k Keeper) VerifySPAndSignature(_ sdk.Context, sp *sptypes.StorageProvider, return nil } +func (k Keeper) VerifySP(_ sdk.Context, sp *sptypes.StorageProvider, operator sdk.AccAddress) error { + if sp.Status != sptypes.STATUS_IN_SERVICE && !k.fromSpMaintenanceAcct(sp, operator) { + return sptypes.ErrStorageProviderNotInService + } + return nil +} + func (k Keeper) GenNextBucketId(ctx sdk.Context) sdkmath.Uint { store := ctx.KVStore(k.storeKey) diff --git a/x/storage/keeper/keeper_object_test.go b/x/storage/keeper/keeper_object_test.go index 013711ef7..ef798f43e 100644 --- a/x/storage/keeper/keeper_object_test.go +++ b/x/storage/keeper/keeper_object_test.go @@ -99,15 +99,19 @@ func (s *TestSuite) TestCreateObject() { }) }) - // case 5: approval expired + // case 5: object exist + s.storageKeeper.StoreObjectInfo(s.ctx, &types.ObjectInfo{ + Id: sdk.NewUint(1), + BucketName: bucketInfo.BucketName, + ObjectName: objectName, + }) s.virtualGroupKeeper.EXPECT().GetGVGFamily(gomock.Any(), gomock.Any()).Return(&types2.GlobalVirtualGroupFamily{ Id: 0, PrimarySpId: 0, GlobalVirtualGroupIds: nil, VirtualPaymentAddress: "", }, true).AnyTimes() - - spAddress, signBytes, sig := sample.RandSignBytes() + spAddress, _, _ := sample.RandSignBytes() s.spKeeper.EXPECT().MustGetStorageProvider(gomock.Any(), gomock.Any()).Return(&types3.StorageProvider{ Id: 0, OperatorAddress: spAddress.String(), @@ -129,53 +133,10 @@ func (s *TestSuite) TestCreateObject() { SourceType: 0, RedundancyType: 0, Checksums: nil, - PrimarySpApproval: &common.Approval{ - ExpiredHeight: uint64(s.ctx.BlockHeight() - 1), - Sig: sig, - }, - ApprovalMsgBytes: signBytes, - }) - - s.Require().ErrorContains(err, "The approval of sp is expired") - - // case 6: invalid approval sig - _, err = s.storageKeeper.CreateObject(s.ctx, operatorAddress, bucketInfo.BucketName, - objectName, 100, types.CreateObjectOptions{ - Visibility: 0, - ContentType: "", - SourceType: 0, - RedundancyType: 0, - Checksums: nil, - PrimarySpApproval: &common.Approval{ - ExpiredHeight: uint64(s.ctx.BlockHeight() + 1), - Sig: []byte("invalid sig"), - }, - ApprovalMsgBytes: signBytes, - }) - s.Require().ErrorContains(err, "verify signature error") - - // case 7: object exist - s.storageKeeper.StoreObjectInfo(s.ctx, &types.ObjectInfo{ - Id: sdk.NewUint(1), - BucketName: bucketInfo.BucketName, - ObjectName: objectName, - }) - _, err = s.storageKeeper.CreateObject(s.ctx, operatorAddress, bucketInfo.BucketName, - objectName, 100, types.CreateObjectOptions{ - Visibility: 0, - ContentType: "", - SourceType: 0, - RedundancyType: 0, - Checksums: nil, - PrimarySpApproval: &common.Approval{ - ExpiredHeight: uint64(s.ctx.BlockHeight() + 1), - Sig: sig, - }, - ApprovalMsgBytes: signBytes, }) s.Require().ErrorContains(err, "Object already exists") - // case 8: valid case + // case 6: valid case s.storageKeeper.DeleteObjectInfo(s.ctx, &types.ObjectInfo{ Id: sdk.NewUint(1), BucketName: bucketInfo.BucketName, @@ -211,9 +172,7 @@ func (s *TestSuite) TestCreateObject() { Checksums: nil, PrimarySpApproval: &common.Approval{ ExpiredHeight: uint64(s.ctx.BlockHeight() + 1), - Sig: sig, }, - ApprovalMsgBytes: signBytes, }) s.Require().NoError(err) diff --git a/x/storage/keeper/payment_test.go b/x/storage/keeper/payment_test.go index 3599114d1..502527081 100644 --- a/x/storage/keeper/payment_test.go +++ b/x/storage/keeper/payment_test.go @@ -12,6 +12,7 @@ import ( moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" @@ -48,8 +49,11 @@ func (s *TestSuite) SetupTest() { testCtx := testutil.DefaultContextWithDB(s.T(), key, storetypes.NewTransientStoreKey("transient_test")) header := testCtx.Ctx.BlockHeader() header.Time = time.Now() + upgradeChecker := func(ctx sdk.Context, name string) bool { + return name == upgradetypes.Serengeti + } testCtx = testutil.TestContext{ - Ctx: sdk.NewContext(testCtx.CMS, header, false, nil, testCtx.Ctx.Logger()), + Ctx: sdk.NewContext(testCtx.CMS, header, false, upgradeChecker, testCtx.Ctx.Logger()), DB: testCtx.DB, CMS: testCtx.CMS, } diff --git a/x/virtualgroup/keeper/grpc_query.go b/x/virtualgroup/keeper/grpc_query.go index fe8c994d9..75b02481a 100644 --- a/x/virtualgroup/keeper/grpc_query.go +++ b/x/virtualgroup/keeper/grpc_query.go @@ -165,3 +165,76 @@ func (k Keeper) GVGStatistics(goCtx context.Context, req *types.QuerySPGVGStatis GvgStats: stats, }, nil } + +func (k Keeper) QuerySpAvailableGlobalVirtualGroupFamilies(goCtx context.Context, req *types.QuerySPAvailableGlobalVirtualGroupFamiliesRequest) (*types.QuerySPAvailableGlobalVirtualGroupFamiliesResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + stats, found := k.GetGVGFamilyStatisticsWithinSP(ctx, req.GetSpId()) + if !found { + return nil, types.ErrGVGFamilyStatisticsNotExist + } + + availableFamilyIds := make([]uint32, 0) + for _, gvgfID := range stats.GlobalVirtualGroupFamilyIds { + gvgFamily, found := k.GetGVGFamily(ctx, gvgfID) + if !found { + return nil, types.ErrGVGFamilyNotExist + } + totalStakingSize, stored, err := k.GetGlobalVirtualFamilyTotalStakingAndStoredSize(ctx, gvgFamily) + if err != nil { + return nil, err + } + if float64(stored) < math.Min(float64(totalStakingSize), float64(k.MaxStoreSizePerFamily(ctx))) && uint32(len(gvgFamily.GlobalVirtualGroupIds)) < k.MaxGlobalVirtualGroupNumPerFamily(ctx) { + availableFamilyIds = append(availableFamilyIds, gvgfID) + } + } + + return &types.QuerySPAvailableGlobalVirtualGroupFamiliesResponse{ + GlobalVirtualGroupFamilyIds: availableFamilyIds, + }, nil +} + +func (k Keeper) QuerySpOptimalGlobalVirtualGroupFamily(goCtx context.Context, req *types.QuerySpOptimalGlobalVirtualGroupFamilyRequest) (*types.QuerySpOptimalGlobalVirtualGroupFamilyResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + stats, found := k.GetGVGFamilyStatisticsWithinSP(ctx, req.GetSpId()) + if !found { + return nil, types.ErrGVGFamilyStatisticsNotExist + } + + var familyID uint32 + var freeStoreSize float64 + var currentFreeStoreSize float64 + switch req.PickVgfStrategy { + case types.Strategy_Maximize_Free_Store_Size: + for _, gvgfID := range stats.GlobalVirtualGroupFamilyIds { + gvgFamily, found := k.GetGVGFamily(ctx, gvgfID) + if !found { + return nil, types.ErrGVGFamilyNotExist + } + totalStakingSize, stored, err := k.GetGlobalVirtualFamilyTotalStakingAndStoredSize(ctx, gvgFamily) + if err != nil { + return nil, err + } + if float64(stored) < math.Min(float64(totalStakingSize), float64(k.MaxStoreSizePerFamily(ctx))) && uint32(len(gvgFamily.GlobalVirtualGroupIds)) < k.MaxGlobalVirtualGroupNumPerFamily(ctx) { + currentFreeStoreSize = math.Min(float64(totalStakingSize), float64(k.MaxStoreSizePerFamily(ctx))) - float64(stored) + if currentFreeStoreSize > freeStoreSize { + familyID = gvgFamily.Id + freeStoreSize = currentFreeStoreSize + } + } + } + default: + return nil, status.Error(codes.InvalidArgument, "invalid pick vgf strategy") + } + + return &types.QuerySpOptimalGlobalVirtualGroupFamilyResponse{ + GlobalVirtualGroupFamilyId: familyID, + }, nil +} diff --git a/x/virtualgroup/keeper/keeper.go b/x/virtualgroup/keeper/keeper.go index a3c9d6dfc..7c26ff757 100644 --- a/x/virtualgroup/keeper/keeper.go +++ b/x/virtualgroup/keeper/keeper.go @@ -6,16 +6,16 @@ import ( math2 "math" "cosmossdk.io/math" + "github.com/bnb-chain/greenfield/internal/sequence" + sptypes "github.com/bnb-chain/greenfield/x/sp/types" + "github.com/bnb-chain/greenfield/x/virtualgroup/types" "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/store/prefix" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - - "github.com/bnb-chain/greenfield/internal/sequence" - sptypes "github.com/bnb-chain/greenfield/x/sp/types" - "github.com/bnb-chain/greenfield/x/virtualgroup/types" ) type ( @@ -251,6 +251,11 @@ func (k Keeper) GetOrCreateEmptyGVGFamily(ctx sdk.Context, familyID uint32, prim PrimarySpId: primarySPID, VirtualPaymentAddress: k.DeriveVirtualPaymentAccount(types.GVGFamilyName, id).String(), } + if ctx.IsUpgraded(upgradetypes.Serengeti) { + gvgFamilyStatistics := k.GetOrCreateGVGFamilyStatisticsWithinSP(ctx, primarySPID) + gvgFamilyStatistics.GlobalVirtualGroupFamilyIds = append(gvgFamilyStatistics.GlobalVirtualGroupFamilyIds, id) + k.SetGVGFamilyStatisticsWithinSP(ctx, gvgFamilyStatistics) + } return &gvgFamily, nil } else { bz := store.Get(types.GetGVGFamilyKey(familyID)) @@ -289,6 +294,12 @@ func (k Keeper) SwapAsPrimarySP(ctx sdk.Context, primarySP, successorSP *sptypes srcStat := k.MustGetGVGStatisticsWithinSP(ctx, primarySP.Id) dstStat := k.GetOrCreateGVGStatisticsWithinSP(ctx, successorSP.Id) + var srcVGFStat *types.GVGFamilyStatisticsWithinSP + var dstVGFStat *types.GVGFamilyStatisticsWithinSP + if ctx.IsUpgraded(upgradetypes.Serengeti) { + srcVGFStat = k.MustGetGVGFamilyStatisticsWithinSP(ctx, primarySP.Id) + dstVGFStat = k.GetOrCreateGVGFamilyStatisticsWithinSP(ctx, successorSP.Id) + } var gvgs []*types.GlobalVirtualGroup for _, gvgID := range family.GlobalVirtualGroupIds { @@ -358,6 +369,11 @@ func (k Keeper) SwapAsPrimarySP(ctx sdk.Context, primarySP, successorSP *sptypes } k.SetGVGStatisticsWithSP(ctx, srcStat) k.SetGVGStatisticsWithSP(ctx, dstStat) + if ctx.IsUpgraded(upgradetypes.Serengeti) { + k.DeleteSpecificGVGFamilyStatisticsFromSP(ctx, srcVGFStat.SpId, family.Id) + dstVGFStat.GlobalVirtualGroupFamilyIds = append(dstVGFStat.GlobalVirtualGroupFamilyIds, family.Id) + k.SetGVGFamilyStatisticsWithinSP(ctx, dstVGFStat) + } return nil } @@ -481,6 +497,81 @@ func (k Keeper) StorageProviderExitable(ctx sdk.Context, spID uint32) error { return nil } +func (k Keeper) GetOrCreateGVGFamilyStatisticsWithinSP(ctx sdk.Context, spID uint32) *types.GVGFamilyStatisticsWithinSP { + store := ctx.KVStore(k.storeKey) + + ret := &types.GVGFamilyStatisticsWithinSP{ + SpId: spID, + } + bz := store.Get(types.GetGVGFamilyStatisticsWithinSPKey(spID)) + if bz == nil { + return ret + } + + k.cdc.MustUnmarshal(bz, ret) + return ret +} + +func (k Keeper) DeleteSpecificGVGFamilyStatisticsFromSP(ctx sdk.Context, spID uint32, familyID uint32) { + gvgFamilyStatistics := k.MustGetGVGFamilyStatisticsWithinSP(ctx, spID) + for i, id := range gvgFamilyStatistics.GlobalVirtualGroupFamilyIds { + if id == familyID { + gvgFamilyStatistics.GlobalVirtualGroupFamilyIds = append(gvgFamilyStatistics.GlobalVirtualGroupFamilyIds[:i], gvgFamilyStatistics.GlobalVirtualGroupFamilyIds[i+1:]...) + k.SetGVGFamilyStatisticsWithinSP(ctx, gvgFamilyStatistics) + break + } + } +} + +func (k Keeper) GetGVGFamilyStatisticsWithinSP(ctx sdk.Context, spID uint32) (*types.GVGFamilyStatisticsWithinSP, bool) { + store := ctx.KVStore(k.storeKey) + + bz := store.Get(types.GetGVGFamilyStatisticsWithinSPKey(spID)) + if bz == nil { + return nil, false + } + + var ret types.GVGFamilyStatisticsWithinSP + k.cdc.MustUnmarshal(bz, &ret) + return &ret, true +} + +func (k Keeper) MustGetGVGFamilyStatisticsWithinSP(ctx sdk.Context, spID uint32) *types.GVGFamilyStatisticsWithinSP { + store := ctx.KVStore(k.storeKey) + + bz := store.Get(types.GetGVGFamilyStatisticsWithinSPKey(spID)) + if bz == nil { + panic("must get vgf within sp") + } + + var ret types.GVGFamilyStatisticsWithinSP + k.cdc.MustUnmarshal(bz, &ret) + return &ret +} + +func (k Keeper) SetGVGFamilyStatisticsWithinSP(ctx sdk.Context, vgfStatisticsWithinSP *types.GVGFamilyStatisticsWithinSP) { + store := ctx.KVStore(k.storeKey) + + bz := k.cdc.MustMarshal(vgfStatisticsWithinSP) + + store.Set(types.GetGVGFamilyStatisticsWithinSPKey(vgfStatisticsWithinSP.SpId), bz) +} + +func (k Keeper) MigrateGlobalVirtualGroupFamiliesForSP(ctx sdk.Context) { + store := ctx.KVStore(k.storeKey) + gvgFamilyStore := prefix.NewStore(store, types.GVGFamilyKey) + + iterator := gvgFamilyStore.Iterator(nil, nil) + defer iterator.Close() + for ; iterator.Valid(); iterator.Next() { + var gvgFamily types.GlobalVirtualGroupFamily + k.cdc.MustUnmarshal(iterator.Value(), &gvgFamily) + gvgFamilyStatistics := k.GetOrCreateGVGFamilyStatisticsWithinSP(ctx, gvgFamily.PrimarySpId) + gvgFamilyStatistics.GlobalVirtualGroupFamilyIds = append(gvgFamilyStatistics.GlobalVirtualGroupFamilyIds, gvgFamily.Id) + k.SetGVGFamilyStatisticsWithinSP(ctx, gvgFamilyStatistics) + } +} + // GetStoreSizeOfFamily Rather than calculating the stored size of a Global Virtual Group Family (GVGF) in real-time, // it is preferable to calculate it once during the creation of a Global Virtual Group (GVG). This approach is favored // because GVG creation is infrequent and occurs with low frequency. diff --git a/x/virtualgroup/types/common.pb.go b/x/virtualgroup/types/common.pb.go new file mode 100644 index 000000000..0940dc794 --- /dev/null +++ b/x/virtualgroup/types/common.pb.go @@ -0,0 +1,70 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: greenfield/virtualgroup/common.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// PickVGFStrategy represents the method for selecting the best global virtual group family based on the strategy +type PickVGFStrategy int32 + +const ( + Strategy_Maximize_Free_Store_Size PickVGFStrategy = 0 +) + +var PickVGFStrategy_name = map[int32]string{ + 0: "Strategy_Maximize_Free_Store_Size", +} + +var PickVGFStrategy_value = map[string]int32{ + "Strategy_Maximize_Free_Store_Size": 0, +} + +func (x PickVGFStrategy) String() string { + return proto.EnumName(PickVGFStrategy_name, int32(x)) +} + +func (PickVGFStrategy) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_95d96763aeb17687, []int{0} +} + +func init() { + proto.RegisterEnum("greenfield.virtualgroup.PickVGFStrategy", PickVGFStrategy_name, PickVGFStrategy_value) +} + +func init() { + proto.RegisterFile("greenfield/virtualgroup/common.proto", fileDescriptor_95d96763aeb17687) +} + +var fileDescriptor_95d96763aeb17687 = []byte{ + // 206 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x49, 0x2f, 0x4a, 0x4d, + 0xcd, 0x4b, 0xcb, 0x4c, 0xcd, 0x49, 0xd1, 0x2f, 0xcb, 0x2c, 0x2a, 0x29, 0x4d, 0xcc, 0x49, 0x2f, + 0xca, 0x2f, 0x2d, 0xd0, 0x4f, 0xce, 0xcf, 0xcd, 0xcd, 0xcf, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, + 0x17, 0x12, 0x47, 0xa8, 0xd2, 0x43, 0x56, 0x25, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x56, 0xa3, + 0x0f, 0x62, 0x41, 0x94, 0x6b, 0xd9, 0x71, 0xf1, 0x07, 0x64, 0x26, 0x67, 0x87, 0xb9, 0xbb, 0x05, + 0x97, 0x14, 0x25, 0x96, 0xa4, 0xa6, 0x57, 0x0a, 0xa9, 0x72, 0x29, 0xc2, 0xd8, 0xf1, 0xbe, 0x89, + 0x15, 0x99, 0xb9, 0x99, 0x55, 0xa9, 0xf1, 0x6e, 0x45, 0xa9, 0xa9, 0xf1, 0xc1, 0x25, 0xf9, 0x45, + 0xa9, 0xf1, 0xc1, 0x99, 0x55, 0xa9, 0x02, 0x0c, 0x52, 0x2c, 0x1d, 0x8b, 0xe5, 0x18, 0x9c, 0xfc, + 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, + 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0xca, 0x24, 0x3d, 0xb3, 0x24, 0xa3, + 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x3f, 0x29, 0x2f, 0x49, 0x37, 0x39, 0x23, 0x31, 0x33, 0x4f, + 0x1f, 0xc9, 0x0f, 0x15, 0xa8, 0xbe, 0x28, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0x3b, 0xcb, + 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xe8, 0xdf, 0xb8, 0xf0, 0xed, 0x00, 0x00, 0x00, +} diff --git a/x/virtualgroup/types/errors.go b/x/virtualgroup/types/errors.go index 15e8c84d5..fea2d6ed7 100644 --- a/x/virtualgroup/types/errors.go +++ b/x/virtualgroup/types/errors.go @@ -6,26 +6,27 @@ import ( // x/virtualgroup module sentinel errors var ( - ErrGVGFamilyNotExist = errors.Register(ModuleName, 1100, "global virtual group family not exist.") - ErrGVGNotExistInFamily = errors.Register(ModuleName, 1101, "global virtual group not exist in family.") - ErrGVGNotExist = errors.Register(ModuleName, 1102, "global virtual group not exist.") - ErrGVGNotEmpty = errors.Register(ModuleName, 1103, "the store size of gvg is not zero") - ErrGenSequenceIDError = errors.Register(ModuleName, 1104, "generate sequence id error.") - ErrWithdrawAmountTooLarge = errors.Register(ModuleName, 1105, "withdrawal amount is too large.") - ErrSwapOutFailed = errors.Register(ModuleName, 1106, "swap out failed.") - ErrLVGNotExist = errors.Register(ModuleName, 1107, "local virtual group not exist.") - ErrSPCanNotExit = errors.Register(ModuleName, 1108, "the sp can not exit now.") - ErrSettleFailed = errors.Register(ModuleName, 1109, "fail to settle.") - ErrInvalidGVGCount = errors.Register(ModuleName, 1120, "the count of global virtual group ids is invalid.") - ErrWithdrawFailed = errors.Register(ModuleName, 1121, "with draw failed.") - ErrInvalidSecondarySPCount = errors.Register(ModuleName, 1122, "the number of secondary sp within the global virtual group is invalid.") - ErrLimitationExceed = errors.Register(ModuleName, 1123, "limitation exceed.") - ErrDuplicateSecondarySP = errors.Register(ModuleName, 1124, "the global virtual group has duplicate secondary sp.") - ErrInsufficientStaking = errors.Register(ModuleName, 1125, "insufficient staking for gvg") - ErrDuplicateGVG = errors.Register(ModuleName, 1126, "global virtual group is duplicate") - ErrSwapInFailed = errors.Register(ModuleName, 1127, "swap in failed.") - ErrSwapInInfoNotExist = errors.Register(ModuleName, 1128, "swap in info not exist.") - ErrGVGStatisticsNotExist = errors.Register(ModuleName, 1129, "gvg statistics not exist.") + ErrGVGFamilyNotExist = errors.Register(ModuleName, 1100, "global virtual group family not exist.") + ErrGVGNotExistInFamily = errors.Register(ModuleName, 1101, "global virtual group not exist in family.") + ErrGVGNotExist = errors.Register(ModuleName, 1102, "global virtual group not exist.") + ErrGVGNotEmpty = errors.Register(ModuleName, 1103, "the store size of gvg is not zero") + ErrGenSequenceIDError = errors.Register(ModuleName, 1104, "generate sequence id error.") + ErrWithdrawAmountTooLarge = errors.Register(ModuleName, 1105, "withdrawal amount is too large.") + ErrSwapOutFailed = errors.Register(ModuleName, 1106, "swap out failed.") + ErrLVGNotExist = errors.Register(ModuleName, 1107, "local virtual group not exist.") + ErrSPCanNotExit = errors.Register(ModuleName, 1108, "the sp can not exit now.") + ErrSettleFailed = errors.Register(ModuleName, 1109, "fail to settle.") + ErrInvalidGVGCount = errors.Register(ModuleName, 1120, "the count of global virtual group ids is invalid.") + ErrWithdrawFailed = errors.Register(ModuleName, 1121, "with draw failed.") + ErrInvalidSecondarySPCount = errors.Register(ModuleName, 1122, "the number of secondary sp within the global virtual group is invalid.") + ErrLimitationExceed = errors.Register(ModuleName, 1123, "limitation exceed.") + ErrDuplicateSecondarySP = errors.Register(ModuleName, 1124, "the global virtual group has duplicate secondary sp.") + ErrInsufficientStaking = errors.Register(ModuleName, 1125, "insufficient staking for gvg") + ErrDuplicateGVG = errors.Register(ModuleName, 1126, "global virtual group is duplicate") + ErrSwapInFailed = errors.Register(ModuleName, 1127, "swap in failed.") + ErrSwapInInfoNotExist = errors.Register(ModuleName, 1128, "swap in info not exist.") + ErrGVGStatisticsNotExist = errors.Register(ModuleName, 1129, "global virtual group statistics not exist.") + ErrGVGFamilyStatisticsNotExist = errors.Register(ModuleName, 1130, "global virtual group family statistics not exist.") ErrInvalidDenom = errors.Register(ModuleName, 2000, "Invalid denom.") ) diff --git a/x/virtualgroup/types/keys.go b/x/virtualgroup/types/keys.go index 55ddf5a94..ac9388ace 100644 --- a/x/virtualgroup/types/keys.go +++ b/x/virtualgroup/types/keys.go @@ -41,7 +41,8 @@ var ( GVGSequencePrefix = []byte{0x32} GVGFamilySequencePrefix = []byte{0x33} - GVGStatisticsWithinSPKey = []byte{0x41} + GVGStatisticsWithinSPKey = []byte{0x41} + GVGFamilyStatisticsWithinSPKey = []byte{0x42} SwapOutFamilyKey = []byte{0x51} SwapOutGVGKey = []byte{0x61} @@ -60,6 +61,11 @@ func GetGVGFamilyKey(familyID uint32) []byte { return append(GVGFamilyKey, uint32Seq.EncodeSequence(familyID)...) } +func GetGVGFamilyStatisticsWithinSPKey(spID uint32) []byte { + var uint32Seq sequence.Sequence[uint32] + return append(GVGFamilyStatisticsWithinSPKey, uint32Seq.EncodeSequence(spID)...) +} + func GetGVGStatisticsWithinSPKey(spID uint32) []byte { var uint32Seq sequence.Sequence[uint32] return append(GVGStatisticsWithinSPKey, uint32Seq.EncodeSequence(spID)...) diff --git a/x/virtualgroup/types/query.pb.go b/x/virtualgroup/types/query.pb.go index 35d098dcc..bedb36f30 100644 --- a/x/virtualgroup/types/query.pb.go +++ b/x/virtualgroup/types/query.pb.go @@ -763,6 +763,206 @@ func (m *QuerySPGVGStatisticsResponse) GetGvgStats() *GVGStatisticsWithinSP { return nil } +type QuerySPAvailableGlobalVirtualGroupFamiliesRequest struct { + SpId uint32 `protobuf:"varint,1,opt,name=sp_id,json=spId,proto3" json:"sp_id,omitempty"` +} + +func (m *QuerySPAvailableGlobalVirtualGroupFamiliesRequest) Reset() { + *m = QuerySPAvailableGlobalVirtualGroupFamiliesRequest{} +} +func (m *QuerySPAvailableGlobalVirtualGroupFamiliesRequest) String() string { + return proto.CompactTextString(m) +} +func (*QuerySPAvailableGlobalVirtualGroupFamiliesRequest) ProtoMessage() {} +func (*QuerySPAvailableGlobalVirtualGroupFamiliesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_83cd53fc415e00e7, []int{16} +} +func (m *QuerySPAvailableGlobalVirtualGroupFamiliesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySPAvailableGlobalVirtualGroupFamiliesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySPAvailableGlobalVirtualGroupFamiliesRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QuerySPAvailableGlobalVirtualGroupFamiliesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySPAvailableGlobalVirtualGroupFamiliesRequest.Merge(m, src) +} +func (m *QuerySPAvailableGlobalVirtualGroupFamiliesRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySPAvailableGlobalVirtualGroupFamiliesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySPAvailableGlobalVirtualGroupFamiliesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySPAvailableGlobalVirtualGroupFamiliesRequest proto.InternalMessageInfo + +func (m *QuerySPAvailableGlobalVirtualGroupFamiliesRequest) GetSpId() uint32 { + if m != nil { + return m.SpId + } + return 0 +} + +type QuerySPAvailableGlobalVirtualGroupFamiliesResponse struct { + GlobalVirtualGroupFamilyIds []uint32 `protobuf:"varint,1,rep,packed,name=global_virtual_group_family_ids,json=globalVirtualGroupFamilyIds,proto3" json:"global_virtual_group_family_ids,omitempty"` +} + +func (m *QuerySPAvailableGlobalVirtualGroupFamiliesResponse) Reset() { + *m = QuerySPAvailableGlobalVirtualGroupFamiliesResponse{} +} +func (m *QuerySPAvailableGlobalVirtualGroupFamiliesResponse) String() string { + return proto.CompactTextString(m) +} +func (*QuerySPAvailableGlobalVirtualGroupFamiliesResponse) ProtoMessage() {} +func (*QuerySPAvailableGlobalVirtualGroupFamiliesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_83cd53fc415e00e7, []int{17} +} +func (m *QuerySPAvailableGlobalVirtualGroupFamiliesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySPAvailableGlobalVirtualGroupFamiliesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySPAvailableGlobalVirtualGroupFamiliesResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QuerySPAvailableGlobalVirtualGroupFamiliesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySPAvailableGlobalVirtualGroupFamiliesResponse.Merge(m, src) +} +func (m *QuerySPAvailableGlobalVirtualGroupFamiliesResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySPAvailableGlobalVirtualGroupFamiliesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySPAvailableGlobalVirtualGroupFamiliesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySPAvailableGlobalVirtualGroupFamiliesResponse proto.InternalMessageInfo + +func (m *QuerySPAvailableGlobalVirtualGroupFamiliesResponse) GetGlobalVirtualGroupFamilyIds() []uint32 { + if m != nil { + return m.GlobalVirtualGroupFamilyIds + } + return nil +} + +type QuerySpOptimalGlobalVirtualGroupFamilyRequest struct { + SpId uint32 `protobuf:"varint,1,opt,name=sp_id,json=spId,proto3" json:"sp_id,omitempty"` + PickVgfStrategy PickVGFStrategy `protobuf:"varint,2,opt,name=pick_vgf_strategy,json=pickVgfStrategy,proto3,enum=greenfield.virtualgroup.PickVGFStrategy" json:"pick_vgf_strategy,omitempty"` +} + +func (m *QuerySpOptimalGlobalVirtualGroupFamilyRequest) Reset() { + *m = QuerySpOptimalGlobalVirtualGroupFamilyRequest{} +} +func (m *QuerySpOptimalGlobalVirtualGroupFamilyRequest) String() string { + return proto.CompactTextString(m) +} +func (*QuerySpOptimalGlobalVirtualGroupFamilyRequest) ProtoMessage() {} +func (*QuerySpOptimalGlobalVirtualGroupFamilyRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_83cd53fc415e00e7, []int{18} +} +func (m *QuerySpOptimalGlobalVirtualGroupFamilyRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySpOptimalGlobalVirtualGroupFamilyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySpOptimalGlobalVirtualGroupFamilyRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QuerySpOptimalGlobalVirtualGroupFamilyRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySpOptimalGlobalVirtualGroupFamilyRequest.Merge(m, src) +} +func (m *QuerySpOptimalGlobalVirtualGroupFamilyRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySpOptimalGlobalVirtualGroupFamilyRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySpOptimalGlobalVirtualGroupFamilyRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySpOptimalGlobalVirtualGroupFamilyRequest proto.InternalMessageInfo + +func (m *QuerySpOptimalGlobalVirtualGroupFamilyRequest) GetSpId() uint32 { + if m != nil { + return m.SpId + } + return 0 +} + +func (m *QuerySpOptimalGlobalVirtualGroupFamilyRequest) GetPickVgfStrategy() PickVGFStrategy { + if m != nil { + return m.PickVgfStrategy + } + return Strategy_Maximize_Free_Store_Size +} + +type QuerySpOptimalGlobalVirtualGroupFamilyResponse struct { + GlobalVirtualGroupFamilyId uint32 `protobuf:"varint,1,opt,name=global_virtual_group_family_id,json=globalVirtualGroupFamilyId,proto3" json:"global_virtual_group_family_id,omitempty"` +} + +func (m *QuerySpOptimalGlobalVirtualGroupFamilyResponse) Reset() { + *m = QuerySpOptimalGlobalVirtualGroupFamilyResponse{} +} +func (m *QuerySpOptimalGlobalVirtualGroupFamilyResponse) String() string { + return proto.CompactTextString(m) +} +func (*QuerySpOptimalGlobalVirtualGroupFamilyResponse) ProtoMessage() {} +func (*QuerySpOptimalGlobalVirtualGroupFamilyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_83cd53fc415e00e7, []int{19} +} +func (m *QuerySpOptimalGlobalVirtualGroupFamilyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySpOptimalGlobalVirtualGroupFamilyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySpOptimalGlobalVirtualGroupFamilyResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QuerySpOptimalGlobalVirtualGroupFamilyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySpOptimalGlobalVirtualGroupFamilyResponse.Merge(m, src) +} +func (m *QuerySpOptimalGlobalVirtualGroupFamilyResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySpOptimalGlobalVirtualGroupFamilyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySpOptimalGlobalVirtualGroupFamilyResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySpOptimalGlobalVirtualGroupFamilyResponse proto.InternalMessageInfo + +func (m *QuerySpOptimalGlobalVirtualGroupFamilyResponse) GetGlobalVirtualGroupFamilyId() uint32 { + if m != nil { + return m.GlobalVirtualGroupFamilyId + } + return 0 +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "greenfield.virtualgroup.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "greenfield.virtualgroup.QueryParamsResponse") @@ -780,6 +980,10 @@ func init() { proto.RegisterType((*QuerySwapInInfoResponse)(nil), "greenfield.virtualgroup.QuerySwapInInfoResponse") proto.RegisterType((*QuerySPGVGStatisticsRequest)(nil), "greenfield.virtualgroup.QuerySPGVGStatisticsRequest") proto.RegisterType((*QuerySPGVGStatisticsResponse)(nil), "greenfield.virtualgroup.QuerySPGVGStatisticsResponse") + proto.RegisterType((*QuerySPAvailableGlobalVirtualGroupFamiliesRequest)(nil), "greenfield.virtualgroup.QuerySPAvailableGlobalVirtualGroupFamiliesRequest") + proto.RegisterType((*QuerySPAvailableGlobalVirtualGroupFamiliesResponse)(nil), "greenfield.virtualgroup.QuerySPAvailableGlobalVirtualGroupFamiliesResponse") + proto.RegisterType((*QuerySpOptimalGlobalVirtualGroupFamilyRequest)(nil), "greenfield.virtualgroup.QuerySpOptimalGlobalVirtualGroupFamilyRequest") + proto.RegisterType((*QuerySpOptimalGlobalVirtualGroupFamilyResponse)(nil), "greenfield.virtualgroup.QuerySpOptimalGlobalVirtualGroupFamilyResponse") } func init() { @@ -787,67 +991,77 @@ func init() { } var fileDescriptor_83cd53fc415e00e7 = []byte{ - // 954 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x97, 0xcf, 0x6f, 0xdc, 0x44, - 0x14, 0xc7, 0x33, 0xa1, 0x8d, 0xda, 0xd7, 0xe4, 0x32, 0x09, 0x24, 0x72, 0xa2, 0x5d, 0x70, 0xda, - 0xa6, 0xa4, 0x8d, 0x4d, 0x42, 0x52, 0x2a, 0xd4, 0x96, 0x76, 0x1b, 0xba, 0x44, 0x48, 0x28, 0x6c, - 0xaa, 0x56, 0x42, 0x42, 0x66, 0x9c, 0x78, 0x27, 0x23, 0x36, 0x1e, 0x77, 0xc7, 0xbb, 0x65, 0x6f, - 0x88, 0x73, 0x0f, 0x48, 0x3d, 0x71, 0xe1, 0x6f, 0xe0, 0x2f, 0xe0, 0x9c, 0x63, 0x24, 0x0e, 0x70, - 0x02, 0x94, 0x70, 0xe1, 0x5f, 0xe0, 0x84, 0x3c, 0x33, 0xee, 0xee, 0xd6, 0x3b, 0xde, 0xf5, 0xb6, - 0x37, 0xcb, 0x7e, 0xef, 0xfb, 0xbe, 0x9f, 0xf9, 0xf1, 0x9e, 0x0c, 0xcb, 0xb4, 0x19, 0x04, 0x61, - 0x9d, 0x05, 0x8d, 0x03, 0xb7, 0xcd, 0x9a, 0x71, 0x8b, 0x34, 0x68, 0x93, 0xb7, 0x22, 0xf7, 0x69, - 0x2b, 0x68, 0x76, 0x9c, 0xa8, 0xc9, 0x63, 0x8e, 0xe7, 0xbb, 0x41, 0x4e, 0x6f, 0x90, 0xb5, 0xba, - 0xcf, 0xc5, 0x11, 0x17, 0xae, 0x4f, 0x44, 0xa0, 0x32, 0xdc, 0xf6, 0xba, 0x1f, 0xc4, 0x64, 0xdd, - 0x8d, 0x08, 0x65, 0x21, 0x89, 0x19, 0x0f, 0x95, 0x88, 0x35, 0x47, 0x39, 0xe5, 0xf2, 0xd1, 0x4d, - 0x9e, 0xf4, 0xdb, 0x25, 0xca, 0x39, 0x6d, 0x04, 0x2e, 0x89, 0x98, 0x4b, 0xc2, 0x90, 0xc7, 0x32, - 0x45, 0xe8, 0xaf, 0x97, 0x4d, 0xee, 0x22, 0xd2, 0x24, 0x47, 0x69, 0x94, 0x91, 0x21, 0xee, 0x44, - 0x81, 0x0e, 0xb2, 0xe7, 0x00, 0x7f, 0x99, 0x18, 0xdc, 0x95, 0x99, 0xb5, 0xe0, 0x69, 0x2b, 0x10, - 0xb1, 0xfd, 0x08, 0x66, 0xfb, 0xde, 0x8a, 0x88, 0x87, 0x22, 0xc0, 0x77, 0x60, 0x4a, 0x55, 0x58, - 0x40, 0xef, 0xa2, 0x6b, 0x97, 0x36, 0xca, 0x8e, 0x61, 0x05, 0x1c, 0x95, 0x58, 0x39, 0x77, 0xfc, - 0x67, 0x79, 0xa2, 0xa6, 0x93, 0xec, 0x27, 0x50, 0x92, 0xaa, 0xd5, 0x06, 0xf7, 0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x7b, 0x46, 0x64, 0x92, 0xaa, 0x79, 0xf9, 0xf0, 0x3f, 0x23, 0x80, 0x6e, 0xeb, 0xc6, 0x6e, - 0xfe, 0x6e, 0x64, 0x86, 0x97, 0xf5, 0xc1, 0xe8, 0x09, 0xda, 0xfb, 0x9a, 0xf4, 0xbe, 0x82, 0xaf, - 0x18, 0xbd, 0xf7, 0xce, 0x1d, 0xfc, 0x0b, 0x82, 0x99, 0xbe, 0x1e, 0x8e, 0x37, 0x87, 0x94, 0x1c, - 0x38, 0x69, 0xac, 0xad, 0x82, 0x59, 0xda, 0xed, 0x86, 0x74, 0x7b, 0x03, 0xaf, 0x9a, 0xdd, 0x46, - 0x5e, 0x3a, 0x8d, 0x54, 0x6e, 0xe5, 0x8b, 0xe3, 0xd3, 0x12, 0x3a, 0x39, 0x2d, 0xa1, 0xbf, 0x4f, - 0x4b, 0xe8, 0xc7, 0xb3, 0xd2, 0xc4, 0xc9, 0x59, 0x69, 0xe2, 0x8f, 0xb3, 0xd2, 0xc4, 0x57, 0x9b, - 0x94, 0xc5, 0x87, 0x2d, 0xdf, 0xd9, 0xe7, 0x47, 0xae, 0x1f, 0xfa, 0x6b, 0xfb, 0x87, 0x84, 0x85, - 0xbd, 0xca, 0xdf, 0x0d, 0xf8, 0x1f, 0xf3, 0xa7, 0xe4, 0x0f, 0xd9, 0x87, 0xff, 0x07, 0x00, 0x00, - 0xff, 0xff, 0x90, 0x43, 0xb6, 0xb4, 0x7b, 0x0e, 0x00, 0x00, + // 1120 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x98, 0x4f, 0x73, 0xdb, 0xc4, + 0x1b, 0xc7, 0xb3, 0xf9, 0xb5, 0x99, 0xf6, 0x69, 0xf3, 0x03, 0x36, 0x81, 0x64, 0x94, 0x8c, 0x0d, + 0x4a, 0xdb, 0x84, 0xb4, 0x91, 0x88, 0x49, 0x4a, 0x87, 0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xbd, 0x8f, 0x8a, 0xe0, 0x71, 0x60, 0x26, 0xa6, + 0x82, 0x62, 0x4f, 0x97, 0x53, 0x50, 0x09, 0xfd, 0x69, 0x59, 0xc5, 0x55, 0x07, 0x6e, 0xc4, 0x59, + 0x63, 0x66, 0xf8, 0xed, 0xe0, 0x4d, 0x80, 0xf6, 0x28, 0x10, 0x56, 0x6e, 0x68, 0xc1, 0xdc, 0xd0, + 0xfc, 0xb9, 0xa1, 0x05, 0x93, 0x46, 0xcc, 0x0d, 0x6d, 0x87, 0x50, 0x53, 0xc4, 0x16, 0x3b, 0x22, + 0xd5, 0x63, 0x04, 0xf3, 0x7d, 0x53, 0x8a, 0x7a, 0xec, 0xc1, 0x55, 0xda, 0xa4, 0x01, 0x3e, 0x33, + 0xc3, 0x6d, 0x1d, 0xa0, 0x00, 0x57, 0x68, 0x93, 0x86, 0xea, 0xb8, 0xd0, 0x45, 0x32, 0xca, 0x49, + 0xe6, 0xfb, 0x92, 0x04, 0x96, 0xba, 0x50, 0xea, 0xb0, 0xb8, 0xd6, 0x24, 0xac, 0x4a, 0x4a, 0x55, + 0xb3, 0x7f, 0x01, 0x37, 0x20, 0x1b, 0xff, 0x79, 0x04, 0x7c, 0xe3, 0xc5, 0x19, 0xf9, 0xf7, 0xe1, + 0xaa, 0x2e, 0xdc, 0x4c, 0x94, 0x53, 0x54, 0x70, 0x38, 0x49, 0x5f, 0x22, 0x78, 0x8b, 0xef, 0xd9, + 0xee, 0x33, 0xe2, 0x6c, 0x59, 0x5b, 0x56, 0xc5, 0x1e, 0xe2, 0x47, 0x1f, 0x37, 0x1e, 0x47, 0x63, + 0xc6, 0xe3, 0x17, 0x30, 0xd5, 0x63, 0x4a, 0x60, 0x3f, 0x82, 0xab, 0xee, 0x33, 0xe2, 0x18, 0xcc, + 0x32, 0x98, 0x55, 0xb1, 0x45, 0xbb, 0xce, 0x49, 0x1b, 0xa7, 0x43, 0x02, 0xdc, 0xb3, 0x67, 0x35, + 0x07, 0x33,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, 0x30, 0xde, 0x75, 0x38, + 0xe3, 0x95, 0x3e, 0x29, 0x23, 0xaf, 0x10, 0xca, 0x6a, 0xca, 0x28, 0xe1, 0x36, 0xc7, 0xdd, 0xde, + 0xc2, 0x8b, 0x72, 0xb7, 0x8e, 0x11, 0x5e, 0x33, 0x84, 0xc1, 0x6f, 0x47, 0x61, 0x51, 0x9c, 0x64, + 0x49, 0xfa, 0xea, 0xa3, 0x7e, 0xce, 0x52, 0xb4, 0xd7, 0xf6, 0x50, 0xb4, 0x04, 0xfb, 0x36, 0x67, + 0x7f, 0x84, 0xd7, 0xe3, 0xd8, 0x93, 0x36, 0xda, 0xf3, 0x51, 0xf1, 0x0f, 0x50, 0xdf, 0xe3, 0x1d, + 0x6f, 0xf6, 0x81, 0x48, 0x78, 0x77, 0x51, 0x0a, 0xe7, 0xd6, 0x11, 0x85, 0x28, 0xf0, 0x42, 0xac, + 0xe1, 0x07, 0x71, 0x85, 0xb0, 0x03, 0xb1, 0x98, 0x32, 0xb4, 0xf2, 0x1f, 0x1f, 0x9f, 0x64, 0xd0, + 0xab, 0x93, 0x0c, 0xfa, 0xe3, 0x24, 0x83, 0xbe, 0x39, 0xcd, 0x8c, 0xbc, 0x3a, 0xcd, 0x8c, 0xfc, + 0x7a, 0x9a, 0x19, 0xf9, 0x6c, 0x85, 0x32, 0xef, 0xb0, 0x51, 0xd2, 0xca, 0x76, 0x4d, 0x2f, 0x59, + 0xa5, 0xa5, 0xf2, 0x21, 0x61, 0x56, 0x67, 0xba, 0x2f, 0x23, 0x7e, 0x82, 0x29, 0x8d, 0xf1, 0xdf, + 0x60, 0xde, 0xff, 0x37, 0x00, 0x00, 0xff, 0xff, 0x6a, 0x1e, 0x4e, 0x52, 0x94, 0x12, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -878,6 +1092,10 @@ type QueryClient interface { SwapInInfo(ctx context.Context, in *QuerySwapInInfoRequest, opts ...grpc.CallOption) (*QuerySwapInInfoResponse, error) // GVGStatistics gets gvg statistics for a SP GVGStatistics(ctx context.Context, in *QuerySPGVGStatisticsRequest, opts ...grpc.CallOption) (*QuerySPGVGStatisticsResponse, error) + // QuerySpAvailableGlobalVirtualGroupFamilies filters a list of GlobalVirtualGroupFamilies IDs under a certain SP that are qualified to create a bucket on + QuerySpAvailableGlobalVirtualGroupFamilies(ctx context.Context, in *QuerySPAvailableGlobalVirtualGroupFamiliesRequest, opts ...grpc.CallOption) (*QuerySPAvailableGlobalVirtualGroupFamiliesResponse, error) + // QuerySpOptimalGlobalVirtualGroupFamily filters the optimal GlobalVirtualGroupFamily under a certain SP that is qualified to create a bucket on + QuerySpOptimalGlobalVirtualGroupFamily(ctx context.Context, in *QuerySpOptimalGlobalVirtualGroupFamilyRequest, opts ...grpc.CallOption) (*QuerySpOptimalGlobalVirtualGroupFamilyResponse, error) } type queryClient struct { @@ -960,6 +1178,24 @@ func (c *queryClient) GVGStatistics(ctx context.Context, in *QuerySPGVGStatistic return out, nil } +func (c *queryClient) QuerySpAvailableGlobalVirtualGroupFamilies(ctx context.Context, in *QuerySPAvailableGlobalVirtualGroupFamiliesRequest, opts ...grpc.CallOption) (*QuerySPAvailableGlobalVirtualGroupFamiliesResponse, error) { + out := new(QuerySPAvailableGlobalVirtualGroupFamiliesResponse) + err := c.cc.Invoke(ctx, "/greenfield.virtualgroup.Query/QuerySpAvailableGlobalVirtualGroupFamilies", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QuerySpOptimalGlobalVirtualGroupFamily(ctx context.Context, in *QuerySpOptimalGlobalVirtualGroupFamilyRequest, opts ...grpc.CallOption) (*QuerySpOptimalGlobalVirtualGroupFamilyResponse, error) { + out := new(QuerySpOptimalGlobalVirtualGroupFamilyResponse) + err := c.cc.Invoke(ctx, "/greenfield.virtualgroup.Query/QuerySpOptimalGlobalVirtualGroupFamily", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. @@ -978,6 +1214,10 @@ type QueryServer interface { SwapInInfo(context.Context, *QuerySwapInInfoRequest) (*QuerySwapInInfoResponse, error) // GVGStatistics gets gvg statistics for a SP GVGStatistics(context.Context, *QuerySPGVGStatisticsRequest) (*QuerySPGVGStatisticsResponse, error) + // QuerySpAvailableGlobalVirtualGroupFamilies filters a list of GlobalVirtualGroupFamilies IDs under a certain SP that are qualified to create a bucket on + QuerySpAvailableGlobalVirtualGroupFamilies(context.Context, *QuerySPAvailableGlobalVirtualGroupFamiliesRequest) (*QuerySPAvailableGlobalVirtualGroupFamiliesResponse, error) + // QuerySpOptimalGlobalVirtualGroupFamily filters the optimal GlobalVirtualGroupFamily under a certain SP that is qualified to create a bucket on + QuerySpOptimalGlobalVirtualGroupFamily(context.Context, *QuerySpOptimalGlobalVirtualGroupFamilyRequest) (*QuerySpOptimalGlobalVirtualGroupFamilyResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1008,6 +1248,12 @@ func (*UnimplementedQueryServer) SwapInInfo(ctx context.Context, req *QuerySwapI func (*UnimplementedQueryServer) GVGStatistics(ctx context.Context, req *QuerySPGVGStatisticsRequest) (*QuerySPGVGStatisticsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GVGStatistics not implemented") } +func (*UnimplementedQueryServer) QuerySpAvailableGlobalVirtualGroupFamilies(ctx context.Context, req *QuerySPAvailableGlobalVirtualGroupFamiliesRequest) (*QuerySPAvailableGlobalVirtualGroupFamiliesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QuerySpAvailableGlobalVirtualGroupFamilies not implemented") +} +func (*UnimplementedQueryServer) QuerySpOptimalGlobalVirtualGroupFamily(ctx context.Context, req *QuerySpOptimalGlobalVirtualGroupFamilyRequest) (*QuerySpOptimalGlobalVirtualGroupFamilyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QuerySpOptimalGlobalVirtualGroupFamily not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1157,6 +1403,42 @@ func _Query_GVGStatistics_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _Query_QuerySpAvailableGlobalVirtualGroupFamilies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySPAvailableGlobalVirtualGroupFamiliesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QuerySpAvailableGlobalVirtualGroupFamilies(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/greenfield.virtualgroup.Query/QuerySpAvailableGlobalVirtualGroupFamilies", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QuerySpAvailableGlobalVirtualGroupFamilies(ctx, req.(*QuerySPAvailableGlobalVirtualGroupFamiliesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QuerySpOptimalGlobalVirtualGroupFamily_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySpOptimalGlobalVirtualGroupFamilyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QuerySpOptimalGlobalVirtualGroupFamily(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/greenfield.virtualgroup.Query/QuerySpOptimalGlobalVirtualGroupFamily", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QuerySpOptimalGlobalVirtualGroupFamily(ctx, req.(*QuerySpOptimalGlobalVirtualGroupFamilyRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "greenfield.virtualgroup.Query", HandlerType: (*QueryServer)(nil), @@ -1193,6 +1475,14 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "GVGStatistics", Handler: _Query_GVGStatistics_Handler, }, + { + MethodName: "QuerySpAvailableGlobalVirtualGroupFamilies", + Handler: _Query_QuerySpAvailableGlobalVirtualGroupFamilies_Handler, + }, + { + MethodName: "QuerySpOptimalGlobalVirtualGroupFamily", + Handler: _Query_QuerySpOptimalGlobalVirtualGroupFamily_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "greenfield/virtualgroup/query.proto", @@ -1742,83 +2032,213 @@ func (m *QuerySPGVGStatisticsResponse) MarshalToSizedBuffer(dAtA []byte) (int, e return len(dAtA) - i, nil } -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 +func (m *QuerySPAvailableGlobalVirtualGroupFamiliesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l - return n + return dAtA[:n], nil } -func (m *QueryParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - return n +func (m *QuerySPAvailableGlobalVirtualGroupFamiliesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGlobalVirtualGroupRequest) Size() (n int) { - if m == nil { - return 0 - } +func (m *QuerySPAvailableGlobalVirtualGroupFamiliesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.GlobalVirtualGroupId != 0 { - n += 1 + sovQuery(uint64(m.GlobalVirtualGroupId)) + if m.SpId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.SpId)) + i-- + dAtA[i] = 0x8 } - return n + return len(dAtA) - i, nil } -func (m *QueryGlobalVirtualGroupResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.GlobalVirtualGroup != nil { - l = m.GlobalVirtualGroup.Size() - n += 1 + l + sovQuery(uint64(l)) +func (m *QuerySPAvailableGlobalVirtualGroupFamiliesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *QueryGlobalVirtualGroupByFamilyIDRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.GlobalVirtualGroupFamilyId != 0 { - n += 1 + sovQuery(uint64(m.GlobalVirtualGroupFamilyId)) - } - return n +func (m *QuerySPAvailableGlobalVirtualGroupFamiliesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGlobalVirtualGroupByFamilyIDResponse) Size() (n int) { - if m == nil { - return 0 - } +func (m *QuerySPAvailableGlobalVirtualGroupFamiliesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.GlobalVirtualGroups) > 0 { - for _, e := range m.GlobalVirtualGroups { - l = e.Size() + if len(m.GlobalVirtualGroupFamilyIds) > 0 { + dAtA13 := make([]byte, len(m.GlobalVirtualGroupFamilyIds)*10) + var j12 int + for _, num := range m.GlobalVirtualGroupFamilyIds { + for num >= 1<<7 { + dAtA13[j12] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j12++ + } + dAtA13[j12] = uint8(num) + j12++ + } + i -= j12 + copy(dAtA[i:], dAtA13[:j12]) + i = encodeVarintQuery(dAtA, i, uint64(j12)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QuerySpOptimalGlobalVirtualGroupFamilyRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QuerySpOptimalGlobalVirtualGroupFamilyRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySpOptimalGlobalVirtualGroupFamilyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PickVgfStrategy != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.PickVgfStrategy)) + i-- + dAtA[i] = 0x10 + } + if m.SpId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.SpId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QuerySpOptimalGlobalVirtualGroupFamilyResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QuerySpOptimalGlobalVirtualGroupFamilyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySpOptimalGlobalVirtualGroupFamilyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.GlobalVirtualGroupFamilyId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.GlobalVirtualGroupFamilyId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryGlobalVirtualGroupRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.GlobalVirtualGroupId != 0 { + n += 1 + sovQuery(uint64(m.GlobalVirtualGroupId)) + } + return n +} + +func (m *QueryGlobalVirtualGroupResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.GlobalVirtualGroup != nil { + l = m.GlobalVirtualGroup.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGlobalVirtualGroupByFamilyIDRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.GlobalVirtualGroupFamilyId != 0 { + n += 1 + sovQuery(uint64(m.GlobalVirtualGroupFamilyId)) + } + return n +} + +func (m *QueryGlobalVirtualGroupByFamilyIDResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.GlobalVirtualGroups) > 0 { + for _, e := range m.GlobalVirtualGroups { + l = e.Size() n += 1 + l + sovQuery(uint64(l)) } } @@ -1967,6 +2387,61 @@ func (m *QuerySPGVGStatisticsResponse) Size() (n int) { return n } +func (m *QuerySPAvailableGlobalVirtualGroupFamiliesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SpId != 0 { + n += 1 + sovQuery(uint64(m.SpId)) + } + return n +} + +func (m *QuerySPAvailableGlobalVirtualGroupFamiliesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.GlobalVirtualGroupFamilyIds) > 0 { + l = 0 + for _, e := range m.GlobalVirtualGroupFamilyIds { + l += sovQuery(uint64(e)) + } + n += 1 + sovQuery(uint64(l)) + l + } + return n +} + +func (m *QuerySpOptimalGlobalVirtualGroupFamilyRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SpId != 0 { + n += 1 + sovQuery(uint64(m.SpId)) + } + if m.PickVgfStrategy != 0 { + n += 1 + sovQuery(uint64(m.PickVgfStrategy)) + } + return n +} + +func (m *QuerySpOptimalGlobalVirtualGroupFamilyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.GlobalVirtualGroupFamilyId != 0 { + n += 1 + sovQuery(uint64(m.GlobalVirtualGroupFamilyId)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -3356,6 +3831,358 @@ func (m *QuerySPGVGStatisticsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QuerySPAvailableGlobalVirtualGroupFamiliesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QuerySPAvailableGlobalVirtualGroupFamiliesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySPAvailableGlobalVirtualGroupFamiliesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SpId", wireType) + } + m.SpId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SpId |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySPAvailableGlobalVirtualGroupFamiliesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QuerySPAvailableGlobalVirtualGroupFamiliesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySPAvailableGlobalVirtualGroupFamiliesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType == 0 { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.GlobalVirtualGroupFamilyIds = append(m.GlobalVirtualGroupFamilyIds, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.GlobalVirtualGroupFamilyIds) == 0 { + m.GlobalVirtualGroupFamilyIds = make([]uint32, 0, elementCount) + } + for iNdEx < postIndex { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.GlobalVirtualGroupFamilyIds = append(m.GlobalVirtualGroupFamilyIds, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field GlobalVirtualGroupFamilyIds", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySpOptimalGlobalVirtualGroupFamilyRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QuerySpOptimalGlobalVirtualGroupFamilyRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySpOptimalGlobalVirtualGroupFamilyRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SpId", wireType) + } + m.SpId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SpId |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PickVgfStrategy", wireType) + } + m.PickVgfStrategy = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PickVgfStrategy |= PickVGFStrategy(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySpOptimalGlobalVirtualGroupFamilyResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QuerySpOptimalGlobalVirtualGroupFamilyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySpOptimalGlobalVirtualGroupFamilyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GlobalVirtualGroupFamilyId", wireType) + } + m.GlobalVirtualGroupFamilyId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GlobalVirtualGroupFamilyId |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/virtualgroup/types/query.pb.gw.go b/x/virtualgroup/types/query.pb.gw.go index f72c03634..aaa14297c 100644 --- a/x/virtualgroup/types/query.pb.gw.go +++ b/x/virtualgroup/types/query.pb.gw.go @@ -303,6 +303,78 @@ func local_request_Query_GVGStatistics_0(ctx context.Context, marshaler runtime. } +var ( + filter_Query_QuerySpAvailableGlobalVirtualGroupFamilies_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QuerySpAvailableGlobalVirtualGroupFamilies_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySPAvailableGlobalVirtualGroupFamiliesRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QuerySpAvailableGlobalVirtualGroupFamilies_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QuerySpAvailableGlobalVirtualGroupFamilies(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QuerySpAvailableGlobalVirtualGroupFamilies_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySPAvailableGlobalVirtualGroupFamiliesRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QuerySpAvailableGlobalVirtualGroupFamilies_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QuerySpAvailableGlobalVirtualGroupFamilies(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QuerySpOptimalGlobalVirtualGroupFamily_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QuerySpOptimalGlobalVirtualGroupFamily_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySpOptimalGlobalVirtualGroupFamilyRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QuerySpOptimalGlobalVirtualGroupFamily_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QuerySpOptimalGlobalVirtualGroupFamily(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QuerySpOptimalGlobalVirtualGroupFamily_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySpOptimalGlobalVirtualGroupFamilyRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QuerySpOptimalGlobalVirtualGroupFamily_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QuerySpOptimalGlobalVirtualGroupFamily(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -493,6 +565,52 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QuerySpAvailableGlobalVirtualGroupFamilies_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QuerySpAvailableGlobalVirtualGroupFamilies_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QuerySpAvailableGlobalVirtualGroupFamilies_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QuerySpOptimalGlobalVirtualGroupFamily_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QuerySpOptimalGlobalVirtualGroupFamily_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QuerySpOptimalGlobalVirtualGroupFamily_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -694,6 +812,46 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QuerySpAvailableGlobalVirtualGroupFamilies_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QuerySpAvailableGlobalVirtualGroupFamilies_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QuerySpAvailableGlobalVirtualGroupFamilies_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QuerySpOptimalGlobalVirtualGroupFamily_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QuerySpOptimalGlobalVirtualGroupFamily_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QuerySpOptimalGlobalVirtualGroupFamily_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -713,6 +871,10 @@ var ( pattern_Query_SwapInInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"greenfield", "virtualgroup", "swap_in_info"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_GVGStatistics_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"greenfield", "virtualgroup", "sp_gvg_statistics"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QuerySpAvailableGlobalVirtualGroupFamilies_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"greenfield", "virtualgroup", "sp_available_global_virtual_group_families"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QuerySpOptimalGlobalVirtualGroupFamily_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"greenfield", "virtualgroup", "sp_optimal_global_virtual_group_family"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -731,4 +893,8 @@ var ( forward_Query_SwapInInfo_0 = runtime.ForwardResponseMessage forward_Query_GVGStatistics_0 = runtime.ForwardResponseMessage + + forward_Query_QuerySpAvailableGlobalVirtualGroupFamilies_0 = runtime.ForwardResponseMessage + + forward_Query_QuerySpOptimalGlobalVirtualGroupFamily_0 = runtime.ForwardResponseMessage ) diff --git a/x/virtualgroup/types/types.pb.go b/x/virtualgroup/types/types.pb.go index 7b408d6ee..72dea051c 100644 --- a/x/virtualgroup/types/types.pb.go +++ b/x/virtualgroup/types/types.pb.go @@ -328,6 +328,60 @@ func (m *GVGStatisticsWithinSP) GetBreakRedundancyReqmtGvgCount() uint32 { return 0 } +type GVGFamilyStatisticsWithinSP struct { + // sp_id defines the id of the sp which the statistics associated to + SpId uint32 `protobuf:"varint,1,opt,name=sp_id,json=spId,proto3" json:"sp_id,omitempty"` + // global_virtual_group_family_ids is a list of identifiers of the global virtual group family associated with the SP. + GlobalVirtualGroupFamilyIds []uint32 `protobuf:"varint,2,rep,packed,name=global_virtual_group_family_ids,json=globalVirtualGroupFamilyIds,proto3" json:"global_virtual_group_family_ids,omitempty"` +} + +func (m *GVGFamilyStatisticsWithinSP) Reset() { *m = GVGFamilyStatisticsWithinSP{} } +func (m *GVGFamilyStatisticsWithinSP) String() string { return proto.CompactTextString(m) } +func (*GVGFamilyStatisticsWithinSP) ProtoMessage() {} +func (*GVGFamilyStatisticsWithinSP) Descriptor() ([]byte, []int) { + return fileDescriptor_1fe6fc664532d0c3, []int{4} +} +func (m *GVGFamilyStatisticsWithinSP) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GVGFamilyStatisticsWithinSP) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GVGFamilyStatisticsWithinSP.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GVGFamilyStatisticsWithinSP) XXX_Merge(src proto.Message) { + xxx_messageInfo_GVGFamilyStatisticsWithinSP.Merge(m, src) +} +func (m *GVGFamilyStatisticsWithinSP) XXX_Size() int { + return m.Size() +} +func (m *GVGFamilyStatisticsWithinSP) XXX_DiscardUnknown() { + xxx_messageInfo_GVGFamilyStatisticsWithinSP.DiscardUnknown(m) +} + +var xxx_messageInfo_GVGFamilyStatisticsWithinSP proto.InternalMessageInfo + +func (m *GVGFamilyStatisticsWithinSP) GetSpId() uint32 { + if m != nil { + return m.SpId + } + return 0 +} + +func (m *GVGFamilyStatisticsWithinSP) GetGlobalVirtualGroupFamilyIds() []uint32 { + if m != nil { + return m.GlobalVirtualGroupFamilyIds + } + return nil +} + type SwapOutInfo struct { // sp_id is the unique id of the storage provider who want to swap out. SpId uint32 `protobuf:"varint,1,opt,name=sp_id,json=spId,proto3" json:"sp_id,omitempty"` @@ -339,7 +393,7 @@ func (m *SwapOutInfo) Reset() { *m = SwapOutInfo{} } func (m *SwapOutInfo) String() string { return proto.CompactTextString(m) } func (*SwapOutInfo) ProtoMessage() {} func (*SwapOutInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_1fe6fc664532d0c3, []int{4} + return fileDescriptor_1fe6fc664532d0c3, []int{5} } func (m *SwapOutInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -395,7 +449,7 @@ func (m *SwapInInfo) Reset() { *m = SwapInInfo{} } func (m *SwapInInfo) String() string { return proto.CompactTextString(m) } func (*SwapInInfo) ProtoMessage() {} func (*SwapInInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_1fe6fc664532d0c3, []int{5} + return fileDescriptor_1fe6fc664532d0c3, []int{6} } func (m *SwapInInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -450,6 +504,7 @@ func init() { proto.RegisterType((*GlobalVirtualGroupFamily)(nil), "greenfield.virtualgroup.GlobalVirtualGroupFamily") proto.RegisterType((*GlobalVirtualGroupsBindingOnBucket)(nil), "greenfield.virtualgroup.GlobalVirtualGroupsBindingOnBucket") proto.RegisterType((*GVGStatisticsWithinSP)(nil), "greenfield.virtualgroup.GVGStatisticsWithinSP") + proto.RegisterType((*GVGFamilyStatisticsWithinSP)(nil), "greenfield.virtualgroup.GVGFamilyStatisticsWithinSP") proto.RegisterType((*SwapOutInfo)(nil), "greenfield.virtualgroup.SwapOutInfo") proto.RegisterType((*SwapInInfo)(nil), "greenfield.virtualgroup.SwapInInfo") } @@ -459,52 +514,54 @@ func init() { } var fileDescriptor_1fe6fc664532d0c3 = []byte{ - // 714 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x41, 0x4f, 0x1b, 0x39, - 0x14, 0xce, 0x84, 0xc0, 0x12, 0x87, 0xc0, 0xae, 0x01, 0x31, 0x0b, 0xab, 0x10, 0x0d, 0x12, 0xe4, - 0x92, 0xe4, 0xb0, 0xbb, 0x6a, 0x0f, 0xbd, 0x34, 0xad, 0x88, 0xd2, 0x43, 0x89, 0x26, 0x2d, 0x95, - 0x7a, 0x19, 0x39, 0x63, 0x33, 0x58, 0x64, 0xec, 0xa9, 0xed, 0x49, 0x09, 0x97, 0xfe, 0x85, 0xfe, - 0x18, 0x7e, 0x04, 0xa7, 0x0a, 0x71, 0x6a, 0x2b, 0x15, 0x55, 0xa0, 0xfe, 0x8f, 0x6a, 0x6c, 0x37, - 0x81, 0x06, 0x51, 0xa9, 0xa7, 0x19, 0x7f, 0xef, 0x7b, 0x9f, 0xf5, 0xbe, 0xf7, 0x9e, 0xc1, 0x56, - 0x24, 0x08, 0x61, 0x07, 0x94, 0x0c, 0x70, 0x73, 0x48, 0x85, 0x4a, 0xd1, 0x20, 0x12, 0x3c, 0x4d, - 0x9a, 0x6a, 0x94, 0x10, 0xd9, 0x48, 0x04, 0x57, 0x1c, 0xae, 0x4d, 0x48, 0x8d, 0x9b, 0xa4, 0xf5, - 0xbf, 0x43, 0x2e, 0x63, 0x2e, 0x03, 0x4d, 0x6b, 0x9a, 0x83, 0xc9, 0x59, 0x5f, 0x89, 0x78, 0xc4, - 0x0d, 0x9e, 0xfd, 0x19, 0xd4, 0xfb, 0x96, 0x07, 0xb0, 0x3d, 0xe0, 0x7d, 0x34, 0xd8, 0x37, 0x3a, - 0xed, 0x4c, 0x07, 0x2e, 0x82, 0x3c, 0xc5, 0xae, 0x53, 0x75, 0x6a, 0x65, 0x3f, 0x4f, 0x31, 0xdc, - 0x00, 0xc5, 0x03, 0x14, 0xd3, 0xc1, 0x28, 0xa0, 0xd8, 0xcd, 0x6b, 0x78, 0xde,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c, 0x7f, 0x34, 0xcf, 0x1f, 0xd3, 0xfc, 0x8c, 0xd5, - 0x1e, 0x46, 0x5a, 0xc7, 0x7b, 0x06, 0x4a, 0xbd, 0xb7, 0x28, 0xd9, 0x4b, 0x55, 0x87, 0x1d, 0x70, - 0xb8, 0x0c, 0x66, 0xcd, 0x98, 0x99, 0x32, 0x0a, 0x32, 0x9b, 0xaf, 0x6d, 0xb0, 0x24, 0xd3, 0x30, - 0x24, 0x52, 0x72, 0x71, 0x6b, 0x0a, 0xcb, 0x63, 0x38, 0x9b, 0x43, 0xef, 0x1d, 0x00, 0x99, 0x56, - 0x87, 0x69, 0xa9, 0x3b, 0xb2, 0x9c, 0x3b, 0xb2, 0x60, 0x15, 0x2c, 0x28, 0x24, 0x22, 0xa2, 0x6e, - 0x49, 0x03, 0x83, 0x69, 0xc6, 0x0e, 0x58, 0x22, 0xc7, 0x09, 0x15, 0x48, 0x51, 0xce, 0x02, 0x45, - 0x63, 0xa2, 0x4d, 0x29, 0xf8, 0x8b, 0x13, 0xf8, 0x05, 0x8d, 0x49, 0xeb, 0xf9, 0xd9, 0x55, 0xc5, - 0x39, 0xbf, 0xaa, 0x38, 0x5f, 0xaf, 0x2a, 0xce, 0xfb, 0xeb, 0x4a, 0xee, 0xfc, 0xba, 0x92, 0xfb, - 0x78, 0x5d, 0xc9, 0xbd, 0xfe, 0xef, 0xc6, 0xde, 0xf6, 0x59, 0xbf, 0x1e, 0x1e, 0x22, 0xca, 0x9a, - 0x37, 0xde, 0xd7, 0xe3, 0x3b, 0x5e, 0xd8, 0xfe, 0x9c, 0x7e, 0x18, 0xff, 0xfd, 0x1e, 0x00, 0x00, - 0xff, 0xff, 0xa6, 0x34, 0xd1, 0x03, 0x89, 0x05, 0x00, 0x00, + // 744 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x4d, 0x4f, 0x1b, 0x39, + 0x18, 0xce, 0x84, 0xc0, 0x12, 0x87, 0xc0, 0xee, 0x00, 0x62, 0x96, 0xac, 0x92, 0x68, 0x90, 0x20, + 0x97, 0x24, 0x87, 0xdd, 0xd5, 0xee, 0xa1, 0x97, 0xa6, 0x88, 0x28, 0x3d, 0x94, 0x68, 0xd2, 0x52, + 0xa9, 0x97, 0x91, 0x33, 0x36, 0x83, 0x45, 0xc6, 0x9e, 0xda, 0x9e, 0x94, 0x70, 0xe9, 0x5f, 0xe8, + 0x8f, 0xe1, 0x47, 0x70, 0xaa, 0x10, 0xa7, 0xb6, 0x52, 0x51, 0x05, 0xea, 0xff, 0xa8, 0xc6, 0x36, + 0x09, 0x34, 0x29, 0x95, 0x7a, 0x4a, 0xe6, 0x79, 0x9f, 0xf7, 0xb1, 0xde, 0xe7, 0xfd, 0x00, 0x5b, + 0x21, 0xc7, 0x98, 0x1e, 0x12, 0x3c, 0x40, 0xcd, 0x21, 0xe1, 0x32, 0x81, 0x83, 0x90, 0xb3, 0x24, + 0x6e, 0xca, 0x51, 0x8c, 0x45, 0x23, 0xe6, 0x4c, 0x32, 0x7b, 0x63, 0x42, 0x6a, 0xdc, 0x25, 0x6d, + 0xfe, 0x19, 0x30, 0x11, 0x31, 0xe1, 0x2b, 0x5a, 0x53, 0x7f, 0xe8, 0x9c, 0xcd, 0xb5, 0x90, 0x85, + 0x4c, 0xe3, 0xe9, 0x3f, 0x8d, 0xba, 0x5f, 0xb3, 0xc0, 0x6e, 0x0f, 0x58, 0x1f, 0x0e, 0x0e, 0xb4, + 0x4e, 0x3b, 0xd5, 0xb1, 0x97, 0x41, 0x96, 0x20, 0xc7, 0xaa, 0x5a, 0xb5, 0xa2, 0x97, 0x25, 0xc8, + 0x2e, 0x81, 0xfc, 0x21, 0x8c, 0xc8, 0x60, 0xe4, 0x13, 0xe4, 0x64, 0x15, 0xbc, 0xa8, 0x81, 0x0e, + 0xb2, 0x5d, 0x50, 0x8c, 0x39, 0x89, 0x20, 0x1f, 0xf9, 0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 0x9e, 0x80, 0x52, 0xfb, 0xa0, 0xad, 0x87, 0x6f, 0x46, 0x91, + 0xab, 0x60, 0x5e, 0x8f, 0x9d, 0x2e, 0x2b, 0x27, 0xd2, 0x79, 0xdb, 0x05, 0x95, 0x99, 0x3d, 0x18, + 0x9f, 0x85, 0xdb, 0x56, 0x94, 0xc2, 0x1f, 0x8c, 0x79, 0xea, 0xec, 0x53, 0x50, 0xe8, 0xbd, 0x81, + 0xf1, 0x7e, 0x22, 0x3b, 0xf4, 0x90, 0xcd, 0x7e, 0x69, 0x1b, 0xac, 0x88, 0x24, 0x08, 0xb0, 0x10, + 0x8c, 0xdf, 0x9b, 0xff, 0xe2, 0x18, 0x4e, 0x37, 0xc0, 0x7d, 0x0b, 0x40, 0xaa, 0xd5, 0xa1, 0x4a, + 0x6a, 0x46, 0x96, 0x35, 0x23, 0xcb, 0xae, 0x82, 0x25, 0x09, 0x79, 0x88, 0xe5, 0x3d, 0x69, 0xa0, + 0x31, 0xc5, 0xd8, 0x01, 0x2b, 0xf8, 0x24, 0x26, 0x1c, 0x4a, 0xc2, 0xa8, 0x2f, 0x49, 0x84, 0x55, + 0x3b, 0x72, 0xde, 0xf2, 0x04, 0x7e, 0x4e, 0x22, 0xdc, 0x7a, 0x76, 0x7e, 0x5d, 0xb6, 0x2e, 0xae, + 0xcb, 0xd6, 0x97, 0xeb, 0xb2, 0xf5, 0xee, 0xa6, 0x9c, 0xb9, 0xb8, 0x29, 0x67, 0x3e, 0xdc, 0x94, + 0x33, 0xaf, 0xfe, 0xb9, 0x73, 0x31, 0xfa, 0xb4, 0x5f, 0x0f, 0x8e, 0x20, 0xa1, 0xcd, 0x3b, 0x97, + 0xfd, 0x64, 0xc6, 0x6d, 0xef, 0x2f, 0xa8, 0x93, 0xfc, 0xf7, 0xb7, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xee, 0xc6, 0xf3, 0x35, 0x03, 0x06, 0x00, 0x00, } func (m *GlobalVirtualGroup) Marshal() (dAtA []byte, err error) { @@ -755,6 +812,52 @@ func (m *GVGStatisticsWithinSP) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *GVGFamilyStatisticsWithinSP) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GVGFamilyStatisticsWithinSP) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GVGFamilyStatisticsWithinSP) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.GlobalVirtualGroupFamilyIds) > 0 { + dAtA10 := make([]byte, len(m.GlobalVirtualGroupFamilyIds)*10) + var j9 int + for _, num := range m.GlobalVirtualGroupFamilyIds { + for num >= 1<<7 { + dAtA10[j9] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j9++ + } + dAtA10[j9] = uint8(num) + j9++ + } + i -= j9 + copy(dAtA[i:], dAtA10[:j9]) + i = encodeVarintTypes(dAtA, i, uint64(j9)) + i-- + dAtA[i] = 0x12 + } + if m.SpId != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.SpId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *SwapOutInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -943,6 +1046,25 @@ func (m *GVGStatisticsWithinSP) Size() (n int) { return n } +func (m *GVGFamilyStatisticsWithinSP) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SpId != 0 { + n += 1 + sovTypes(uint64(m.SpId)) + } + if len(m.GlobalVirtualGroupFamilyIds) > 0 { + l = 0 + for _, e := range m.GlobalVirtualGroupFamilyIds { + l += sovTypes(uint64(e)) + } + n += 1 + sovTypes(uint64(l)) + l + } + return n +} + func (m *SwapOutInfo) Size() (n int) { if m == nil { return 0 @@ -1808,6 +1930,151 @@ func (m *GVGStatisticsWithinSP) Unmarshal(dAtA []byte) error { } return nil } +func (m *GVGFamilyStatisticsWithinSP) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GVGFamilyStatisticsWithinSP: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GVGFamilyStatisticsWithinSP: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SpId", wireType) + } + m.SpId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SpId |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType == 0 { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.GlobalVirtualGroupFamilyIds = append(m.GlobalVirtualGroupFamilyIds, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.GlobalVirtualGroupFamilyIds) == 0 { + m.GlobalVirtualGroupFamilyIds = make([]uint32, 0, elementCount) + } + for iNdEx < postIndex { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.GlobalVirtualGroupFamilyIds = append(m.GlobalVirtualGroupFamilyIds, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field GlobalVirtualGroupFamilyIds", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *SwapOutInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0