goosefs-sdk 0.1.7

Goosefs Rust gRPC Client - Direct gRPC client for Goosefs Master/Worker
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
// This file is @generated by prost-build.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PMode {
    #[prost(enumeration = "Bits", required, tag = "1")]
    pub owner_bits: i32,
    #[prost(enumeration = "Bits", required, tag = "2")]
    pub group_bits: i32,
    #[prost(enumeration = "Bits", required, tag = "3")]
    pub other_bits: i32,
}
/// *
///
/// Contains the information of a block in GooseFS. It maintains the worker nodes where the replicas
/// of the blocks are stored.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlockInfo {
    #[prost(int64, optional, tag = "1")]
    pub block_id: ::core::option::Option<i64>,
    #[prost(int64, optional, tag = "2")]
    pub length: ::core::option::Option<i64>,
    #[prost(int32, optional, tag = "3")]
    pub max_replicas: ::core::option::Option<i32>,
    #[prost(message, repeated, tag = "4")]
    pub locations: ::prost::alloc::vec::Vec<BlockLocation>,
}
/// *
///
/// Information about blocks.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlockLocation {
    #[prost(int64, optional, tag = "1")]
    pub worker_id: ::core::option::Option<i64>,
    #[prost(message, optional, tag = "2")]
    pub worker_address: ::core::option::Option<WorkerNetAddress>,
}
/// *
///
/// Information about metrics.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Metric {
    #[prost(string, optional, tag = "1")]
    pub instance: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "2")]
    pub source: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "3")]
    pub name: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(double, optional, tag = "4")]
    pub value: ::core::option::Option<f64>,
    #[prost(enumeration = "MetricType", required, tag = "5")]
    pub metric_type: i32,
    #[prost(map = "string, string", tag = "6")]
    pub tags: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ConfigProperty {
    #[prost(string, optional, tag = "1")]
    pub name: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "2")]
    pub source: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "3")]
    pub value: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Command {
    #[prost(enumeration = "CommandType", optional, tag = "1")]
    pub command_type: ::core::option::Option<i32>,
    #[prost(int64, repeated, packed = "false", tag = "2")]
    pub data: ::prost::alloc::vec::Vec<i64>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct LocalityTier {
    #[prost(string, optional, tag = "1")]
    pub tier_name: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "2")]
    pub value: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TieredIdentity {
    #[prost(message, repeated, tag = "1")]
    pub tiers: ::prost::alloc::vec::Vec<LocalityTier>,
}
/// *
///
/// Address information about masters.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct NetAddress {
    #[prost(string, optional, tag = "1")]
    pub host: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(int32, optional, tag = "2")]
    pub rpc_port: ::core::option::Option<i32>,
    /// Host and Port for accessing the physical machine hosted in the underlay environment via VIP through Tencent Cloud VPC.
    #[prost(string, optional, tag = "3")]
    pub tencent_cloud_vpc_mapping_host: ::core::option::Option<
        ::prost::alloc::string::String,
    >,
    #[prost(int32, optional, tag = "4")]
    pub tencent_cloud_vpc_mapping_port: ::core::option::Option<i32>,
}
/// *
///
/// Address information about workers.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkerNetAddress {
    #[prost(string, optional, tag = "1")]
    pub host: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(int32, optional, tag = "2")]
    pub rpc_port: ::core::option::Option<i32>,
    #[prost(int32, optional, tag = "3")]
    pub data_port: ::core::option::Option<i32>,
    #[prost(int32, optional, tag = "4")]
    pub web_port: ::core::option::Option<i32>,
    #[prost(string, optional, tag = "5")]
    pub domain_socket_path: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(message, optional, tag = "6")]
    pub tiered_identity: ::core::option::Option<TieredIdentity>,
    #[prost(string, optional, tag = "7")]
    pub container_host: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(int32, optional, tag = "8")]
    pub secure_rpc_port: ::core::option::Option<i32>,
    #[prost(string, optional, tag = "9")]
    pub tencent_cloud_vpc_mapping_host: ::core::option::Option<
        ::prost::alloc::string::String,
    >,
    #[prost(int32, optional, tag = "10")]
    pub tencent_cloud_vpc_mapping_port: ::core::option::Option<i32>,
    #[prost(int32, optional, tag = "11")]
    pub tencent_cloud_vpc_mapping_data_port: ::core::option::Option<i32>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RetryInfo {
    #[prost(bool, optional, tag = "1")]
    pub is_retryable: ::core::option::Option<bool>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ErrorInfo {
    #[prost(enumeration = "ErrorType", optional, tag = "1")]
    pub error_type: ::core::option::Option<i32>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct WorkerRateLimit {
    #[prost(double, optional, tag = "1")]
    pub rate_limit: ::core::option::Option<f64>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Checksum {
    #[prost(enumeration = "ChecksumTypeProto", required, tag = "1")]
    pub crc_type: i32,
    #[prost(uint32, required, tag = "2")]
    pub bytes_per_checksum: u32,
}
/// *
///
/// Probe timing information, used to convey server-side sub-phase timings via gRPC Trailer.
/// Only used in probe mode (when request Header carries probe-enabled: true).
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProbeTimingInfo {
    /// Server total processing duration (microseconds)
    #[prost(int64, optional, tag = "1")]
    pub server_total_us: ::core::option::Option<i64>,
    /// Sub-phase timings (microseconds), key is the phase name
    #[prost(map = "string, int64", tag = "2")]
    pub sub_timings_us: ::std::collections::HashMap<::prost::alloc::string::String, i64>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Bits {
    None = 1,
    Execute = 2,
    Write = 3,
    WriteExecute = 4,
    Read = 5,
    ReadExecute = 6,
    ReadWrite = 7,
    All = 8,
}
impl Bits {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::None => "NONE",
            Self::Execute => "EXECUTE",
            Self::Write => "WRITE",
            Self::WriteExecute => "WRITE_EXECUTE",
            Self::Read => "READ",
            Self::ReadExecute => "READ_EXECUTE",
            Self::ReadWrite => "READ_WRITE",
            Self::All => "ALL",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "NONE" => Some(Self::None),
            "EXECUTE" => Some(Self::Execute),
            "WRITE" => Some(Self::Write),
            "WRITE_EXECUTE" => Some(Self::WriteExecute),
            "READ" => Some(Self::Read),
            "READ_EXECUTE" => Some(Self::ReadExecute),
            "READ_WRITE" => Some(Self::ReadWrite),
            "ALL" => Some(Self::All),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MetricType {
    /// GAUGE is the simplest type of metric. If you're not sure which to use, gauge is a safe choice. It is represents a
    /// general K-V pair.
    Gauge = 0,
    /// COUNTER represents values which can be incremented or decremented over time by certain operations. It does not rely
    /// on timing to determine the value.
    Counter = 1,
    /// METER represents a metric value at a *rate*. The value of the metric varies with the time over which events are
    /// recorded
    Meter = 2,
    /// TIMER represents a histogram of the rate of the specified events.
    Timer = 3,
    /// HISTOGRAM gives statistics about the value of past occurrences of an event.
    Histogram = 4,
}
impl MetricType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Gauge => "GAUGE",
            Self::Counter => "COUNTER",
            Self::Meter => "METER",
            Self::Timer => "TIMER",
            Self::Histogram => "HISTOGRAM",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "GAUGE" => Some(Self::Gauge),
            "COUNTER" => Some(Self::Counter),
            "METER" => Some(Self::Meter),
            "TIMER" => Some(Self::Timer),
            "HISTOGRAM" => Some(Self::Histogram),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum CommandType {
    Unknown = 0,
    Nothing = 1,
    /// Ask the worker to re-register.
    Register = 2,
    /// Ask the worker to free files.
    Free = 3,
}
impl CommandType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unknown => "Unknown",
            Self::Nothing => "Nothing",
            Self::Register => "Register",
            Self::Free => "Free",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "Unknown" => Some(Self::Unknown),
            "Nothing" => Some(Self::Nothing),
            "Register" => Some(Self::Register),
            "Free" => Some(Self::Free),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ErrorType {
    User = 0,
    Internal = 1,
    External = 2,
}
impl ErrorType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::User => "User",
            Self::Internal => "Internal",
            Self::External => "External",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "User" => Some(Self::User),
            "Internal" => Some(Self::Internal),
            "External" => Some(Self::External),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum WorkerStatus {
    Init = 0,
    Active = 1,
    Inactive = 2,
}
impl WorkerStatus {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Init => "INIT",
            Self::Active => "ACTIVE",
            Self::Inactive => "INACTIVE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "INIT" => Some(Self::Init),
            "ACTIVE" => Some(Self::Active),
            "INACTIVE" => Some(Self::Inactive),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ManageWorkerAction {
    Delete = 1,
    Isolate = 2,
    Activate = 3,
    UpdateAttribute = 4,
}
impl ManageWorkerAction {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Delete => "DELETE",
            Self::Isolate => "ISOLATE",
            Self::Activate => "ACTIVATE",
            Self::UpdateAttribute => "UPDATE_ATTRIBUTE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "DELETE" => Some(Self::Delete),
            "ISOLATE" => Some(Self::Isolate),
            "ACTIVATE" => Some(Self::Activate),
            "UPDATE_ATTRIBUTE" => Some(Self::UpdateAttribute),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ChecksumTypeProto {
    ChecksumNull = 0,
    ChecksumCrc32 = 1,
    ChecksumCrc32c = 2,
}
impl ChecksumTypeProto {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::ChecksumNull => "CHECKSUM_NULL",
            Self::ChecksumCrc32 => "CHECKSUM_CRC32",
            Self::ChecksumCrc32c => "CHECKSUM_CRC32C",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "CHECKSUM_NULL" => Some(Self::ChecksumNull),
            "CHECKSUM_CRC32" => Some(Self::ChecksumCrc32),
            "CHECKSUM_CRC32C" => Some(Self::ChecksumCrc32c),
            _ => None,
        }
    }
}