forked from irods/irods_capability_storage_tiering
-
Notifications
You must be signed in to change notification settings - Fork 0
/
storage_tiering.hpp
186 lines (146 loc) · 6.16 KB
/
storage_tiering.hpp
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
#ifndef IRODS_STORAGE_TIERING_HPP
#define IRODS_STORAGE_TIERING_HPP
#include <list>
#include <boost/any.hpp>
#include <string>
#include <irods/rcMisc.h>
#include "storage_tiering_configuration.hpp"
namespace irods {
using resource_index_map = std::map<std::string, std::string>;
class storage_tiering {
public:
struct policy {
static const std::string storage_tiering;
static const std::string data_movement;
static const std::string access_time;
};
struct schedule {
static const std::string storage_tiering;
static const std::string data_movement;
};
storage_tiering(
rcComm_t* _comm,
ruleExecInfo_t* _rei,
const std::string& _instance_name);
void apply_policy_for_tier_group(
const std::string& _group);
void migrate_object_to_minimum_restage_tier(
const std::string& _object_path,
const std::string& _user_name,
const std::string& _user_zone,
const std::string& _source_resource);
void schedule_storage_tiering_policy(
const std::string& _json,
const std::string& _params);
void apply_tier_group_metadata_to_object(
const std::string& _group_name,
const std::string& _object_path,
const std::string& _user_name,
const std::string& _user_zone,
const std::string& _source_replica_number,
const std::string& _source_resource,
const std::string& _destination_resource);
private:
void set_migration_metadata_flag_for_object(
rcComm_t* _comm,
const std::string& _user_name,
const std::string& _user_zone,
const std::string& _object_path);
void unset_migration_metadata_flag_for_object(
rcComm_t* _comm,
const std::string& _user_name,
const std::string& _user_zone,
const std::string& _object_path);
bool object_has_migration_metadata_flag(
rcComm_t* _comm,
const std::string& _user_name,
const std::string& _user_zone,
const std::string& _object_path);
bool skip_object_in_lower_tier(
rcComm_t* _comm,
const std::string& _object_path,
const std::string& _partial_list);
std::string make_partial_list(
resource_index_map::iterator _itr,
resource_index_map::iterator _end);
void update_access_time_for_data_object(
const std::string& _object_path);
std::string get_metadata_for_data_object(
rcComm_t* _comm,
const std::string& _meta_attr_name,
const std::string& _object_path);
std::string get_metadata_for_resource(
rcComm_t* _comm,
const std::string& _meta_attr_name,
const std::string& _resource_name);
typedef std::vector<std::pair<std::string, std::string>> metadata_results;
void get_metadata_for_resource(
rcComm_t* _comm,
const std::string& _meta_attr_name,
const std::string& _resource_name,
metadata_results& _results);
resource_index_map
get_tier_group_resource_ids_and_indices(
rcComm_t* _comm,
const std::string& _group_name);
std::string get_leaf_resources_string(
const std::string& _resource_name);
bool get_preserve_replicas_for_resc(
rcComm_t* _comm,
const std::string& _source_resource);
std::string get_verification_for_resc(
rcComm_t* _comm,
const std::string& _resource_name);
std::string get_restage_tier_resource_name(
rcComm_t* _comm,
const std::string& _resource_name);
std::string get_data_movement_parameters_for_resource(
rcComm_t* _comm,
const std::string& _resource_name);
std::string get_replica_number_for_resource(
rcComm_t* _comm,
const std::string& _object_path,
const std::string& _resource_name);
std::string get_group_name_for_object(
rcComm_t* _comm,
const std::string& _attribute_name,
const std::string& _object_path);
resource_index_map
get_resource_map_for_group(
rcComm_t* _comm,
const std::string& _group);
std::string get_tier_time_for_resc(
rcComm_t* _comm,
const std::string& _resource_name);
metadata_results get_violating_queries_for_resource(
rcComm_t* _comm,
const std::string& _resource_name);
uint32_t get_object_limit_for_resource(
rcComm_t* _comm,
const std::string& _resource_name);
void queue_data_movement(
rcComm_t* _comm,
const std::string& _plugin_instance_name,
const std::string& _group_name,
const std::string& _object_path,
const std::string& _user_name,
const std::string& _user_zone,
const std::string& _source_replica_number,
const std::string& _source_resource,
const std::string& _destination_resource,
const std::string& _verification_type,
const bool _preserve_replicas,
const std::string& _data_movement_params);
void migrate_violating_data_objects(
rcComm_t* _comm,
const std::string& _group_name,
const std::string& _partial_list,
const std::string& _source_resource,
const std::string& _destination_resource);
// Attributes
ruleExecInfo_t* rei_;
rcComm_t* comm_;
storage_tiering_configuration config_;
}; // class storage_tiering
}; // namespace irods
#endif // IRODS_STORAGE_TIERING_HPP