Merge "Add tests for vfile.py" into feature/losf
This commit is contained in:
commit
dd8b12e2a8
|
@ -336,14 +336,14 @@ func (m *VolumeIndex) GetRepairTool() bool {
|
|||
}
|
||||
|
||||
type Volume struct {
|
||||
VolumeIndex uint32 `protobuf:"varint,1,opt,name=volume_index,json=volumeIndex,proto3" json:"volume_index,omitempty"`
|
||||
VolumeType uint32 `protobuf:"varint,2,opt,name=volume_type,json=volumeType,proto3" json:"volume_type,omitempty"`
|
||||
VolumeState uint32 `protobuf:"varint,3,opt,name=volume_state,json=volumeState,proto3" json:"volume_state,omitempty"`
|
||||
Partition uint32 `protobuf:"varint,4,opt,name=partition,proto3" json:"partition,omitempty"`
|
||||
NextOffset uint64 `protobuf:"varint,5,opt,name=next_offset,json=nextOffset,proto3" json:"next_offset,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
VolumeIndex uint32 `protobuf:"varint,1,opt,name=volume_index,json=volumeIndex,proto3" json:"volume_index,omitempty"`
|
||||
VolumeType VolumeType `protobuf:"varint,2,opt,name=volume_type,json=volumeType,proto3,enum=filemgr.VolumeType" json:"volume_type,omitempty"`
|
||||
VolumeState uint32 `protobuf:"varint,3,opt,name=volume_state,json=volumeState,proto3" json:"volume_state,omitempty"`
|
||||
Partition uint32 `protobuf:"varint,4,opt,name=partition,proto3" json:"partition,omitempty"`
|
||||
NextOffset uint64 `protobuf:"varint,5,opt,name=next_offset,json=nextOffset,proto3" json:"next_offset,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Volume) Reset() { *m = Volume{} }
|
||||
|
@ -378,11 +378,11 @@ func (m *Volume) GetVolumeIndex() uint32 {
|
|||
return 0
|
||||
}
|
||||
|
||||
func (m *Volume) GetVolumeType() uint32 {
|
||||
func (m *Volume) GetVolumeType() VolumeType {
|
||||
if m != nil {
|
||||
return m.VolumeType
|
||||
}
|
||||
return 0
|
||||
return VolumeType_VOLUME_DEFAULT
|
||||
}
|
||||
|
||||
func (m *Volume) GetVolumeState() uint32 {
|
||||
|
@ -1680,70 +1680,70 @@ func init() {
|
|||
func init() { proto.RegisterFile("fmgr.proto", fileDescriptor_1fcd0776e05e82a6) }
|
||||
|
||||
var fileDescriptor_1fcd0776e05e82a6 = []byte{
|
||||
// 1039 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xdd, 0x6e, 0xe3, 0x44,
|
||||
0x14, 0x5e, 0xe7, 0x7f, 0x4f, 0x7e, 0xea, 0x9d, 0x2d, 0x25, 0xb4, 0x40, 0x8b, 0xd1, 0xc2, 0x52,
|
||||
0xa4, 0x4a, 0x2c, 0x5c, 0x14, 0xb8, 0xca, 0xb6, 0xde, 0x52, 0x6d, 0x9a, 0x84, 0x89, 0xb7, 0x5b,
|
||||
0x24, 0x24, 0xcb, 0xa5, 0x93, 0xc6, 0xac, 0x63, 0x1b, 0xcf, 0x24, 0x6d, 0x7a, 0xc5, 0x7b, 0x70,
|
||||
0x83, 0x78, 0x00, 0x1e, 0x89, 0x67, 0x41, 0xf3, 0x63, 0xc7, 0xb1, 0x43, 0xdb, 0x95, 0x56, 0xdc,
|
||||
0x58, 0x3e, 0xdf, 0x9c, 0x99, 0xf9, 0xbe, 0x73, 0xce, 0xcc, 0x1c, 0x80, 0xd1, 0xe4, 0x32, 0xda,
|
||||
0x0b, 0xa3, 0x80, 0x05, 0xa8, 0x3a, 0x72, 0x3d, 0x32, 0xb9, 0x8c, 0x8c, 0xef, 0x01, 0x75, 0x5d,
|
||||
0xca, 0x06, 0x4e, 0xc4, 0x5c, 0xe6, 0x06, 0x3e, 0x3d, 0xf6, 0x47, 0x01, 0x7a, 0x02, 0xad, 0x30,
|
||||
0x46, 0xec, 0x73, 0x97, 0xd1, 0xb6, 0xb6, 0xa3, 0x3d, 0x6d, 0xe2, 0x66, 0x82, 0x3e, 0x77, 0x19,
|
||||
0x35, 0xce, 0xe0, 0xd1, 0xd2, 0x64, 0x31, 0xf7, 0x43, 0x78, 0x98, 0x78, 0xa9, 0x69, 0x0b, 0x60,
|
||||
0xc5, 0xca, 0x85, 0x55, 0x2b, 0x4f, 0xa0, 0xc5, 0x57, 0x1e, 0x4e, 0x47, 0x23, 0xf7, 0xfa, 0x1e,
|
||||
0xcb, 0x6e, 0x40, 0x85, 0x0a, 0x5f, 0xb1, 0x5c, 0x03, 0x2b, 0x6b, 0xc5, 0x76, 0xc5, 0x55, 0xdb,
|
||||
0x19, 0x00, 0x87, 0x6e, 0x64, 0xfa, 0x2c, 0x72, 0x09, 0x45, 0xeb, 0x50, 0x26, 0x3e, 0x8b, 0xe6,
|
||||
0x6d, 0x6d, 0xa7, 0xf8, 0xf4, 0x21, 0x96, 0x86, 0xf1, 0x97, 0x06, 0xf5, 0xd3, 0xc0, 0x9b, 0x4e,
|
||||
0xc8, 0xb1, 0x7f, 0x41, 0xae, 0xb9, 0x97, 0xcb, 0x7f, 0x14, 0x19, 0x69, 0xa0, 0x1d, 0xa8, 0xff,
|
||||
0x36, 0x75, 0x22, 0xc7, 0x67, 0xae, 0x4f, 0x2e, 0x04, 0x9b, 0x1a, 0x4e, 0x43, 0xe8, 0x23, 0x80,
|
||||
0xd0, 0xb9, 0x24, 0x36, 0x0b, 0xde, 0x10, 0x5f, 0xd0, 0x69, 0x70, 0x25, 0x97, 0xc4, 0xe2, 0x00,
|
||||
0xda, 0x02, 0x61, 0xd8, 0xd4, 0xbd, 0x21, 0xed, 0x92, 0x58, 0xba, 0xc6, 0x81, 0xa1, 0x7b, 0x43,
|
||||
0xd0, 0x36, 0xd4, 0x23, 0x12, 0x3a, 0x6e, 0x64, 0xb3, 0x20, 0xf0, 0xda, 0x65, 0xb1, 0x3a, 0x48,
|
||||
0xc8, 0x0a, 0x02, 0xcf, 0xf8, 0x5b, 0x83, 0x8a, 0x24, 0x89, 0x3e, 0x81, 0xc6, 0x4c, 0xfc, 0xd9,
|
||||
0x69, 0x9a, 0xf5, 0x59, 0x4a, 0xc2, 0x36, 0x28, 0xd3, 0x66, 0xf3, 0x90, 0xa8, 0x4c, 0x80, 0x84,
|
||||
0xac, 0x79, 0x98, 0x5e, 0x83, 0x32, 0x87, 0x11, 0x15, 0x3c, 0x35, 0x69, 0xc8, 0xa1, 0xe5, 0xbc,
|
||||
0x94, 0xb2, 0x79, 0xd9, 0x86, 0xba, 0x4f, 0xae, 0x99, 0x1d, 0x8c, 0x46, 0x94, 0x30, 0x41, 0xb8,
|
||||
0x84, 0x81, 0x43, 0x7d, 0x81, 0x18, 0x7f, 0x68, 0xf0, 0xe8, 0x88, 0xb0, 0x5e, 0x82, 0x88, 0x64,
|
||||
0xff, 0x4f, 0xdc, 0x33, 0xe1, 0x2c, 0xe5, 0xc2, 0x39, 0x87, 0x35, 0x5e, 0x86, 0x32, 0xa2, 0xf4,
|
||||
0x1e, 0x75, 0xf8, 0x39, 0x94, 0x12, 0x3a, 0xad, 0x67, 0x8f, 0xf7, 0xd4, 0x31, 0xdb, 0x3b, 0x4d,
|
||||
0x78, 0x61, 0xe1, 0x90, 0xdd, 0xba, 0x98, 0xdb, 0xfa, 0x1b, 0xa8, 0xaa, 0x6d, 0xd1, 0x17, 0x50,
|
||||
0x95, 0xac, 0xa9, 0xa8, 0xc8, 0xfa, 0xb3, 0xb5, 0xcc, 0xba, 0x38, 0x1e, 0x37, 0x76, 0x41, 0x97,
|
||||
0xd0, 0x22, 0xa0, 0xfc, 0x6c, 0xa8, 0xf0, 0x6b, 0x22, 0xfc, 0xca, 0x32, 0xfe, 0xd1, 0xa0, 0xd9,
|
||||
0x23, 0x57, 0x71, 0x4d, 0xbf, 0x3b, 0x6d, 0xd9, 0xec, 0x15, 0xf3, 0xd9, 0x5b, 0x70, 0x2a, 0xa5,
|
||||
0x39, 0xa1, 0x5d, 0x28, 0xcb, 0x6c, 0x95, 0xc5, 0x26, 0xeb, 0x99, 0x4d, 0x44, 0xda, 0xb0, 0x74,
|
||||
0xc9, 0x86, 0xb0, 0x92, 0x0b, 0xe1, 0xef, 0x1a, 0xb4, 0x12, 0x81, 0x32, 0xe3, 0xf7, 0x28, 0xac,
|
||||
0x84, 0x42, 0xe1, 0xad, 0x29, 0xe4, 0xb3, 0xa8, 0xa7, 0x18, 0x60, 0x12, 0x7a, 0x73, 0x8e, 0x1c,
|
||||
0x12, 0xaf, 0x7f, 0xfe, 0x2b, 0xf9, 0x85, 0x49, 0xa4, 0x09, 0x75, 0x4c, 0x7c, 0x27, 0x76, 0xf8,
|
||||
0x53, 0xa6, 0x45, 0x7a, 0x88, 0xb4, 0x20, 0x28, 0xf1, 0x61, 0x41, 0xb6, 0x81, 0xc5, 0x7f, 0x4e,
|
||||
0x48, 0xe1, 0xb6, 0x18, 0x17, 0x97, 0x62, 0x9c, 0x39, 0x93, 0xa5, 0xec, 0x99, 0xbc, 0xfb, 0x96,
|
||||
0x91, 0xaa, 0xd2, 0x1a, 0xbe, 0x84, 0xf7, 0x7e, 0x5c, 0xdc, 0x71, 0x72, 0xa4, 0xc7, 0x79, 0xae,
|
||||
0xe0, 0x6e, 0xdc, 0xc0, 0xc6, 0x4a, 0x67, 0x8a, 0xf6, 0xa1, 0x1a, 0x08, 0x33, 0xae, 0xf4, 0x8f,
|
||||
0x93, 0xe8, 0xaf, 0x9c, 0x81, 0x63, 0x77, 0xf4, 0x19, 0xac, 0x09, 0x51, 0xa9, 0xab, 0x55, 0xbe,
|
||||
0x04, 0x4d, 0x0e, 0x0f, 0xe2, 0xeb, 0xd5, 0xe8, 0x00, 0xdc, 0xce, 0x2e, 0xab, 0xbe, 0x90, 0x53,
|
||||
0xef, 0x41, 0xab, 0x1b, 0x38, 0x17, 0x77, 0x24, 0xe8, 0x09, 0xb4, 0x5c, 0x6a, 0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, 0x58, 0xc7, 0xfd, 0x9e, 0x3d, 0xc4, 0x07, 0xba, 0x86,
|
||||
0xb6, 0xe0, 0xfd, 0xdc, 0x88, 0xd5, 0xc1, 0x47, 0xa6, 0xa5, 0x17, 0xce, 0x2b, 0xa2, 0xf1, 0xfe,
|
||||
0xfa, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6e, 0x9b, 0x48, 0x2a, 0x86, 0x0b, 0x00, 0x00,
|
||||
// 1037 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x56, 0xdd, 0x72, 0xdb, 0x44,
|
||||
0x14, 0x46, 0xb6, 0xfc, 0x93, 0xe3, 0x9f, 0xb8, 0xdb, 0x10, 0x4c, 0x02, 0xb4, 0x88, 0x01, 0x4a,
|
||||
0x98, 0xc9, 0x0c, 0xa5, 0x17, 0x01, 0xae, 0x5c, 0xc7, 0x0d, 0x19, 0x12, 0xdb, 0xac, 0xd5, 0xb4,
|
||||
0xcc, 0x30, 0xa3, 0x51, 0xc8, 0x3a, 0x11, 0x55, 0x24, 0x21, 0xad, 0xdd, 0xb8, 0x57, 0xbc, 0x07,
|
||||
0x37, 0x0c, 0xaf, 0xc2, 0x7b, 0xf0, 0x2c, 0xec, 0x9f, 0x64, 0x59, 0x72, 0x63, 0x67, 0xa6, 0x37,
|
||||
0x9e, 0x3d, 0xdf, 0x1e, 0x9d, 0xfd, 0xbe, 0x73, 0x8e, 0x77, 0x0f, 0xc0, 0xf8, 0xfa, 0x32, 0xdc,
|
||||
0x0f, 0x42, 0x9f, 0xfa, 0xa8, 0x32, 0x76, 0x5c, 0xc2, 0x4c, 0xe3, 0x07, 0x40, 0x27, 0x4e, 0x44,
|
||||
0x87, 0x76, 0x48, 0x1d, 0xea, 0xf8, 0x5e, 0x74, 0xec, 0x8d, 0x7d, 0xf4, 0x39, 0x34, 0x83, 0x18,
|
||||
0xb1, 0xce, 0x1d, 0x1a, 0xb5, 0xb5, 0x87, 0xda, 0xa3, 0x06, 0x6e, 0x24, 0xe8, 0x53, 0x06, 0x1a,
|
||||
0x2f, 0xe1, 0xde, 0xc2, 0xc7, 0xe2, 0xdb, 0x8f, 0x60, 0x23, 0xf1, 0x52, 0x9f, 0xcd, 0x81, 0x25,
|
||||
0x91, 0x0b, 0xcb, 0x22, 0x5f, 0x43, 0x93, 0x47, 0x1e, 0x4d, 0xc6, 0x63, 0xe7, 0x66, 0x8d, 0xb0,
|
||||
0xdb, 0x50, 0x8e, 0x84, 0xaf, 0x08, 0x57, 0xc7, 0xca, 0x5a, 0x72, 0x5c, 0x71, 0xd9, 0x71, 0x06,
|
||||
0xc0, 0xa1, 0x13, 0xf6, 0x3c, 0x1a, 0x3a, 0x24, 0x42, 0x5b, 0x50, 0x22, 0x6c, 0x39, 0x63, 0xc7,
|
||||
0x14, 0x1f, 0x6d, 0x60, 0x69, 0x18, 0xff, 0x68, 0x50, 0x3b, 0xf3, 0xdd, 0xc9, 0x35, 0x39, 0xf6,
|
||||
0x2e, 0xc8, 0x0d, 0xf7, 0x72, 0xf8, 0x42, 0x91, 0x91, 0x06, 0x7a, 0x08, 0xb5, 0x3f, 0x26, 0x76,
|
||||
0x68, 0x7b, 0xd4, 0xf1, 0xc8, 0x85, 0x60, 0x53, 0xc5, 0x69, 0x08, 0x7d, 0x0c, 0x10, 0xd8, 0x97,
|
||||
0xc4, 0xa2, 0xfe, 0x2b, 0xe2, 0x09, 0x3a, 0x75, 0xae, 0xe4, 0x92, 0x98, 0x1c, 0x40, 0xbb, 0x20,
|
||||
0x0c, 0x2b, 0x72, 0xde, 0x90, 0xb6, 0x2e, 0x42, 0x57, 0x39, 0x30, 0x62, 0x36, 0x7a, 0x00, 0xb5,
|
||||
0x90, 0x04, 0xb6, 0x13, 0xb2, 0xaf, 0x7d, 0xb7, 0x5d, 0x12, 0xd1, 0x41, 0x42, 0x26, 0x43, 0x8c,
|
||||
0x7f, 0x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0xff,
|
||||
0x40, 0x34, 0x9c, 0x28, 0x25, 0x65, 0x75, 0xae, 0x7f, 0x05, 0x90, 0xdd, 0xf1, 0xd6, 0x93, 0x3e,
|
||||
0x84, 0xaa, 0x47, 0x5e, 0x5b, 0x02, 0x97, 0x9a, 0x2b, 0xcc, 0xee, 0x2f, 0xd1, 0x92, 0xef, 0xcf,
|
||||
0x17, 0x50, 0x96, 0x3a, 0xde, 0x71, 0x93, 0x19, 0x57, 0x70, 0x7f, 0x9e, 0xa4, 0x08, 0x93, 0x28,
|
||||
0x60, 0x03, 0x07, 0xe1, 0x57, 0xd9, 0x62, 0x81, 0xe7, 0x57, 0x99, 0x6a, 0xa7, 0x3b, 0x57, 0xf4,
|
||||
0x08, 0xea, 0xf2, 0xd3, 0x61, 0x48, 0xf8, 0x1c, 0xc0, 0x18, 0x05, 0x62, 0xa5, 0xa4, 0x28, 0x6b,
|
||||
0x75, 0x5d, 0x2b, 0x50, 0xea, 0x5d, 0x07, 0x74, 0x66, 0x34, 0xa1, 0xce, 0x9e, 0x24, 0xfe, 0x47,
|
||||
0x17, 0x57, 0xbe, 0x71, 0x0a, 0xad, 0x64, 0xee, 0xe9, 0xfa, 0x1e, 0x65, 0x43, 0x02, 0xfa, 0x0e,
|
||||
0xea, 0x9c, 0xb8, 0x45, 0xe4, 0x20, 0xa1, 0xd4, 0x6c, 0x27, 0x6a, 0x9e, 0x4d, 0x5c, 0x77, 0x68,
|
||||
0xd3, 0x2b, 0x3e, 0x68, 0xcc, 0x70, 0x8d, 0xc3, 0x6a, 0xe6, 0x30, 0x7e, 0x81, 0xc6, 0xc2, 0x6e,
|
||||
0x6a, 0xa2, 0xd1, 0x16, 0x26, 0x1a, 0x36, 0x76, 0xf8, 0x57, 0x76, 0x74, 0xa5, 0x74, 0x4b, 0x03,
|
||||
0xed, 0x40, 0x95, 0x47, 0x13, 0xc5, 0x92, 0x23, 0x45, 0x62, 0x1b, 0x9f, 0x41, 0xe5, 0xa7, 0xa9,
|
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, 0xc2, 0xed,
|
||||
0xc2, 0x07, 0xb9, 0x1d, 0xb3, 0x83, 0x8f, 0x7a, 0x2c, 0xe6, 0x79, 0x59, 0x4c, 0xe3, 0xdf, 0xfe,
|
||||
0x1f, 0x00, 0x00, 0xff, 0xff, 0xaa, 0x45, 0x72, 0xde, 0x9b, 0x0b, 0x00, 0x00,
|
||||
}
|
||||
|
|
|
@ -274,7 +274,7 @@ func GetVolume(s *server, ctx context.Context, pbIn *[]byte) (*[]byte, error) {
|
|||
|
||||
s.statsd_c.Increment("get_volume.ok")
|
||||
|
||||
pb_volume := pb.Volume{VolumeIndex: in.Index, VolumeType: uint32(dfType), VolumeState: uint32(state),
|
||||
pb_volume := pb.Volume{VolumeIndex: in.Index, VolumeType: pb.VolumeType(dfType), VolumeState: uint32(state),
|
||||
Partition: uint32(partition), NextOffset: uint64(nextOffset)}
|
||||
out, err := proto.Marshal(&pb_volume)
|
||||
if err != nil {
|
||||
|
@ -325,7 +325,7 @@ func ListVolumes(s *server, ctx context.Context, pbIn *[]byte) (*[]byte, error)
|
|||
}
|
||||
if uint32(partition) == in.Partition && pb.VolumeType(dfType) == in.Type {
|
||||
response.Volumes = append(response.Volumes, &pb.Volume{VolumeIndex: idx,
|
||||
VolumeType: uint32(in.Type), VolumeState: uint32(state),
|
||||
VolumeType: pb.VolumeType(in.Type), VolumeState: uint32(state),
|
||||
Partition: uint32(partition), NextOffset: uint64(nextOffset)})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ message VolumeIndex {
|
|||
|
||||
message Volume {
|
||||
uint32 volume_index = 1;
|
||||
uint32 volume_type = 2;
|
||||
VolumeType volume_type = 2;
|
||||
uint32 volume_state = 3;
|
||||
uint32 partition = 4;
|
||||
uint64 next_offset = 5;
|
||||
|
|
|
@ -21,7 +21,7 @@ DESCRIPTOR = _descriptor.FileDescriptor(
|
|||
package='filemgr',
|
||||
syntax='proto3',
|
||||
serialized_options=None,
|
||||
serialized_pb=_b('\n\nfmgr.proto\x12\x07\x66ilemgr\",\n\x12ListPartitionsInfo\x12\x16\n\x0epartition_bits\x18\x01 \x01(\r\">\n\x11ListPartitionInfo\x12\x11\n\tpartition\x18\x01 \x01(\r\x12\x16\n\x0epartition_bits\x18\x02 \x01(\r\"K\n\x0eListSuffixInfo\x12\x11\n\tpartition\x18\x01 \x01(\r\x12\x0e\n\x06suffix\x18\x02 \x01(\x0c\x12\x16\n\x0epartition_bits\x18\x03 \x01(\r\"\x1b\n\nDirEntries\x12\r\n\x05\x65ntry\x18\x01 \x03(\t\"m\n\x0bVolumeIndex\x12\r\n\x05index\x18\x01 \x01(\r\x12\x13\n\x0bquarantined\x18\x02 \x01(\x08\x12\x12\n\npage_token\x18\x03 \x01(\x0c\x12\x11\n\tpage_size\x18\x04 \x01(\r\x12\x13\n\x0brepair_tool\x18\x05 \x01(\x08\"q\n\x06Volume\x12\x14\n\x0cvolume_index\x18\x01 \x01(\r\x12\x13\n\x0bvolume_type\x18\x02 \x01(\r\x12\x14\n\x0cvolume_state\x18\x03 \x01(\r\x12\x11\n\tpartition\x18\x04 \x01(\r\x12\x13\n\x0bnext_offset\x18\x05 \x01(\x04\"i\n\x11GetNextOffsetInfo\x12\x14\n\x0cvolume_index\x18\x01 \x01(\r\x12\x13\n\x0bvolume_type\x18\x02 \x01(\r\x12\x14\n\x0cvolume_state\x18\x03 \x01(\r\x12\x13\n\x0brepair_tool\x18\x04 \x01(\x08\"\\\n\x0fListVolumesInfo\x12\x11\n\tpartition\x18\x01 \x01(\r\x12!\n\x04type\x18\x02 \x01(\x0e\x32\x13.filemgr.VolumeType\x12\x13\n\x0brepair_tool\x18\x03 \x01(\x08\"+\n\x07Volumes\x12 \n\x07volumes\x18\x01 \x03(\x0b\x32\x0f.filemgr.Volume\"\"\n\x10VolumeNextOffset\x12\x0e\n\x06offset\x18\x01 \x01(\x04\"\xa5\x01\n\rNewVolumeInfo\x12\x11\n\tpartition\x18\x01 \x01(\r\x12!\n\x04type\x18\x02 \x01(\x0e\x32\x13.filemgr.VolumeType\x12\x14\n\x0cvolume_index\x18\x03 \x01(\r\x12\x0e\n\x06offset\x18\x04 \x01(\x04\x12#\n\x05state\x18\x05 \x01(\x0e\x32\x14.filemgr.VolumeState\x12\x13\n\x0brepair_tool\x18\x06 \x01(\x08\"`\n\x0eNewVolumeState\x12\x14\n\x0cvolume_index\x18\x01 \x01(\r\x12#\n\x05state\x18\x02 \x01(\x0e\x32\x14.filemgr.VolumeState\x12\x13\n\x0brepair_tool\x18\x03 \x01(\x08\"\x10\n\x0eNewVolumeReply\"\x10\n\x0e\x44\x65lObjectReply\"\r\n\x0bRenameReply\"m\n\rNewObjectInfo\x12\x0c\n\x04name\x18\x01 \x01(\x0c\x12\x14\n\x0cvolume_index\x18\x02 \x01(\r\x12\x0e\n\x06offset\x18\x03 \x01(\x04\x12\x13\n\x0bnext_offset\x18\x04 \x01(\x04\x12\x13\n\x0brepair_tool\x18\x05 \x01(\x08\"\x10\n\x0eNewObjectReply\"%\n\x15QuarantinedObjectName\x12\x0c\n\x04name\x18\x01 \x01(\x0c\"b\n\x16QuarantinedObjectNames\x12/\n\x07objects\x18\x01 \x03(\x0b\x32\x1e.filemgr.QuarantinedObjectName\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\x0c\"/\n\nObjectName\x12\x0c\n\x04name\x18\x01 \x01(\x0c\x12\x13\n\x0brepair_tool\x18\x02 \x01(\x08\"K\n\x0eLoadObjectInfo\x12\x0c\n\x04name\x18\x01 \x01(\x0c\x12\x16\n\x0eis_quarantined\x18\x02 \x01(\x08\x12\x13\n\x0brepair_tool\x18\x05 \x01(\x08\"A\n\nRenameInfo\x12\x0c\n\x04name\x18\x01 \x01(\x0c\x12\x10\n\x08new_name\x18\x02 \x01(\x0c\x12\x13\n\x0brepair_tool\x18\x03 \x01(\x08\"<\n\x06Object\x12\x0c\n\x04name\x18\x01 \x01(\x0c\x12\x14\n\x0cvolume_index\x18\x02 \x01(\r\x12\x0e\n\x06offset\x18\x03 \x01(\x04\"P\n\x13LoadObjectsResponse\x12 \n\x07objects\x18\x01 \x03(\x0b\x32\x0f.filemgr.Object\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\x0c\"3\n\x0cObjectPrefix\x12\x0e\n\x06prefix\x18\x01 \x01(\x0c\x12\x13\n\x0brepair_tool\x18\x02 \x01(\x08\"\x07\n\x05\x45mpty\"\x0e\n\x0cGetStatsInfo\"@\n\x10PartitionContent\x12,\n\x0c\x66ile_entries\x18\x01 \x03(\x0b\x32\x16.filemgr.FullPathEntry\"@\n\rFullPathEntry\x12\x0e\n\x06suffix\x18\x01 \x01(\x0c\x12\r\n\x05ohash\x18\x02 \x01(\x0c\x12\x10\n\x08\x66ilename\x18\x03 \x01(\x0c\"\x1a\n\x07KvState\x12\x0f\n\x07isClean\x18\x01 \x01(\x08\"c\n\x07KVStats\x12*\n\x05stats\x18\x01 \x03(\x0b\x32\x1b.filemgr.KVStats.StatsEntry\x1a,\n\nStatsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x04:\x02\x38\x01\"C\n\x1aListQuarantinedOHashesInfo\x12\x12\n\npage_token\x18\x01 \x01(\x0c\x12\x11\n\tpage_size\x18\x02 \x01(\r*N\n\nVolumeType\x12\x12\n\x0eVOLUME_DEFAULT\x10\x00\x12\x14\n\x10VOLUME_TOMBSTONE\x10\x01\x12\x16\n\x12VOLUME_X_DELETE_AT\x10\x02*R\n\x0bVolumeState\x12\x0c\n\x08STATE_RW\x10\x00\x12\x18\n\x14STATE_COMPACTION_SRC\x10\x01\x12\x1b\n\x17STATE_COMPACTION_TARGET\x10\x02\x62\x06proto3')
|
||||
serialized_pb=_b('\n\nfmgr.proto\x12\x07\x66ilemgr\",\n\x12ListPartitionsInfo\x12\x16\n\x0epartition_bits\x18\x01 \x01(\r\">\n\x11ListPartitionInfo\x12\x11\n\tpartition\x18\x01 \x01(\r\x12\x16\n\x0epartition_bits\x18\x02 \x01(\r\"K\n\x0eListSuffixInfo\x12\x11\n\tpartition\x18\x01 \x01(\r\x12\x0e\n\x06suffix\x18\x02 \x01(\x0c\x12\x16\n\x0epartition_bits\x18\x03 \x01(\r\"\x1b\n\nDirEntries\x12\r\n\x05\x65ntry\x18\x01 \x03(\t\"m\n\x0bVolumeIndex\x12\r\n\x05index\x18\x01 \x01(\r\x12\x13\n\x0bquarantined\x18\x02 \x01(\x08\x12\x12\n\npage_token\x18\x03 \x01(\x0c\x12\x11\n\tpage_size\x18\x04 \x01(\r\x12\x13\n\x0brepair_tool\x18\x05 \x01(\x08\"\x86\x01\n\x06Volume\x12\x14\n\x0cvolume_index\x18\x01 \x01(\r\x12(\n\x0bvolume_type\x18\x02 \x01(\x0e\x32\x13.filemgr.VolumeType\x12\x14\n\x0cvolume_state\x18\x03 \x01(\r\x12\x11\n\tpartition\x18\x04 \x01(\r\x12\x13\n\x0bnext_offset\x18\x05 \x01(\x04\"i\n\x11GetNextOffsetInfo\x12\x14\n\x0cvolume_index\x18\x01 \x01(\r\x12\x13\n\x0bvolume_type\x18\x02 \x01(\r\x12\x14\n\x0cvolume_state\x18\x03 \x01(\r\x12\x13\n\x0brepair_tool\x18\x04 \x01(\x08\"\\\n\x0fListVolumesInfo\x12\x11\n\tpartition\x18\x01 \x01(\r\x12!\n\x04type\x18\x02 \x01(\x0e\x32\x13.filemgr.VolumeType\x12\x13\n\x0brepair_tool\x18\x03 \x01(\x08\"+\n\x07Volumes\x12 \n\x07volumes\x18\x01 \x03(\x0b\x32\x0f.filemgr.Volume\"\"\n\x10VolumeNextOffset\x12\x0e\n\x06offset\x18\x01 \x01(\x04\"\xa5\x01\n\rNewVolumeInfo\x12\x11\n\tpartition\x18\x01 \x01(\r\x12!\n\x04type\x18\x02 \x01(\x0e\x32\x13.filemgr.VolumeType\x12\x14\n\x0cvolume_index\x18\x03 \x01(\r\x12\x0e\n\x06offset\x18\x04 \x01(\x04\x12#\n\x05state\x18\x05 \x01(\x0e\x32\x14.filemgr.VolumeState\x12\x13\n\x0brepair_tool\x18\x06 \x01(\x08\"`\n\x0eNewVolumeState\x12\x14\n\x0cvolume_index\x18\x01 \x01(\r\x12#\n\x05state\x18\x02 \x01(\x0e\x32\x14.filemgr.VolumeState\x12\x13\n\x0brepair_tool\x18\x03 \x01(\x08\"\x10\n\x0eNewVolumeReply\"\x10\n\x0e\x44\x65lObjectReply\"\r\n\x0bRenameReply\"m\n\rNewObjectInfo\x12\x0c\n\x04name\x18\x01 \x01(\x0c\x12\x14\n\x0cvolume_index\x18\x02 \x01(\r\x12\x0e\n\x06offset\x18\x03 \x01(\x04\x12\x13\n\x0bnext_offset\x18\x04 \x01(\x04\x12\x13\n\x0brepair_tool\x18\x05 \x01(\x08\"\x10\n\x0eNewObjectReply\"%\n\x15QuarantinedObjectName\x12\x0c\n\x04name\x18\x01 \x01(\x0c\"b\n\x16QuarantinedObjectNames\x12/\n\x07objects\x18\x01 \x03(\x0b\x32\x1e.filemgr.QuarantinedObjectName\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\x0c\"/\n\nObjectName\x12\x0c\n\x04name\x18\x01 \x01(\x0c\x12\x13\n\x0brepair_tool\x18\x02 \x01(\x08\"K\n\x0eLoadObjectInfo\x12\x0c\n\x04name\x18\x01 \x01(\x0c\x12\x16\n\x0eis_quarantined\x18\x02 \x01(\x08\x12\x13\n\x0brepair_tool\x18\x05 \x01(\x08\"A\n\nRenameInfo\x12\x0c\n\x04name\x18\x01 \x01(\x0c\x12\x10\n\x08new_name\x18\x02 \x01(\x0c\x12\x13\n\x0brepair_tool\x18\x03 \x01(\x08\"<\n\x06Object\x12\x0c\n\x04name\x18\x01 \x01(\x0c\x12\x14\n\x0cvolume_index\x18\x02 \x01(\r\x12\x0e\n\x06offset\x18\x03 \x01(\x04\"P\n\x13LoadObjectsResponse\x12 \n\x07objects\x18\x01 \x03(\x0b\x32\x0f.filemgr.Object\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\x0c\"3\n\x0cObjectPrefix\x12\x0e\n\x06prefix\x18\x01 \x01(\x0c\x12\x13\n\x0brepair_tool\x18\x02 \x01(\x08\"\x07\n\x05\x45mpty\"\x0e\n\x0cGetStatsInfo\"@\n\x10PartitionContent\x12,\n\x0c\x66ile_entries\x18\x01 \x03(\x0b\x32\x16.filemgr.FullPathEntry\"@\n\rFullPathEntry\x12\x0e\n\x06suffix\x18\x01 \x01(\x0c\x12\r\n\x05ohash\x18\x02 \x01(\x0c\x12\x10\n\x08\x66ilename\x18\x03 \x01(\x0c\"\x1a\n\x07KvState\x12\x0f\n\x07isClean\x18\x01 \x01(\x08\"c\n\x07KVStats\x12*\n\x05stats\x18\x01 \x03(\x0b\x32\x1b.filemgr.KVStats.StatsEntry\x1a,\n\nStatsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x04:\x02\x38\x01\"C\n\x1aListQuarantinedOHashesInfo\x12\x12\n\npage_token\x18\x01 \x01(\x0c\x12\x11\n\tpage_size\x18\x02 \x01(\r*N\n\nVolumeType\x12\x12\n\x0eVOLUME_DEFAULT\x10\x00\x12\x14\n\x10VOLUME_TOMBSTONE\x10\x01\x12\x16\n\x12VOLUME_X_DELETE_AT\x10\x02*R\n\x0bVolumeState\x12\x0c\n\x08STATE_RW\x10\x00\x12\x18\n\x14STATE_COMPACTION_SRC\x10\x01\x12\x1b\n\x17STATE_COMPACTION_TARGET\x10\x02\x62\x06proto3')
|
||||
)
|
||||
|
||||
_VOLUMETYPE = _descriptor.EnumDescriptor(
|
||||
|
@ -45,8 +45,8 @@ _VOLUMETYPE = _descriptor.EnumDescriptor(
|
|||
],
|
||||
containing_type=None,
|
||||
serialized_options=None,
|
||||
serialized_start=2077,
|
||||
serialized_end=2155,
|
||||
serialized_start=2099,
|
||||
serialized_end=2177,
|
||||
)
|
||||
_sym_db.RegisterEnumDescriptor(_VOLUMETYPE)
|
||||
|
||||
|
@ -72,8 +72,8 @@ _VOLUMESTATE = _descriptor.EnumDescriptor(
|
|||
],
|
||||
containing_type=None,
|
||||
serialized_options=None,
|
||||
serialized_start=2157,
|
||||
serialized_end=2239,
|
||||
serialized_start=2179,
|
||||
serialized_end=2261,
|
||||
)
|
||||
_sym_db.RegisterEnumDescriptor(_VOLUMESTATE)
|
||||
|
||||
|
@ -307,7 +307,7 @@ _VOLUME = _descriptor.Descriptor(
|
|||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='volume_type', full_name='filemgr.Volume.volume_type', index=1,
|
||||
number=2, type=13, cpp_type=3, label=1,
|
||||
number=2, type=14, cpp_type=8, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
|
@ -345,8 +345,8 @@ _VOLUME = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=350,
|
||||
serialized_end=463,
|
||||
serialized_start=351,
|
||||
serialized_end=485,
|
||||
)
|
||||
|
||||
|
||||
|
@ -397,8 +397,8 @@ _GETNEXTOFFSETINFO = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=465,
|
||||
serialized_end=570,
|
||||
serialized_start=487,
|
||||
serialized_end=592,
|
||||
)
|
||||
|
||||
|
||||
|
@ -442,8 +442,8 @@ _LISTVOLUMESINFO = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=572,
|
||||
serialized_end=664,
|
||||
serialized_start=594,
|
||||
serialized_end=686,
|
||||
)
|
||||
|
||||
|
||||
|
@ -473,8 +473,8 @@ _VOLUMES = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=666,
|
||||
serialized_end=709,
|
||||
serialized_start=688,
|
||||
serialized_end=731,
|
||||
)
|
||||
|
||||
|
||||
|
@ -504,8 +504,8 @@ _VOLUMENEXTOFFSET = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=711,
|
||||
serialized_end=745,
|
||||
serialized_start=733,
|
||||
serialized_end=767,
|
||||
)
|
||||
|
||||
|
||||
|
@ -570,8 +570,8 @@ _NEWVOLUMEINFO = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=748,
|
||||
serialized_end=913,
|
||||
serialized_start=770,
|
||||
serialized_end=935,
|
||||
)
|
||||
|
||||
|
||||
|
@ -615,8 +615,8 @@ _NEWVOLUMESTATE = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=915,
|
||||
serialized_end=1011,
|
||||
serialized_start=937,
|
||||
serialized_end=1033,
|
||||
)
|
||||
|
||||
|
||||
|
@ -639,8 +639,8 @@ _NEWVOLUMEREPLY = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=1013,
|
||||
serialized_end=1029,
|
||||
serialized_start=1035,
|
||||
serialized_end=1051,
|
||||
)
|
||||
|
||||
|
||||
|
@ -663,8 +663,8 @@ _DELOBJECTREPLY = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=1031,
|
||||
serialized_end=1047,
|
||||
serialized_start=1053,
|
||||
serialized_end=1069,
|
||||
)
|
||||
|
||||
|
||||
|
@ -687,8 +687,8 @@ _RENAMEREPLY = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=1049,
|
||||
serialized_end=1062,
|
||||
serialized_start=1071,
|
||||
serialized_end=1084,
|
||||
)
|
||||
|
||||
|
||||
|
@ -746,8 +746,8 @@ _NEWOBJECTINFO = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=1064,
|
||||
serialized_end=1173,
|
||||
serialized_start=1086,
|
||||
serialized_end=1195,
|
||||
)
|
||||
|
||||
|
||||
|
@ -770,8 +770,8 @@ _NEWOBJECTREPLY = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=1175,
|
||||
serialized_end=1191,
|
||||
serialized_start=1197,
|
||||
serialized_end=1213,
|
||||
)
|
||||
|
||||
|
||||
|
@ -801,8 +801,8 @@ _QUARANTINEDOBJECTNAME = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=1193,
|
||||
serialized_end=1230,
|
||||
serialized_start=1215,
|
||||
serialized_end=1252,
|
||||
)
|
||||
|
||||
|
||||
|
@ -839,8 +839,8 @@ _QUARANTINEDOBJECTNAMES = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=1232,
|
||||
serialized_end=1330,
|
||||
serialized_start=1254,
|
||||
serialized_end=1352,
|
||||
)
|
||||
|
||||
|
||||
|
@ -877,8 +877,8 @@ _OBJECTNAME = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=1332,
|
||||
serialized_end=1379,
|
||||
serialized_start=1354,
|
||||
serialized_end=1401,
|
||||
)
|
||||
|
||||
|
||||
|
@ -922,8 +922,8 @@ _LOADOBJECTINFO = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=1381,
|
||||
serialized_end=1456,
|
||||
serialized_start=1403,
|
||||
serialized_end=1478,
|
||||
)
|
||||
|
||||
|
||||
|
@ -967,8 +967,8 @@ _RENAMEINFO = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=1458,
|
||||
serialized_end=1523,
|
||||
serialized_start=1480,
|
||||
serialized_end=1545,
|
||||
)
|
||||
|
||||
|
||||
|
@ -1012,8 +1012,8 @@ _OBJECT = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=1525,
|
||||
serialized_end=1585,
|
||||
serialized_start=1547,
|
||||
serialized_end=1607,
|
||||
)
|
||||
|
||||
|
||||
|
@ -1050,8 +1050,8 @@ _LOADOBJECTSRESPONSE = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=1587,
|
||||
serialized_end=1667,
|
||||
serialized_start=1609,
|
||||
serialized_end=1689,
|
||||
)
|
||||
|
||||
|
||||
|
@ -1088,8 +1088,8 @@ _OBJECTPREFIX = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=1669,
|
||||
serialized_end=1720,
|
||||
serialized_start=1691,
|
||||
serialized_end=1742,
|
||||
)
|
||||
|
||||
|
||||
|
@ -1112,8 +1112,8 @@ _EMPTY = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=1722,
|
||||
serialized_end=1729,
|
||||
serialized_start=1744,
|
||||
serialized_end=1751,
|
||||
)
|
||||
|
||||
|
||||
|
@ -1136,8 +1136,8 @@ _GETSTATSINFO = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=1731,
|
||||
serialized_end=1745,
|
||||
serialized_start=1753,
|
||||
serialized_end=1767,
|
||||
)
|
||||
|
||||
|
||||
|
@ -1167,8 +1167,8 @@ _PARTITIONCONTENT = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=1747,
|
||||
serialized_end=1811,
|
||||
serialized_start=1769,
|
||||
serialized_end=1833,
|
||||
)
|
||||
|
||||
|
||||
|
@ -1212,8 +1212,8 @@ _FULLPATHENTRY = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=1813,
|
||||
serialized_end=1877,
|
||||
serialized_start=1835,
|
||||
serialized_end=1899,
|
||||
)
|
||||
|
||||
|
||||
|
@ -1243,8 +1243,8 @@ _KVSTATE = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=1879,
|
||||
serialized_end=1905,
|
||||
serialized_start=1901,
|
||||
serialized_end=1927,
|
||||
)
|
||||
|
||||
|
||||
|
@ -1281,8 +1281,8 @@ _KVSTATS_STATSENTRY = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=1962,
|
||||
serialized_end=2006,
|
||||
serialized_start=1984,
|
||||
serialized_end=2028,
|
||||
)
|
||||
|
||||
_KVSTATS = _descriptor.Descriptor(
|
||||
|
@ -1311,8 +1311,8 @@ _KVSTATS = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=1907,
|
||||
serialized_end=2006,
|
||||
serialized_start=1929,
|
||||
serialized_end=2028,
|
||||
)
|
||||
|
||||
|
||||
|
@ -1349,10 +1349,11 @@ _LISTQUARANTINEDOHASHESINFO = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=2008,
|
||||
serialized_end=2075,
|
||||
serialized_start=2030,
|
||||
serialized_end=2097,
|
||||
)
|
||||
|
||||
_VOLUME.fields_by_name['volume_type'].enum_type = _VOLUMETYPE
|
||||
_LISTVOLUMESINFO.fields_by_name['type'].enum_type = _VOLUMETYPE
|
||||
_VOLUMES.fields_by_name['volumes'].message_type = _VOLUME
|
||||
_NEWVOLUMEINFO.fields_by_name['type'].enum_type = _VOLUMETYPE
|
||||
|
@ -1399,236 +1400,236 @@ DESCRIPTOR.enum_types_by_name['VolumeType'] = _VOLUMETYPE
|
|||
DESCRIPTOR.enum_types_by_name['VolumeState'] = _VOLUMESTATE
|
||||
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
|
||||
|
||||
ListPartitionsInfo = _reflection.GeneratedProtocolMessageType('ListPartitionsInfo', (_message.Message,), dict(
|
||||
DESCRIPTOR = _LISTPARTITIONSINFO,
|
||||
__module__ = 'fmgr_pb2'
|
||||
ListPartitionsInfo = _reflection.GeneratedProtocolMessageType('ListPartitionsInfo', (_message.Message,), {
|
||||
'DESCRIPTOR' : _LISTPARTITIONSINFO,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.ListPartitionsInfo)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(ListPartitionsInfo)
|
||||
|
||||
ListPartitionInfo = _reflection.GeneratedProtocolMessageType('ListPartitionInfo', (_message.Message,), dict(
|
||||
DESCRIPTOR = _LISTPARTITIONINFO,
|
||||
__module__ = 'fmgr_pb2'
|
||||
ListPartitionInfo = _reflection.GeneratedProtocolMessageType('ListPartitionInfo', (_message.Message,), {
|
||||
'DESCRIPTOR' : _LISTPARTITIONINFO,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.ListPartitionInfo)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(ListPartitionInfo)
|
||||
|
||||
ListSuffixInfo = _reflection.GeneratedProtocolMessageType('ListSuffixInfo', (_message.Message,), dict(
|
||||
DESCRIPTOR = _LISTSUFFIXINFO,
|
||||
__module__ = 'fmgr_pb2'
|
||||
ListSuffixInfo = _reflection.GeneratedProtocolMessageType('ListSuffixInfo', (_message.Message,), {
|
||||
'DESCRIPTOR' : _LISTSUFFIXINFO,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.ListSuffixInfo)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(ListSuffixInfo)
|
||||
|
||||
DirEntries = _reflection.GeneratedProtocolMessageType('DirEntries', (_message.Message,), dict(
|
||||
DESCRIPTOR = _DIRENTRIES,
|
||||
__module__ = 'fmgr_pb2'
|
||||
DirEntries = _reflection.GeneratedProtocolMessageType('DirEntries', (_message.Message,), {
|
||||
'DESCRIPTOR' : _DIRENTRIES,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.DirEntries)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(DirEntries)
|
||||
|
||||
VolumeIndex = _reflection.GeneratedProtocolMessageType('VolumeIndex', (_message.Message,), dict(
|
||||
DESCRIPTOR = _VOLUMEINDEX,
|
||||
__module__ = 'fmgr_pb2'
|
||||
VolumeIndex = _reflection.GeneratedProtocolMessageType('VolumeIndex', (_message.Message,), {
|
||||
'DESCRIPTOR' : _VOLUMEINDEX,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.VolumeIndex)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(VolumeIndex)
|
||||
|
||||
Volume = _reflection.GeneratedProtocolMessageType('Volume', (_message.Message,), dict(
|
||||
DESCRIPTOR = _VOLUME,
|
||||
__module__ = 'fmgr_pb2'
|
||||
Volume = _reflection.GeneratedProtocolMessageType('Volume', (_message.Message,), {
|
||||
'DESCRIPTOR' : _VOLUME,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.Volume)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(Volume)
|
||||
|
||||
GetNextOffsetInfo = _reflection.GeneratedProtocolMessageType('GetNextOffsetInfo', (_message.Message,), dict(
|
||||
DESCRIPTOR = _GETNEXTOFFSETINFO,
|
||||
__module__ = 'fmgr_pb2'
|
||||
GetNextOffsetInfo = _reflection.GeneratedProtocolMessageType('GetNextOffsetInfo', (_message.Message,), {
|
||||
'DESCRIPTOR' : _GETNEXTOFFSETINFO,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.GetNextOffsetInfo)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(GetNextOffsetInfo)
|
||||
|
||||
ListVolumesInfo = _reflection.GeneratedProtocolMessageType('ListVolumesInfo', (_message.Message,), dict(
|
||||
DESCRIPTOR = _LISTVOLUMESINFO,
|
||||
__module__ = 'fmgr_pb2'
|
||||
ListVolumesInfo = _reflection.GeneratedProtocolMessageType('ListVolumesInfo', (_message.Message,), {
|
||||
'DESCRIPTOR' : _LISTVOLUMESINFO,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.ListVolumesInfo)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(ListVolumesInfo)
|
||||
|
||||
Volumes = _reflection.GeneratedProtocolMessageType('Volumes', (_message.Message,), dict(
|
||||
DESCRIPTOR = _VOLUMES,
|
||||
__module__ = 'fmgr_pb2'
|
||||
Volumes = _reflection.GeneratedProtocolMessageType('Volumes', (_message.Message,), {
|
||||
'DESCRIPTOR' : _VOLUMES,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.Volumes)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(Volumes)
|
||||
|
||||
VolumeNextOffset = _reflection.GeneratedProtocolMessageType('VolumeNextOffset', (_message.Message,), dict(
|
||||
DESCRIPTOR = _VOLUMENEXTOFFSET,
|
||||
__module__ = 'fmgr_pb2'
|
||||
VolumeNextOffset = _reflection.GeneratedProtocolMessageType('VolumeNextOffset', (_message.Message,), {
|
||||
'DESCRIPTOR' : _VOLUMENEXTOFFSET,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.VolumeNextOffset)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(VolumeNextOffset)
|
||||
|
||||
NewVolumeInfo = _reflection.GeneratedProtocolMessageType('NewVolumeInfo', (_message.Message,), dict(
|
||||
DESCRIPTOR = _NEWVOLUMEINFO,
|
||||
__module__ = 'fmgr_pb2'
|
||||
NewVolumeInfo = _reflection.GeneratedProtocolMessageType('NewVolumeInfo', (_message.Message,), {
|
||||
'DESCRIPTOR' : _NEWVOLUMEINFO,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.NewVolumeInfo)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(NewVolumeInfo)
|
||||
|
||||
NewVolumeState = _reflection.GeneratedProtocolMessageType('NewVolumeState', (_message.Message,), dict(
|
||||
DESCRIPTOR = _NEWVOLUMESTATE,
|
||||
__module__ = 'fmgr_pb2'
|
||||
NewVolumeState = _reflection.GeneratedProtocolMessageType('NewVolumeState', (_message.Message,), {
|
||||
'DESCRIPTOR' : _NEWVOLUMESTATE,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.NewVolumeState)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(NewVolumeState)
|
||||
|
||||
NewVolumeReply = _reflection.GeneratedProtocolMessageType('NewVolumeReply', (_message.Message,), dict(
|
||||
DESCRIPTOR = _NEWVOLUMEREPLY,
|
||||
__module__ = 'fmgr_pb2'
|
||||
NewVolumeReply = _reflection.GeneratedProtocolMessageType('NewVolumeReply', (_message.Message,), {
|
||||
'DESCRIPTOR' : _NEWVOLUMEREPLY,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.NewVolumeReply)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(NewVolumeReply)
|
||||
|
||||
DelObjectReply = _reflection.GeneratedProtocolMessageType('DelObjectReply', (_message.Message,), dict(
|
||||
DESCRIPTOR = _DELOBJECTREPLY,
|
||||
__module__ = 'fmgr_pb2'
|
||||
DelObjectReply = _reflection.GeneratedProtocolMessageType('DelObjectReply', (_message.Message,), {
|
||||
'DESCRIPTOR' : _DELOBJECTREPLY,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.DelObjectReply)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(DelObjectReply)
|
||||
|
||||
RenameReply = _reflection.GeneratedProtocolMessageType('RenameReply', (_message.Message,), dict(
|
||||
DESCRIPTOR = _RENAMEREPLY,
|
||||
__module__ = 'fmgr_pb2'
|
||||
RenameReply = _reflection.GeneratedProtocolMessageType('RenameReply', (_message.Message,), {
|
||||
'DESCRIPTOR' : _RENAMEREPLY,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.RenameReply)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(RenameReply)
|
||||
|
||||
NewObjectInfo = _reflection.GeneratedProtocolMessageType('NewObjectInfo', (_message.Message,), dict(
|
||||
DESCRIPTOR = _NEWOBJECTINFO,
|
||||
__module__ = 'fmgr_pb2'
|
||||
NewObjectInfo = _reflection.GeneratedProtocolMessageType('NewObjectInfo', (_message.Message,), {
|
||||
'DESCRIPTOR' : _NEWOBJECTINFO,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.NewObjectInfo)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(NewObjectInfo)
|
||||
|
||||
NewObjectReply = _reflection.GeneratedProtocolMessageType('NewObjectReply', (_message.Message,), dict(
|
||||
DESCRIPTOR = _NEWOBJECTREPLY,
|
||||
__module__ = 'fmgr_pb2'
|
||||
NewObjectReply = _reflection.GeneratedProtocolMessageType('NewObjectReply', (_message.Message,), {
|
||||
'DESCRIPTOR' : _NEWOBJECTREPLY,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.NewObjectReply)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(NewObjectReply)
|
||||
|
||||
QuarantinedObjectName = _reflection.GeneratedProtocolMessageType('QuarantinedObjectName', (_message.Message,), dict(
|
||||
DESCRIPTOR = _QUARANTINEDOBJECTNAME,
|
||||
__module__ = 'fmgr_pb2'
|
||||
QuarantinedObjectName = _reflection.GeneratedProtocolMessageType('QuarantinedObjectName', (_message.Message,), {
|
||||
'DESCRIPTOR' : _QUARANTINEDOBJECTNAME,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.QuarantinedObjectName)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(QuarantinedObjectName)
|
||||
|
||||
QuarantinedObjectNames = _reflection.GeneratedProtocolMessageType('QuarantinedObjectNames', (_message.Message,), dict(
|
||||
DESCRIPTOR = _QUARANTINEDOBJECTNAMES,
|
||||
__module__ = 'fmgr_pb2'
|
||||
QuarantinedObjectNames = _reflection.GeneratedProtocolMessageType('QuarantinedObjectNames', (_message.Message,), {
|
||||
'DESCRIPTOR' : _QUARANTINEDOBJECTNAMES,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.QuarantinedObjectNames)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(QuarantinedObjectNames)
|
||||
|
||||
ObjectName = _reflection.GeneratedProtocolMessageType('ObjectName', (_message.Message,), dict(
|
||||
DESCRIPTOR = _OBJECTNAME,
|
||||
__module__ = 'fmgr_pb2'
|
||||
ObjectName = _reflection.GeneratedProtocolMessageType('ObjectName', (_message.Message,), {
|
||||
'DESCRIPTOR' : _OBJECTNAME,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.ObjectName)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(ObjectName)
|
||||
|
||||
LoadObjectInfo = _reflection.GeneratedProtocolMessageType('LoadObjectInfo', (_message.Message,), dict(
|
||||
DESCRIPTOR = _LOADOBJECTINFO,
|
||||
__module__ = 'fmgr_pb2'
|
||||
LoadObjectInfo = _reflection.GeneratedProtocolMessageType('LoadObjectInfo', (_message.Message,), {
|
||||
'DESCRIPTOR' : _LOADOBJECTINFO,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.LoadObjectInfo)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(LoadObjectInfo)
|
||||
|
||||
RenameInfo = _reflection.GeneratedProtocolMessageType('RenameInfo', (_message.Message,), dict(
|
||||
DESCRIPTOR = _RENAMEINFO,
|
||||
__module__ = 'fmgr_pb2'
|
||||
RenameInfo = _reflection.GeneratedProtocolMessageType('RenameInfo', (_message.Message,), {
|
||||
'DESCRIPTOR' : _RENAMEINFO,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.RenameInfo)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(RenameInfo)
|
||||
|
||||
Object = _reflection.GeneratedProtocolMessageType('Object', (_message.Message,), dict(
|
||||
DESCRIPTOR = _OBJECT,
|
||||
__module__ = 'fmgr_pb2'
|
||||
Object = _reflection.GeneratedProtocolMessageType('Object', (_message.Message,), {
|
||||
'DESCRIPTOR' : _OBJECT,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.Object)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(Object)
|
||||
|
||||
LoadObjectsResponse = _reflection.GeneratedProtocolMessageType('LoadObjectsResponse', (_message.Message,), dict(
|
||||
DESCRIPTOR = _LOADOBJECTSRESPONSE,
|
||||
__module__ = 'fmgr_pb2'
|
||||
LoadObjectsResponse = _reflection.GeneratedProtocolMessageType('LoadObjectsResponse', (_message.Message,), {
|
||||
'DESCRIPTOR' : _LOADOBJECTSRESPONSE,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.LoadObjectsResponse)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(LoadObjectsResponse)
|
||||
|
||||
ObjectPrefix = _reflection.GeneratedProtocolMessageType('ObjectPrefix', (_message.Message,), dict(
|
||||
DESCRIPTOR = _OBJECTPREFIX,
|
||||
__module__ = 'fmgr_pb2'
|
||||
ObjectPrefix = _reflection.GeneratedProtocolMessageType('ObjectPrefix', (_message.Message,), {
|
||||
'DESCRIPTOR' : _OBJECTPREFIX,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.ObjectPrefix)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(ObjectPrefix)
|
||||
|
||||
Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), dict(
|
||||
DESCRIPTOR = _EMPTY,
|
||||
__module__ = 'fmgr_pb2'
|
||||
Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), {
|
||||
'DESCRIPTOR' : _EMPTY,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.Empty)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(Empty)
|
||||
|
||||
GetStatsInfo = _reflection.GeneratedProtocolMessageType('GetStatsInfo', (_message.Message,), dict(
|
||||
DESCRIPTOR = _GETSTATSINFO,
|
||||
__module__ = 'fmgr_pb2'
|
||||
GetStatsInfo = _reflection.GeneratedProtocolMessageType('GetStatsInfo', (_message.Message,), {
|
||||
'DESCRIPTOR' : _GETSTATSINFO,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.GetStatsInfo)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(GetStatsInfo)
|
||||
|
||||
PartitionContent = _reflection.GeneratedProtocolMessageType('PartitionContent', (_message.Message,), dict(
|
||||
DESCRIPTOR = _PARTITIONCONTENT,
|
||||
__module__ = 'fmgr_pb2'
|
||||
PartitionContent = _reflection.GeneratedProtocolMessageType('PartitionContent', (_message.Message,), {
|
||||
'DESCRIPTOR' : _PARTITIONCONTENT,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.PartitionContent)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(PartitionContent)
|
||||
|
||||
FullPathEntry = _reflection.GeneratedProtocolMessageType('FullPathEntry', (_message.Message,), dict(
|
||||
DESCRIPTOR = _FULLPATHENTRY,
|
||||
__module__ = 'fmgr_pb2'
|
||||
FullPathEntry = _reflection.GeneratedProtocolMessageType('FullPathEntry', (_message.Message,), {
|
||||
'DESCRIPTOR' : _FULLPATHENTRY,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.FullPathEntry)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(FullPathEntry)
|
||||
|
||||
KvState = _reflection.GeneratedProtocolMessageType('KvState', (_message.Message,), dict(
|
||||
DESCRIPTOR = _KVSTATE,
|
||||
__module__ = 'fmgr_pb2'
|
||||
KvState = _reflection.GeneratedProtocolMessageType('KvState', (_message.Message,), {
|
||||
'DESCRIPTOR' : _KVSTATE,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.KvState)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(KvState)
|
||||
|
||||
KVStats = _reflection.GeneratedProtocolMessageType('KVStats', (_message.Message,), dict(
|
||||
KVStats = _reflection.GeneratedProtocolMessageType('KVStats', (_message.Message,), {
|
||||
|
||||
StatsEntry = _reflection.GeneratedProtocolMessageType('StatsEntry', (_message.Message,), dict(
|
||||
DESCRIPTOR = _KVSTATS_STATSENTRY,
|
||||
__module__ = 'fmgr_pb2'
|
||||
'StatsEntry' : _reflection.GeneratedProtocolMessageType('StatsEntry', (_message.Message,), {
|
||||
'DESCRIPTOR' : _KVSTATS_STATSENTRY,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.KVStats.StatsEntry)
|
||||
))
|
||||
})
|
||||
,
|
||||
DESCRIPTOR = _KVSTATS,
|
||||
__module__ = 'fmgr_pb2'
|
||||
'DESCRIPTOR' : _KVSTATS,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.KVStats)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(KVStats)
|
||||
_sym_db.RegisterMessage(KVStats.StatsEntry)
|
||||
|
||||
ListQuarantinedOHashesInfo = _reflection.GeneratedProtocolMessageType('ListQuarantinedOHashesInfo', (_message.Message,), dict(
|
||||
DESCRIPTOR = _LISTQUARANTINEDOHASHESINFO,
|
||||
__module__ = 'fmgr_pb2'
|
||||
ListQuarantinedOHashesInfo = _reflection.GeneratedProtocolMessageType('ListQuarantinedOHashesInfo', (_message.Message,), {
|
||||
'DESCRIPTOR' : _LISTQUARANTINEDOHASHESINFO,
|
||||
'__module__' : 'fmgr_pb2'
|
||||
# @@protoc_insertion_point(class_scope:filemgr.ListQuarantinedOHashesInfo)
|
||||
))
|
||||
})
|
||||
_sym_db.RegisterMessage(ListQuarantinedOHashesInfo)
|
||||
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
import six
|
||||
import os
|
||||
import struct
|
||||
|
||||
|
@ -23,8 +24,8 @@ PICKLE_PROTOCOL = 2
|
|||
OBJECT_HEADER_VERSION = 4
|
||||
VOLUME_HEADER_VERSION = 1
|
||||
|
||||
OBJECT_START_MARKER = "SWIFTOBJ"
|
||||
VOLUME_START_MARKER = "SWIFTVOL"
|
||||
OBJECT_START_MARKER = b"SWIFTOBJ"
|
||||
VOLUME_START_MARKER = b"SWIFTVOL"
|
||||
|
||||
# object alignment within a volume.
|
||||
# this is needed so that FALLOC_FL_PUNCH_HOLE can actually return space back
|
||||
|
@ -74,16 +75,12 @@ class ObjectHeader(object):
|
|||
def __init__(self, version=OBJECT_HEADER_VERSION):
|
||||
if version not in object_header_formats.keys():
|
||||
raise HeaderException('Unsupported object header version')
|
||||
self.magic_string = bytes(OBJECT_START_MARKER)
|
||||
self.magic_string = OBJECT_START_MARKER
|
||||
self.version = version
|
||||
|
||||
def __eq__(self, other):
|
||||
return self.__dict__ == other.__dict__
|
||||
|
||||
def __repr__(self):
|
||||
return "<ObjectHeader ohash: {} filename: {}>".format(self.ohash,
|
||||
self.filename)
|
||||
|
||||
def __len__(self):
|
||||
try:
|
||||
fmt = object_header_formats[self.version]
|
||||
|
@ -107,7 +104,7 @@ class ObjectHeader(object):
|
|||
|
||||
args = (self.magic_string, self.version,
|
||||
self.policy_idx, ohash_h, ohash_l,
|
||||
str(self.filename),
|
||||
str(self.filename).encode('ascii'),
|
||||
self.metadata_offset, self.metadata_size,
|
||||
self.data_offset, self.data_size, self.total_size)
|
||||
|
||||
|
@ -120,7 +117,7 @@ class ObjectHeader(object):
|
|||
|
||||
args = (self.magic_string, self.version,
|
||||
self.policy_idx, ohash_h, ohash_l,
|
||||
str(self.filename),
|
||||
str(self.filename).encode('ascii'),
|
||||
self.metadata_offset, self.metadata_size,
|
||||
self.data_offset, self.data_size, self.total_size)
|
||||
|
||||
|
@ -133,7 +130,7 @@ class ObjectHeader(object):
|
|||
|
||||
args = (self.magic_string, self.version,
|
||||
self.policy_idx, ohash_h, ohash_l,
|
||||
str(self.filename),
|
||||
str(self.filename).encode('ascii'),
|
||||
self.metadata_offset, self.metadata_size,
|
||||
self.data_offset, self.data_size, self.total_size, self.state)
|
||||
|
||||
|
@ -146,7 +143,7 @@ class ObjectHeader(object):
|
|||
|
||||
args = (self.magic_string, self.version,
|
||||
self.policy_idx, ohash_h, ohash_l,
|
||||
str(self.filename),
|
||||
str(self.filename).encode('ascii'),
|
||||
self.metadata_offset, self.metadata_size,
|
||||
self.data_offset, self.data_size, self.total_size, self.state,
|
||||
self.metastr_md5)
|
||||
|
@ -164,7 +161,7 @@ class ObjectHeader(object):
|
|||
|
||||
if buf[0:8] != OBJECT_START_MARKER:
|
||||
raise HeaderException('Not a header')
|
||||
version = struct.unpack('<B', buf[8])[0]
|
||||
version = struct.unpack('<B', buf[8:9])[0]
|
||||
if version not in object_header_formats.keys():
|
||||
raise HeaderException('Unsupported header version')
|
||||
|
||||
|
@ -179,7 +176,10 @@ class ObjectHeader(object):
|
|||
header.version = raw_header[1]
|
||||
header.policy_idx = raw_header[2]
|
||||
header.ohash = "{:032x}".format((raw_header[3] << 64) + raw_header[4])
|
||||
header.filename = raw_header[5].rstrip('\0')
|
||||
if six.PY2:
|
||||
header.filename = raw_header[5].rstrip(b'\0')
|
||||
else:
|
||||
header.filename = raw_header[5].rstrip(b'\0').decode('ascii')
|
||||
header.metadata_offset = raw_header[6]
|
||||
header.metadata_size = raw_header[7]
|
||||
header.data_offset = raw_header[8]
|
||||
|
@ -199,7 +199,10 @@ class ObjectHeader(object):
|
|||
header.version = raw_header[1]
|
||||
header.policy_idx = raw_header[2]
|
||||
header.ohash = "{:032x}".format((raw_header[3] << 64) + raw_header[4])
|
||||
header.filename = raw_header[5].rstrip('\0')
|
||||
if six.PY2:
|
||||
header.filename = raw_header[5].rstrip(b'\0')
|
||||
else:
|
||||
header.filename = raw_header[5].rstrip(b'\0').decode('ascii')
|
||||
header.metadata_offset = raw_header[6]
|
||||
header.metadata_size = raw_header[7]
|
||||
header.data_offset = raw_header[8]
|
||||
|
@ -219,7 +222,10 @@ class ObjectHeader(object):
|
|||
header.version = raw_header[1]
|
||||
header.policy_idx = raw_header[2]
|
||||
header.ohash = "{:032x}".format((raw_header[3] << 64) + raw_header[4])
|
||||
header.filename = raw_header[5].rstrip('\0')
|
||||
if six.PY2:
|
||||
header.filename = raw_header[5].rstrip(b'\0')
|
||||
else:
|
||||
header.filename = raw_header[5].rstrip(b'\0').decode('ascii')
|
||||
header.metadata_offset = raw_header[6]
|
||||
header.metadata_size = raw_header[7]
|
||||
header.data_offset = raw_header[8]
|
||||
|
@ -240,7 +246,10 @@ class ObjectHeader(object):
|
|||
header.version = raw_header[1]
|
||||
header.policy_idx = raw_header[2]
|
||||
header.ohash = "{:032x}".format((raw_header[3] << 64) + raw_header[4])
|
||||
header.filename = raw_header[5].rstrip('\0')
|
||||
if six.PY2:
|
||||
header.filename = raw_header[5].rstrip(b'\0')
|
||||
else:
|
||||
header.filename = raw_header[5].rstrip(b'\0').decode('ascii')
|
||||
header.metadata_offset = raw_header[6]
|
||||
header.metadata_size = raw_header[7]
|
||||
header.data_offset = raw_header[8]
|
||||
|
@ -273,7 +282,7 @@ class VolumeHeader(object):
|
|||
(only valid if state is STATE_COMPACTION_SRC)
|
||||
"""
|
||||
def __init__(self, version=VOLUME_HEADER_VERSION):
|
||||
self.magic_string = bytes(VOLUME_START_MARKER)
|
||||
self.magic_string = VOLUME_START_MARKER
|
||||
self.version = version
|
||||
self.state = 0
|
||||
self.compaction_target = 0
|
||||
|
@ -316,7 +325,7 @@ class VolumeHeader(object):
|
|||
}
|
||||
if buf[0:8] != VOLUME_START_MARKER:
|
||||
raise HeaderException('Not a header')
|
||||
version = struct.unpack('<B', buf[8])[0]
|
||||
version = struct.unpack('<B', buf[8:9])[0]
|
||||
if version not in volume_header_formats.keys():
|
||||
raise HeaderException('Unsupported header version')
|
||||
|
||||
|
|
|
@ -603,7 +603,7 @@ class BaseKVFileWriter(BaseDiskFileWriter):
|
|||
except OSError as err:
|
||||
if err.errno in (errno.ENOSPC, errno.EDQUOT):
|
||||
# No more inodes in filesystem
|
||||
raise DiskFileNoSpace()
|
||||
raise DiskFileNoSpace(err.strerror)
|
||||
raise
|
||||
return self
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ vfile names and metadata (xattr) are also stored in the volume.
|
|||
|
||||
import errno
|
||||
import fcntl
|
||||
import six
|
||||
import hashlib
|
||||
import re
|
||||
from collections import defaultdict
|
||||
|
@ -40,13 +41,15 @@ from swift.obj.fmgr_pb2 import STATE_RW
|
|||
from swift.obj.meta_pb2 import Metadata
|
||||
from swift.obj.diskfile import _encode_metadata
|
||||
from swift.common import utils
|
||||
from swift.obj.vfile_utils import SwiftPathInfo, get_volume_index, get_volume_type, \
|
||||
next_aligned_offset, SwiftQuarantinedPathInfo
|
||||
from swift.obj.vfile_utils import SwiftPathInfo, get_volume_index, \
|
||||
get_volume_type, next_aligned_offset, SwiftQuarantinedPathInfo, VOSError, \
|
||||
VIOError, VFileException
|
||||
|
||||
vcreation_lock_name = "volume_creation.lock"
|
||||
VCREATION_LOCK_NAME = "volume_creation.lock"
|
||||
|
||||
PICKLE_PROTOCOL = 2
|
||||
METADATA_RESERVE = 500
|
||||
VOL_AND_LOCKS_RE = re.compile(r'v\d{7}(.writelock)?')
|
||||
|
||||
|
||||
def increment(logger, counter, count=1):
|
||||
|
@ -57,28 +60,6 @@ def increment(logger, counter, count=1):
|
|||
pass
|
||||
|
||||
|
||||
class VIOError(IOError):
|
||||
"""
|
||||
Exceptions are part of the interface, subclass IOError to make it easier
|
||||
to interface with diskfile.py
|
||||
"""
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(VIOError, self).__init__(*args, **kwargs)
|
||||
|
||||
|
||||
class VOSError(OSError):
|
||||
"""
|
||||
Exceptions are part of the interface, subclass OSError to make it easier
|
||||
to interface with diskfile.py
|
||||
"""
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(VOSError, self).__init__(*args, **kwargs)
|
||||
|
||||
|
||||
class VFileException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class VFileReader(object):
|
||||
"""
|
||||
Represents a vfile stored in a volume.
|
||||
|
@ -264,6 +245,13 @@ class VFileWriter(object):
|
|||
# parse datadir
|
||||
si = SwiftPathInfo.from_path(datadir)
|
||||
|
||||
if si.type != "ohash":
|
||||
raise VOSError("not a valid object hash path")
|
||||
|
||||
if obj_size is not None:
|
||||
if obj_size < 0:
|
||||
raise VOSError("obj size may not be negative")
|
||||
|
||||
socket_path = os.path.normpath(si.socket_path)
|
||||
volume_dir = os.path.normpath(si.volume_dir)
|
||||
|
||||
|
@ -277,6 +265,7 @@ class VFileWriter(object):
|
|||
|
||||
# create object header
|
||||
header = ObjectHeader(version=OBJECT_HEADER_VERSION)
|
||||
# TODO: this is unused, always set to zero.
|
||||
header.ohash = si.ohash
|
||||
header.policy_idx = 0
|
||||
header.data_offset = len(header) + conf['metadata_reserve']
|
||||
|
@ -284,18 +273,21 @@ class VFileWriter(object):
|
|||
# requires header v3
|
||||
header.state = STATE_OBJ_FILE
|
||||
|
||||
# get offset at which to start writing
|
||||
offset = rpc.get_next_offset(socket_path, volume_index)
|
||||
# FIXME: this is unused message, please fix as expected
|
||||
# txt = "datadir {} seek to offset {} where data will start"
|
||||
try:
|
||||
# get offset at which to start writing
|
||||
offset = rpc.get_next_offset(socket_path, volume_index)
|
||||
|
||||
# pre-allocate space if needed
|
||||
_may_grow_volume(volume_file, offset, obj_size, conf, logger)
|
||||
# pre-allocate space if needed
|
||||
_may_grow_volume(volume_file, offset, obj_size, conf, logger)
|
||||
|
||||
# seek to absolute object offset + relative data offset
|
||||
# (we leave space for the header and some metadata)
|
||||
os.lseek(volume_file, offset + header.data_offset,
|
||||
os.SEEK_SET)
|
||||
# seek to absolute object offset + relative data offset
|
||||
# (we leave space for the header and some metadata)
|
||||
os.lseek(volume_file, offset + header.data_offset,
|
||||
os.SEEK_SET)
|
||||
except Exception:
|
||||
os.close(volume_file)
|
||||
os.close(lock_file)
|
||||
raise
|
||||
|
||||
return cls(datadir, volume_file, lock_file, volume_dir,
|
||||
volume_index, header, offset, logger)
|
||||
|
@ -307,6 +299,9 @@ class VFileWriter(object):
|
|||
if self.fd < 0:
|
||||
raise VIOError(errno.EBADF, "Bad file descriptor")
|
||||
|
||||
if not filename:
|
||||
raise VIOError("filename cannot be empty")
|
||||
|
||||
# how much data has been written ?
|
||||
# header.data_offset is relative to the object's offset
|
||||
data_offset = self.offset + self.header.data_offset
|
||||
|
@ -343,13 +338,8 @@ class VFileWriter(object):
|
|||
|
||||
object_end = data_end + metadata_remainder
|
||||
|
||||
# TODO: use next_aligned_offset()
|
||||
# keep unaligned obj_end to log how much space is lost to padding
|
||||
# FIXME: this line is unused so that we should check the algorithms
|
||||
# unaligned_obj_end = object_end
|
||||
# align
|
||||
if object_end % ALIGNMENT != 0:
|
||||
object_end = object_end + (ALIGNMENT - object_end % ALIGNMENT)
|
||||
object_end = next_aligned_offset(object_end, ALIGNMENT)
|
||||
|
||||
self.header.total_size = object_end - self.offset
|
||||
|
||||
# write header
|
||||
|
@ -375,7 +365,8 @@ class VFileWriter(object):
|
|||
errtxt = "BUG: wrote past object_end! curpos: {} object_end: {}"
|
||||
raise Exception(errtxt.format(curpos, object_end))
|
||||
|
||||
# sync
|
||||
# sync data. fdatasync() is enough, if the volume was just created,
|
||||
# it has been fsync()'ed previously, along with its parent directory.
|
||||
fdatasync(self.fd)
|
||||
|
||||
# register object
|
||||
|
@ -394,7 +385,12 @@ class VFileWriter(object):
|
|||
|
||||
def open_or_create_volume(socket_path, partition, extension, volume_dir,
|
||||
conf, logger, size=0):
|
||||
# try to find an available volume
|
||||
"""
|
||||
Tries to open or create a volume for writing. If a volume cannot be
|
||||
opened or created, a VOSError exception is raised.
|
||||
:return: volume file descriptor, lock file descriptor, absolute path
|
||||
to volume.
|
||||
"""
|
||||
volume_file, lock_file, volume_path = open_writable_volume(socket_path,
|
||||
partition,
|
||||
extension,
|
||||
|
@ -402,42 +398,49 @@ def open_or_create_volume(socket_path, partition, extension, volume_dir,
|
|||
conf,
|
||||
logger)
|
||||
if not volume_file:
|
||||
# attempt to create new volume for partition
|
||||
try:
|
||||
os.makedirs(volume_dir)
|
||||
except OSError as err:
|
||||
if err.errno == errno.EEXIST:
|
||||
pass
|
||||
else:
|
||||
raise
|
||||
try:
|
||||
# attempt to create new volume for partition
|
||||
volume_type = get_volume_type(extension)
|
||||
volume_file, lock_file, volume_path = create_writable_volume(
|
||||
socket_path, partition, volume_type, volume_dir,
|
||||
socket_path, partition, extension, volume_dir,
|
||||
conf, logger, size=size)
|
||||
except (OSError, IOError):
|
||||
if err.errno in (errno.EDQUOT, errno.EACCES, errno.EAGAIN):
|
||||
# failed to create a volume, try again to open an existing one
|
||||
volume_type = get_volume_type(extension)
|
||||
volume_file, lock_file, volume_path = open_writable_volume(
|
||||
socket_path, partition, volume_type, volume_dir, conf,
|
||||
logger)
|
||||
else:
|
||||
raise
|
||||
|
||||
if not volume_file:
|
||||
# TODO: make sure this ends in DiskFileNoSpace in caller
|
||||
raise VIOError(errno.EIO, "Failed to open a volume for writing")
|
||||
|
||||
if not volume_file:
|
||||
# TODO: make sure this ends in DiskFileNoSpace in caller
|
||||
raise VIOError(errno.EIO, "Failed to open a volume for writing")
|
||||
except Exception as err:
|
||||
error_msg = "Failed to open or create a volume for writing: "
|
||||
error_msg += getattr(err, "strerror", "Unknown error")
|
||||
raise VOSError(errno.ENOSPC, error_msg)
|
||||
|
||||
return volume_file, lock_file, volume_path
|
||||
|
||||
|
||||
def _create_new_lock_file(volume_dir, logger):
|
||||
creation_lock_path = os.path.join(volume_dir, VCREATION_LOCK_NAME)
|
||||
with open(creation_lock_path, 'w') as creation_lock_file:
|
||||
# this may block
|
||||
fcntl.flock(creation_lock_file, fcntl.LOCK_EX)
|
||||
|
||||
index = get_next_volume_index(volume_dir)
|
||||
next_lock_name = get_lock_file_name(index)
|
||||
next_lock_path = os.path.join(volume_dir, next_lock_name)
|
||||
|
||||
try:
|
||||
lock_file = os.open(next_lock_path,
|
||||
os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0o600)
|
||||
except OSError:
|
||||
increment(logger, 'vfile.volume_creation.fail_other')
|
||||
raise
|
||||
|
||||
try:
|
||||
fcntl.flock(lock_file, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||
except IOError:
|
||||
increment(logger, 'vfile.volume_creation.fail_other')
|
||||
os.close(lock_file)
|
||||
os.unlink(next_lock_path)
|
||||
raise
|
||||
|
||||
return index, next_lock_path, lock_file
|
||||
|
||||
|
||||
# create a new volume
|
||||
def create_writable_volume(socket_path, partition, volume_type, volume_dir,
|
||||
def create_writable_volume(socket_path, partition, extension, volume_dir,
|
||||
conf, logger, state=STATE_RW, size=0):
|
||||
"""
|
||||
Creates a new writable volume, and associated lock file.
|
||||
|
@ -456,47 +459,32 @@ def create_writable_volume(socket_path, partition, volume_type, volume_dir,
|
|||
if size is None:
|
||||
size = 0
|
||||
|
||||
# lock the volume creation lock file
|
||||
creation_lock_path = os.path.join(volume_dir, vcreation_lock_name)
|
||||
|
||||
# Check if we have exceeded the allowed volume count for this partition
|
||||
# Move this check below with the lock held ? (now, we may have
|
||||
# a few extra volumes)
|
||||
volume_type = get_volume_type(extension)
|
||||
volumes = rpc.list_volumes(socket_path, partition, volume_type)
|
||||
max_volume_count = conf['max_volume_count']
|
||||
if len(volumes) >= max_volume_count:
|
||||
err_txt = "Maximum count of volumes reached for partition: {} type:\
|
||||
{}".format(partition, volume_type)
|
||||
err_txt = ("Maximum count of volumes reached for partition:"
|
||||
" {} type: {}".format(partition, volume_type))
|
||||
increment(logger, 'vfile.volume_creation.fail_count_exceeded')
|
||||
raise VOSError(errno.EDQUOT, err_txt)
|
||||
|
||||
with open(creation_lock_path, 'w') as creation_lock_file:
|
||||
# this may block
|
||||
fcntl.flock(creation_lock_file, fcntl.LOCK_EX)
|
||||
|
||||
index = get_next_volume_index(volume_dir)
|
||||
next_lock_name = get_lock_file_name(index)
|
||||
next_lock_path = os.path.join(volume_dir, next_lock_name)
|
||||
|
||||
lock_file = None
|
||||
try:
|
||||
lock_file = os.open(next_lock_path,
|
||||
os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0o600)
|
||||
except OSError:
|
||||
increment(logger, 'vfile.volume_creation.fail_other')
|
||||
try:
|
||||
os.makedirs(volume_dir)
|
||||
except OSError as err:
|
||||
if err.errno == errno.EEXIST:
|
||||
pass
|
||||
else:
|
||||
raise
|
||||
|
||||
try:
|
||||
fcntl.flock(lock_file, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||
except IOError:
|
||||
increment(logger, 'vfile.volume_creation.fail_other')
|
||||
raise
|
||||
index, next_lock_path, lock_file = _create_new_lock_file(
|
||||
volume_dir, logger)
|
||||
|
||||
# create the volume
|
||||
next_volume_name = get_volume_name(index)
|
||||
next_volume_path = os.path.join(volume_dir, next_volume_name)
|
||||
volume_file = os.open(next_volume_path,
|
||||
os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0o600)
|
||||
|
||||
vol_header = VolumeHeader()
|
||||
vol_header.volume_idx = index
|
||||
|
@ -511,22 +499,26 @@ def create_writable_volume(socket_path, partition, volume_type, volume_dir,
|
|||
# reserved space, but we cannot know this in advance)
|
||||
alloc_size = vol_header.first_obj_offset + size
|
||||
volume_alloc_chunk_size = conf['volume_alloc_chunk_size']
|
||||
_allocate_volume_space(volume_file, 0, alloc_size, volume_alloc_chunk_size,
|
||||
logger)
|
||||
|
||||
# Write volume header
|
||||
write_volume_header(vol_header, volume_file)
|
||||
|
||||
# If the uploader is slow to send data to the object server, a crash may
|
||||
# occur before the object is received and a call to fsync() is issued.
|
||||
# We end up with volumes without a header.
|
||||
# Issue a fsync() here, at the cost of performance early on, until
|
||||
# volumes have been created for all partitions.
|
||||
fsync(volume_file)
|
||||
fsync_dir(volume_dir)
|
||||
|
||||
# Register volume
|
||||
try:
|
||||
volume_file = os.open(next_volume_path,
|
||||
os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0o600)
|
||||
_allocate_volume_space(volume_file, 0, alloc_size,
|
||||
volume_alloc_chunk_size, logger)
|
||||
|
||||
# Write volume header
|
||||
write_volume_header(vol_header, volume_file)
|
||||
|
||||
# If the uploader is slow to send data to the object server, a crash
|
||||
# may occur before the object is received and a call to fsync() is
|
||||
# issued. We end up with volumes without a header.
|
||||
# Issue a fsync() here, at the cost of performance early on. As
|
||||
# partitions get volumes we switch to open_writable_volume, avoiding
|
||||
# the fsync.
|
||||
fsync(volume_file)
|
||||
fsync_dir(volume_dir)
|
||||
|
||||
# Register volume
|
||||
rpc.register_volume(socket_path, partition, vol_header.type, index,
|
||||
vol_header.first_obj_offset, vol_header.state)
|
||||
except Exception:
|
||||
|
@ -613,8 +605,23 @@ def open_writable_volume(socket_path, partition, extension, volume_dir, conf,
|
|||
|
||||
|
||||
def open_volume(volume_path):
|
||||
"""Locks the volume, and returns a fd to the volume and a fd to its lock
|
||||
file. Returns None, None, if it cannot be locked. Raises for any other
|
||||
error.
|
||||
:param volume_path: full path to volume
|
||||
:return: (volume fd, lock fd)
|
||||
"""
|
||||
lock_file_path = "{}.writelock".format(volume_path)
|
||||
lock_file = os.open(lock_file_path, os.O_WRONLY)
|
||||
|
||||
try:
|
||||
lock_file = os.open(lock_file_path, os.O_WRONLY)
|
||||
except OSError as e:
|
||||
if e.errno != errno.ENOENT:
|
||||
raise
|
||||
# if the volume lock file as been removed, create it
|
||||
lock_file = os.open(lock_file_path,
|
||||
os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0o600)
|
||||
|
||||
try:
|
||||
fcntl.flock(lock_file, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||
except IOError as err:
|
||||
|
@ -623,8 +630,18 @@ def open_volume(volume_path):
|
|||
os.close(lock_file)
|
||||
return None, None
|
||||
else:
|
||||
os.close(lock_file)
|
||||
try:
|
||||
os.close(lock_file)
|
||||
except Exception:
|
||||
pass
|
||||
raise
|
||||
except Exception:
|
||||
try:
|
||||
os.close(lock_file)
|
||||
except Exception:
|
||||
pass
|
||||
raise
|
||||
|
||||
volume_file = os.open(volume_path, os.O_WRONLY)
|
||||
return volume_file, lock_file
|
||||
|
||||
|
@ -651,32 +668,41 @@ def change_volume_state(volume_file_path, state, compaction_target=None):
|
|||
def get_next_volume_index(volume_dir):
|
||||
"""
|
||||
Returns the next volume index to use for the given dir.
|
||||
Caller must hold the volume creation lock.
|
||||
:param volume_dir: volume directory
|
||||
:return: the next volume index to use
|
||||
"""
|
||||
dir_entries = os.listdir(volume_dir)
|
||||
lock_file_idxs = [int(f[1:8]) for f in dir_entries if
|
||||
f.endswith(".writelock")]
|
||||
if len(lock_file_idxs) < 1:
|
||||
# Get all volumes and their lock: a volume should always have a lock,
|
||||
# but a fsck may have removed either. If we find such a case, skip the
|
||||
# index.
|
||||
volumes_and_locks_idxs = set([name[1:8] for name in dir_entries if
|
||||
VOL_AND_LOCKS_RE.match(name)])
|
||||
if len(volumes_and_locks_idxs) < 1:
|
||||
return 1
|
||||
|
||||
lock_file_idxs.sort()
|
||||
# This is about 30% faster than calling int() in the list comprehension
|
||||
# above.
|
||||
idxs = sorted(int(i) for i in volumes_and_locks_idxs)
|
||||
|
||||
# find the first "hole" in the indexes
|
||||
for i in xrange(1, len(lock_file_idxs) + 1):
|
||||
if lock_file_idxs[i - 1] != i:
|
||||
return i
|
||||
for pos, idx in enumerate(idxs, start=1):
|
||||
if pos != idx:
|
||||
return pos
|
||||
|
||||
# no hole found
|
||||
return i + 1
|
||||
return idx + 1
|
||||
|
||||
|
||||
def get_lock_file_name(index):
|
||||
if index < 0 or index > 9999999:
|
||||
if index <= 0 or index > 9999999:
|
||||
raise VFileException("invalid lock file index")
|
||||
lock_file_name = "v{0:07d}.writelock".format(index)
|
||||
return lock_file_name
|
||||
|
||||
|
||||
def get_volume_name(index):
|
||||
if index < 0 or index > 9999999:
|
||||
if index <= 0 or index > 9999999:
|
||||
raise VFileException("invalid volume file index")
|
||||
volume_file_name = "v{0:07d}".format(index)
|
||||
return volume_file_name
|
||||
|
@ -1122,7 +1148,11 @@ def read_metadata(fp, offset, header):
|
|||
metadata = {}
|
||||
for attr in meta.attrs:
|
||||
if attr.key:
|
||||
metadata[attr.key] = attr.value
|
||||
if six.PY2:
|
||||
metadata[attr.key] = attr.value
|
||||
else:
|
||||
metadata[attr.key.decode('utf8', 'surrogateescape')] = \
|
||||
attr.value.decode('utf8', 'surrogateescape')
|
||||
|
||||
return metadata
|
||||
|
||||
|
|
|
@ -28,7 +28,21 @@ volume_name_re = re.compile(r"^v\d{7}$")
|
|||
losf_name_re = re.compile(r"^losf(-\d+)?$")
|
||||
|
||||
|
||||
class VFileUtilException(Exception):
|
||||
class VIOError(IOError):
|
||||
"""
|
||||
Exceptions are part of the interface, subclass IOError to make it easier
|
||||
to interface with diskfile.py
|
||||
"""
|
||||
|
||||
|
||||
class VOSError(OSError):
|
||||
"""
|
||||
Exceptions are part of the interface, subclass OSError to make it easier
|
||||
to interface with diskfile.py
|
||||
"""
|
||||
|
||||
|
||||
class VFileException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
|
@ -112,13 +126,13 @@ class SwiftPathInfo(object):
|
|||
obj_idx = [i for i, elem in enumerate(ldir)
|
||||
if elem.startswith("objects")][0]
|
||||
except IndexError:
|
||||
raise VFileUtilException("cannot parse object directory")
|
||||
raise VOSError("cannot parse object directory")
|
||||
|
||||
elements = ldir[(obj_idx + 1):]
|
||||
count = len(elements)
|
||||
|
||||
if count > 4:
|
||||
raise VFileUtilException("cannot parse swift file path")
|
||||
raise VOSError("cannot parse swift file path")
|
||||
|
||||
_, policy = split_policy_string(ldir[obj_idx])
|
||||
policy_idx = policy.idx
|
||||
|
@ -126,7 +140,7 @@ class SwiftPathInfo(object):
|
|||
prefix = os.path.join("/", *ldir[0:obj_idx])
|
||||
m = policy_re.match(ldir[obj_idx])
|
||||
if not m:
|
||||
raise VFileUtilException(
|
||||
raise VOSError(
|
||||
"cannot parse object element of directory")
|
||||
if m.group(1):
|
||||
sofsdir = "losf{}".format(m.group(1))
|
||||
|
@ -165,15 +179,15 @@ class SwiftQuarantinedPathInfo(object):
|
|||
try:
|
||||
quar_idx = ldir.index("quarantined")
|
||||
except ValueError:
|
||||
raise VFileUtilException("cannot parse quarantined path %s" %
|
||||
path)
|
||||
raise VOSError("cannot parse quarantined path %s" %
|
||||
path)
|
||||
|
||||
elements = ldir[(quar_idx + 1):]
|
||||
count = len(elements)
|
||||
|
||||
if count < 1 or count > 3 or "objects" not in elements[0]:
|
||||
raise VFileUtilException("cannot parse quarantined path %s" %
|
||||
path)
|
||||
raise VOSError("cannot parse quarantined path %s" %
|
||||
path)
|
||||
|
||||
_, policy = split_policy_string(elements[0])
|
||||
policy_idx = policy.idx
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -233,11 +233,11 @@ class TestSwiftPathInfo(unittest.TestCase):
|
|||
self.assertEqual(si.filename, test["filename"])
|
||||
|
||||
def test_swift_path_info_error(self):
|
||||
with self.assertRaises(vfile_utils.VFileUtilException):
|
||||
with self.assertRaises(vfile_utils.VOSError):
|
||||
vfile_utils.SwiftPathInfo.from_path("/invalid")
|
||||
with self.assertRaises(vfile_utils.VFileUtilException):
|
||||
with self.assertRaises(vfile_utils.VOSError):
|
||||
vfile_utils.SwiftPathInfo.from_path("/srv/node/sda2")
|
||||
with self.assertRaises(vfile_utils.VFileUtilException):
|
||||
with self.assertRaises(vfile_utils.VOSError):
|
||||
invalid_path = "/sda/objects/1234/def" \
|
||||
"/d41d8cd98f00b204e9800998ecf8427e/" \
|
||||
"1522913866.16520#12#d.data/extra_dir"
|
||||
|
@ -317,11 +317,11 @@ class TestSwiftQuarantinedPathInfo(unittest.TestCase):
|
|||
self.assertEqual(si.filename, test["filename"])
|
||||
|
||||
def test_swift_path_info_error(self):
|
||||
with self.assertRaises(vfile_utils.VFileUtilException):
|
||||
with self.assertRaises(vfile_utils.VOSError):
|
||||
vfile_utils.SwiftPathInfo.from_path("/invalid")
|
||||
with self.assertRaises(vfile_utils.VFileUtilException):
|
||||
with self.assertRaises(vfile_utils.VOSError):
|
||||
vfile_utils.SwiftPathInfo.from_path("/srv/node/sda2")
|
||||
with self.assertRaises(vfile_utils.VFileUtilException):
|
||||
with self.assertRaises(vfile_utils.VOSError):
|
||||
invalid_path = "/sdb/objects/1234/def" \
|
||||
"/d41d8cd98f00b204e9800998ecf8427e/" \
|
||||
"1522913866.16520#12#d.data/extra_dir"
|
||||
|
|
Loading…
Reference in New Issue