diff --git a/proto/greenfield/virtualgroup/query.proto b/proto/greenfield/virtualgroup/query.proto index 9a0f289b0..bb4577d9d 100644 --- a/proto/greenfield/virtualgroup/query.proto +++ b/proto/greenfield/virtualgroup/query.proto @@ -51,6 +51,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 +129,19 @@ 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; +} + +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..a5cb8dec2 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 { + // storage_provider_id defines the id of the sp which the statistics associated to + uint32 storage_provider_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..1457a7d4a 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,52 @@ 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 + tags: + - Query /greenfield/virtualgroup/swap_in_info: get: summary: >- @@ -37376,6 +37470,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 +37523,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..26251bd65 100644 --- a/x/storage/keeper/keeper.go +++ b/x/storage/keeper/keeper.go @@ -117,14 +117,6 @@ 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 - } gvgFamily, err := k.virtualGroupKeeper.GetAndCheckGVGFamilyAvailableForNewBucket(ctx, opts.PrimarySpApproval.GlobalVirtualGroupFamilyId) if err != nil { return sdkmath.ZeroUint(), err @@ -567,6 +559,12 @@ func (k Keeper) CreateObject( return sdkmath.ZeroUint(), err } + // check object + _, found = k.GetObjectInfo(ctx, bucketName, objectName) + if found { + return sdkmath.ZeroUint(), types.ErrObjectAlreadyExists + } + // primary sp sp := k.MustGetPrimarySPForBucket(ctx, bucketInfo) @@ -585,12 +583,7 @@ 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) + err = k.VerifySP(ctx, sp, operator) if err != nil { return sdkmath.ZeroUint(), err } @@ -1618,6 +1611,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..6527983eb 100644 --- a/x/storage/keeper/keeper_object_test.go +++ b/x/storage/keeper/keeper_object_test.go @@ -99,7 +99,23 @@ 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, + }) + _, err = s.storageKeeper.CreateObject(s.ctx, operatorAddress, bucketInfo.BucketName, + objectName, 100, types.CreateObjectOptions{ + Visibility: 0, + ContentType: "", + SourceType: 0, + RedundancyType: 0, + Checksums: nil, + }) + s.Require().ErrorContains(err, "Object already exists") + + // case 6: valid case s.virtualGroupKeeper.EXPECT().GetGVGFamily(gomock.Any(), gomock.Any()).Return(&types2.GlobalVirtualGroupFamily{ Id: 0, PrimarySpId: 0, @@ -107,7 +123,7 @@ func (s *TestSuite) TestCreateObject() { 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(), @@ -122,60 +138,6 @@ func (s *TestSuite) TestCreateObject() { BlsKey: nil, }).AnyTimes() s.ctx = s.ctx.WithBlockHeight(100) - _, 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, "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 s.storageKeeper.DeleteObjectInfo(s.ctx, &types.ObjectInfo{ Id: sdk.NewUint(1), BucketName: bucketInfo.BucketName, @@ -211,9 +173,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/virtualgroup/keeper/grpc_query.go b/x/virtualgroup/keeper/grpc_query.go index fe8c994d9..42d83524e 100644 --- a/x/virtualgroup/keeper/grpc_query.go +++ b/x/virtualgroup/keeper/grpc_query.go @@ -165,3 +165,71 @@ 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 + 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 + } + } + } + + return &types.QuerySpOptimalGlobalVirtualGroupFamilyResponse{ + GlobalVirtualGroupFamilyId: familyID, + }, nil +} diff --git a/x/virtualgroup/keeper/keeper.go b/x/virtualgroup/keeper/keeper.go index a3c9d6dfc..06d26bb38 100644 --- a/x/virtualgroup/keeper/keeper.go +++ b/x/virtualgroup/keeper/keeper.go @@ -167,6 +167,7 @@ func (k Keeper) DeleteGVG(ctx sdk.Context, primarySp *sptypes.StorageProvider, g k.paymentKeeper.IsEmptyNetFlow(ctx, sdk.MustAccAddressFromHex(gvgFamily.VirtualPaymentAddress)) && !ctx.IsUpgraded(upgradetypes.Manchurian) { store.Delete(types.GetGVGFamilyKey(gvg.FamilyId)) + k.DeleteGVGFamilyWithinSP(ctx, primarySp.Id, gvg.FamilyId) if err := ctx.EventManager().EmitTypedEvents(&types.EventDeleteGlobalVirtualGroupFamily{ Id: gvgFamily.Id, PrimarySpId: gvgFamily.PrimarySpId, @@ -251,6 +252,9 @@ func (k Keeper) GetOrCreateEmptyGVGFamily(ctx sdk.Context, familyID uint32, prim PrimarySpId: primarySPID, VirtualPaymentAddress: k.DeriveVirtualPaymentAccount(types.GVGFamilyName, id).String(), } + gvgFamilyStatistics := k.GetOrCreateGVGFamilyStatisticsWithinSP(ctx, primarySPID) + gvgFamilyStatistics.GlobalVirtualGroupFamilyIds = append(gvgFamilyStatistics.GlobalVirtualGroupFamilyIds, familyID) + k.SetGVGFamilyStatisticsWithinSP(ctx, gvgFamilyStatistics) return &gvgFamily, nil } else { bz := store.Get(types.GetGVGFamilyKey(familyID)) @@ -289,6 +293,8 @@ func (k Keeper) SwapAsPrimarySP(ctx sdk.Context, primarySP, successorSP *sptypes srcStat := k.MustGetGVGStatisticsWithinSP(ctx, primarySP.Id) dstStat := k.GetOrCreateGVGStatisticsWithinSP(ctx, successorSP.Id) + srcVGFStat := k.MustGetGVGFamilyStatisticsWithinSP(ctx, primarySP.Id) + dstVGFStat := k.GetOrCreateGVGFamilyStatisticsWithinSP(ctx, successorSP.Id) var gvgs []*types.GlobalVirtualGroup for _, gvgID := range family.GlobalVirtualGroupIds { @@ -358,6 +364,9 @@ func (k Keeper) SwapAsPrimarySP(ctx sdk.Context, primarySP, successorSP *sptypes } k.SetGVGStatisticsWithSP(ctx, srcStat) k.SetGVGStatisticsWithSP(ctx, dstStat) + k.DeleteGVGFamilyWithinSP(ctx, srcVGFStat.StorageProviderId, family.Id) + dstVGFStat.GlobalVirtualGroupFamilyIds = append(dstVGFStat.GlobalVirtualGroupFamilyIds, family.Id) + k.SetGVGFamilyStatisticsWithinSP(ctx, dstVGFStat) return nil } @@ -481,6 +490,76 @@ 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{ + StorageProviderId: spID, + } + bz := store.Get(types.GetGVGFamilyStatisticsWithinSPKey(spID)) + if bz == nil { + return ret + } + + k.cdc.MustUnmarshal(bz, ret) + return ret +} + +func (k Keeper) DeleteGVGFamilyWithinSP(ctx sdk.Context, spID uint32, familyID uint32) { + gvgFamilyStatistics := k.MustGetGVGFamilyStatisticsWithinSP(ctx, spID) + index := -1 + for i, id := range gvgFamilyStatistics.GlobalVirtualGroupFamilyIds { + if id == familyID { + index = i + break + } + } + if index != -1 { + gvgFamilyStatistics.GlobalVirtualGroupFamilyIds = append(gvgFamilyStatistics.GlobalVirtualGroupFamilyIds[:index], gvgFamilyStatistics.GlobalVirtualGroupFamilyIds[index+1:]...) + k.SetGVGFamilyStatisticsWithinSP(ctx, gvgFamilyStatistics) + } +} + +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.StorageProviderId), bz) +} + +func (k Keeper) BatchSetGVGFamilyStatisticsWithinSP(ctx sdk.Context, vgfStatisticsWithinSP []*types.GVGFamilyStatisticsWithinSP) { + for _, g := range vgfStatisticsWithinSP { + k.SetGVGFamilyStatisticsWithinSP(ctx, g) + } +} + // 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/errors.go b/x/virtualgroup/types/errors.go index 15e8c84d5..6283fc0f5 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, "gvg statistics not exist.") + ErrGVGFamilyStatisticsNotExist = errors.Register(ModuleName, 1130, "vgf 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..5d97aaa42 100644 --- a/x/virtualgroup/types/query.pb.go +++ b/x/virtualgroup/types/query.pb.go @@ -763,6 +763,198 @@ 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"` +} + +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 +} + +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 +972,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 +983,74 @@ 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, 0x49, 0xe3, 0xb1, - 0x8a, 0xaf, 0x26, 0xf1, 0xba, 0x2e, 0xde, 0x82, 0x79, 0x2a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 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, + // 1067 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x98, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xc7, 0x33, 0xa6, 0xad, 0xda, 0xd7, 0x46, 0x42, 0x93, 0x40, 0xa2, 0x4d, 0x64, 0xc3, 0xa6, + 0x6d, 0x4a, 0xda, 0xec, 0x12, 0x93, 0x94, 0x0a, 0xf5, 0x57, 0x9c, 0x34, 0x6e, 0x88, 0x04, 0xc1, + 0xa9, 0x5a, 0x09, 0x09, 0x2d, 0xb3, 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+ 0xe7, 0x6d, 0xb4, 0xe7, 0x25, 0xfe, 0x9f, 0x4a, 0xe6, 0xf5, 0x8e, 0xb7, 0x32, 0x20, 0x72, 0xbe, + 0x32, 0xa4, 0xfa, 0xa9, 0x75, 0x78, 0x21, 0xea, 0xac, 0x10, 0xeb, 0xf8, 0x5e, 0x5a, 0x21, 0x9c, + 0x50, 0x2c, 0xa5, 0x0c, 0xbd, 0xda, 0x27, 0x47, 0xc7, 0x65, 0xf4, 0xea, 0xb8, 0x8c, 0xfe, 0x3c, + 0x2e, 0xa3, 0xef, 0x4e, 0xca, 0x13, 0xaf, 0x4e, 0xca, 0x13, 0xbf, 0x9d, 0x94, 0x27, 0x3e, 0x5f, + 0x35, 0xa9, 0x7f, 0xd8, 0xd1, 0x95, 0x7d, 0xa7, 0xa5, 0xea, 0xb6, 0xbe, 0xbc, 0x7f, 0x48, 0xa8, + 0x3d, 0x98, 0xee, 0xeb, 0x84, 0xdf, 0x4a, 0xf4, 0x73, 0xec, 0xc7, 0x92, 0x0f, 0xfe, 0x0b, 0x00, + 0x00, 0xff, 0xff, 0x0c, 0xb3, 0x3c, 0xb8, 0x17, 0x12, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -878,6 +1081,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 +1167,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 +1203,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 +1237,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 +1392,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 +1464,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,76 +2021,201 @@ 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 - } +func (m *QuerySPAvailableGlobalVirtualGroupFamiliesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySPAvailableGlobalVirtualGroupFamiliesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.GlobalVirtualGroupFamilyId != 0 { - n += 1 + sovQuery(uint64(m.GlobalVirtualGroupFamilyId)) + 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 n + return len(dAtA) - i, nil } -func (m *QueryGlobalVirtualGroupByFamilyIDResponse) Size() (n int) { - if m == 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.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 @@ -1967,6 +2371,58 @@ 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)) + } + 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 +3812,339 @@ 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 + } + } + 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..2385e5257 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 { + // storage_provider_id defines the id of the sp which the statistics associated to + StorageProviderId uint32 `protobuf:"varint,1,opt,name=storage_provider_id,json=storageProviderId,proto3" json:"storage_provider_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) GetStorageProviderId() uint32 { + if m != nil { + return m.StorageProviderId + } + 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, - 0x0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0xd7, 0xe3, 0x3b, 0x5e, 0xd8, 0xfe, 0x9c, 0x7e, 0x18, 0xff, 0xfd, 0x1e, 0x00, 0x00, - 0xff, 0xff, 0xa6, 0x34, 0xd1, 0x03, 0x89, 0x05, 0x00, 0x00, + // 746 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x4d, 0x4f, 0x1b, 0x47, + 0x18, 0xf6, 0x1a, 0x43, 0xf1, 0x18, 0x43, 0xbb, 0x80, 0xd8, 0xe2, 0xca, 0xb6, 0x16, 0x09, 0x7c, + 0xb1, 0x7d, 0x68, 0xab, 0xf6, 0xd0, 0x4b, 0x5d, 0x84, 0xe5, 0x1e, 0x82, 0xb5, 0x4e, 0x88, 0x94, + 0xcb, 0x6a, 0xbc, 0x33, 0x2c, 0x23, 0xbc, 0x33, 0x9b, 0x99, 0x59, 0x07, 0x73, 0xc9, 0x5f, 0x88, + 0x94, 0xbf, 0xc2, 0x8f, 0xe0, 0x14, 0x21, 0x4e, 0x49, 0xa4, 0xa0, 0x08, 0x94, 0xff, 0x11, 0xed, + 0xcc, 0x60, 0x43, 0xec, 0x10, 0x29, 0xca, 0xc9, 0xde, 0xe7, 0x7d, 0xde, 0x67, 0xf4, 0x3e, 0xef, + 0x07, 0xd8, 0x0a, 0x39, 0xc6, 0xf4, 0x90, 0xe0, 0x01, 0x6a, 0x0e, 0x09, 0x97, 0x09, 0x1c, 0x84, + 0x9c, 0x25, 0x71, 0x53, 0x8e, 0x62, 0x2c, 0x1a, 0x31, 0x67, 0x92, 0xd9, 0x1b, 0x13, 0x52, 0xe3, + 0x2e, 0x69, 0xf3, 0xd7, 0x80, 0x89, 0x88, 0x09, 0x5f, 0xd1, 0x9a, 0xfa, 0x43, 0xe7, 0x6c, 0xae, + 0x85, 0x2c, 0x64, 0x1a, 0x4f, 0xff, 0x69, 0xd4, 0xfd, 0x94, 0x05, 0x76, 0x7b, 0xc0, 0xfa, 0x70, + 0x70, 0xa0, 0x75, 0xda, 0xa9, 0x8e, 0xbd, 0x0c, 0xb2, 0x04, 0x39, 0x56, 0xd5, 0xaa, 0x15, 0xbd, + 0x2c, 0x41, 0x76, 0x09, 0xe4, 0x0f, 0x61, 0x44, 0x06, 0x23, 0x9f, 0x20, 0x27, 0xab, 0xe0, 0x45, + 0x0d, 0x74, 0x90, 0xed, 0x82, 0x62, 0xcc, 0x49, 0x04, 0xf9, 0xc8, 0x17, 0x71, 0x4a, 0x98, 0x53, + 0x84, 0x82, 0x01, 0x7b, 0x71, 0x07, 0xd9, 0x35, 0xf0, 0xb3, 0xc0, 0x01, 0xa3, 0x68, 0xcc, 0x12, + 0x4e, 0xae, 0x3a, 0x57, 0x2b, 0x7a, 0xcb, 0x63, 0x3c, 0x25, 0x0a, 0xbb, 0x02, 0x0a, 0x42, 0x32, + 0x8e, 0x91, 0x2f, 0xc8, 0x29, 0x76, 0xe6, 0xab, 0x56, 0x2d, 0xe7, 0x01, 0x0d, 0xf5, 0xc8, 0x29, + 0xb6, 0xbb, 0x60, 0xc3, 0xd4, 0xec, 0xc7, 0x70, 0x14, 0x61, 0x2a, 0x7d, 0x88, 0x10, 0xc7, 0x42, + 0x38, 0x0b, 0x55, 0xab, 0x96, 0x6f, 0x39, 0x97, 0x67, 0xf5, 0x35, 0x53, 0xfb, 0xbf, 0x3a, 0xd2, + 0x93, 0x9c, 0xd0, 0xd0, 0x5b, 0x37, 0x89, 0x5d, 0x9d, 0x67, 0x82, 0x36, 0x04, 0x45, 0xc9, 0x24, + 0x1c, 0xf8, 0x08, 0xc7, 0x4c, 0x10, 0xe9, 0xfc, 0xa4, 0x74, 0xfe, 0x39, 0xbf, 0xaa, 0x64, 0xde, + 0x5f, 0x55, 0xb6, 0x43, 0x22, 0x8f, 0x92, 0x7e, 0x23, 0x60, 0x91, 0xb1, 0xd4, 0xfc, 0xd4, 0x05, + 0x3a, 0x36, 0x7d, 0xe9, 0x50, 0x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 0x9b, 0x72, 0xe6, 0xd9, 0x1f, 0x77, 0xae, 0x49, 0x9f, 0xf6, 0xeb, 0xc1, 0x11, 0x24, 0xb4, + 0x79, 0xe7, 0xea, 0x9f, 0xcc, 0xb8, 0xfb, 0xfd, 0x05, 0x75, 0xae, 0x7f, 0xff, 0x1c, 0x00, 0x00, + 0xff, 0xff, 0xde, 0x91, 0xe6, 0x16, 0x1f, 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.StorageProviderId != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.StorageProviderId)) + 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.StorageProviderId != 0 { + n += 1 + sovTypes(uint64(m.StorageProviderId)) + } + 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 StorageProviderId", wireType) + } + m.StorageProviderId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StorageProviderId |= 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