add collection.delete
This commit is contained in:
@@ -64,6 +64,10 @@ func (shard *EcVolumeShard) Close() {
|
||||
}
|
||||
}
|
||||
|
||||
func (shard *EcVolumeShard) Destroy() {
|
||||
os.Remove(shard.FileName() + ToExt(int(shard.ShardId)))
|
||||
}
|
||||
|
||||
func (shard *EcVolumeShard) ReadAt(buf []byte, offset int64) (int, error) {
|
||||
|
||||
return shard.ecdFile.ReadAt(buf, offset)
|
||||
|
||||
@@ -94,6 +94,17 @@ func (ev *EcVolume) Close() {
|
||||
}
|
||||
}
|
||||
|
||||
func (ev *EcVolume) Destroy() {
|
||||
|
||||
ev.Close()
|
||||
|
||||
baseFileName := EcShardFileName(ev.Collection, ev.dir, int(ev.VolumeId))
|
||||
for _, s := range ev.Shards {
|
||||
s.Destroy()
|
||||
}
|
||||
os.Remove(baseFileName + ".ecx")
|
||||
}
|
||||
|
||||
func (ev *EcVolume) ToVolumeEcShardInformationMessage() (messages []*master_pb.VolumeEcShardInformationMessage) {
|
||||
prevVolumeId := needle.VolumeId(math.MaxUint32)
|
||||
var m *master_pb.VolumeEcShardInformationMessage
|
||||
|
||||
Reference in New Issue
Block a user