diff options
| author | Chris Lu <chris.lu@gmail.com> | 2019-05-23 22:51:18 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2019-05-23 22:51:18 -0700 |
| commit | 8a96445f402a240956adf081de3a675e2e41c767 (patch) | |
| tree | 1e1d2fddee9f3d1bab4d966149a8a8d137e2aa76 /weed/storage/erasure_coding | |
| parent | 4659d80035430bcbd6f1642311680af0f7a6f215 (diff) | |
| download | seaweedfs-8a96445f402a240956adf081de3a675e2e41c767.tar.xz seaweedfs-8a96445f402a240956adf081de3a675e2e41c767.zip | |
register ec shards to each data node
Diffstat (limited to 'weed/storage/erasure_coding')
| -rw-r--r-- | weed/storage/erasure_coding/ec_volume_info.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/weed/storage/erasure_coding/ec_volume_info.go b/weed/storage/erasure_coding/ec_volume_info.go index 9cebb7d40..645686a92 100644 --- a/weed/storage/erasure_coding/ec_volume_info.go +++ b/weed/storage/erasure_coding/ec_volume_info.go @@ -40,6 +40,16 @@ func (ecInfo *EcVolumeInfo) ShardIds() (ret []ShardId) { return } +func (ecInfo *EcVolumeInfo) Minus(other *EcVolumeInfo) (*EcVolumeInfo) { + ret := &EcVolumeInfo{ + VolumeId: ecInfo.VolumeId, + Collection: ecInfo.Collection, + shardIds: ecInfo.shardIds &^ other.shardIds, + } + + return ret +} + func (ecInfo *EcVolumeInfo) ToVolumeEcShardInformationMessage() (ret []*master_pb.VolumeEcShardInformationMessage) { for _, shard := range ecInfo.ShardIds() { ret = append(ret, &master_pb.VolumeEcShardInformationMessage{ |
