@@ -51,7 +51,7 @@ LoaderHarness::State LoaderHarness::state() const {
51
51
return state_;
52
52
}
53
53
54
- Status LoaderHarness::LoadRequested () {
54
+ absl:: Status LoaderHarness::LoadRequested () {
55
55
mutex_lock l (mu_);
56
56
57
57
if (state_ != State::kNew ) {
@@ -60,25 +60,25 @@ Status LoaderHarness::LoadRequested() {
60
60
state_ = State::kLoadRequested ;
61
61
VLOG (1 ) << " Load requested for servable version " << id_;
62
62
63
- return OkStatus ();
63
+ return absl:: OkStatus ();
64
64
}
65
65
66
- Status LoaderHarness::LoadApproved () {
66
+ absl:: Status LoaderHarness::LoadApproved () {
67
67
mutex_lock l (mu_);
68
68
TF_RETURN_IF_ERROR (
69
69
TransitionState (State::kLoadRequested , State::kLoadApproved ));
70
70
LOG (INFO) << " Approving load for servable version " << id_;
71
- return OkStatus ();
71
+ return absl:: OkStatus ();
72
72
}
73
73
74
- Status LoaderHarness::Load () {
74
+ absl:: Status LoaderHarness::Load () {
75
75
{
76
76
mutex_lock l (mu_);
77
77
TF_RETURN_IF_ERROR (TransitionState (State::kLoadApproved , State::kLoading ));
78
78
LOG (INFO) << " Loading servable version " << id_;
79
79
}
80
80
81
- const Status status = Retry (
81
+ const absl:: Status status = Retry (
82
82
strings::StrCat (" Loading servable: " , id_.DebugString ()),
83
83
options_.max_num_load_retries , options_.load_retry_interval_micros ,
84
84
[&]() { return loader_->LoadWithMetadata ({id_}); },
@@ -111,17 +111,17 @@ Status LoaderHarness::Load() {
111
111
return status;
112
112
}
113
113
114
- Status LoaderHarness::UnloadRequested () {
114
+ absl:: Status LoaderHarness::UnloadRequested () {
115
115
mutex_lock l (mu_);
116
116
if (state_ != State::kReady ) {
117
117
return errors::FailedPrecondition (
118
118
" Servable not loaded, or unload already requested/ongoing" );
119
119
}
120
120
state_ = State::kUnloadRequested ;
121
- return OkStatus ();
121
+ return absl:: OkStatus ();
122
122
}
123
123
124
- Status LoaderHarness::UnloadInternal (State from_state) {
124
+ absl:: Status LoaderHarness::UnloadInternal (State from_state) {
125
125
{
126
126
mutex_lock l (mu_);
127
127
TF_RETURN_IF_ERROR (TransitionState (from_state, State::kUnloading ));
@@ -135,10 +135,10 @@ Status LoaderHarness::UnloadInternal(State from_state) {
135
135
TF_RETURN_IF_ERROR (TransitionState (State::kUnloading , State::kDisabled ));
136
136
LOG (INFO) << " Done unloading servable version " << id_;
137
137
}
138
- return OkStatus ();
138
+ return absl:: OkStatus ();
139
139
}
140
140
141
- Status LoaderHarness::UnloadDueToCancelledLoad () {
141
+ absl:: Status LoaderHarness::UnloadDueToCancelledLoad () {
142
142
return UnloadInternal (State::kLoading );
143
143
}
144
144
@@ -153,24 +153,26 @@ bool LoaderHarness::should_retry(absl::Status status) {
153
153
return should_retry_ (status);
154
154
}
155
155
156
- Status LoaderHarness::Unload () { return UnloadInternal (State::kQuiesced ); }
156
+ absl::Status LoaderHarness::Unload () {
157
+ return UnloadInternal (State::kQuiesced );
158
+ }
157
159
158
- Status LoaderHarness::StartQuiescing () {
160
+ absl:: Status LoaderHarness::StartQuiescing () {
159
161
mutex_lock l (mu_);
160
162
TF_RETURN_IF_ERROR (
161
163
TransitionState (State::kUnloadRequested , State::kQuiescing ));
162
164
LOG (INFO) << " Quiescing servable version " << id_;
163
- return OkStatus ();
165
+ return absl:: OkStatus ();
164
166
}
165
167
166
- Status LoaderHarness::DoneQuiescing () {
168
+ absl:: Status LoaderHarness::DoneQuiescing () {
167
169
mutex_lock l (mu_);
168
170
TF_RETURN_IF_ERROR (TransitionState (State::kQuiescing , State::kQuiesced ));
169
171
LOG (INFO) << " Done quiescing servable version " << id_;
170
- return OkStatus ();
172
+ return absl:: OkStatus ();
171
173
}
172
174
173
- void LoaderHarness::ErrorInternal (const Status& status) {
175
+ void LoaderHarness::ErrorInternal (const absl:: Status& status) {
174
176
state_ = State::kError ;
175
177
status_ = status;
176
178
if (options_.error_callback ) {
@@ -180,14 +182,14 @@ void LoaderHarness::ErrorInternal(const Status& status) {
180
182
<< status_;
181
183
}
182
184
183
- void LoaderHarness::Error (const Status& status) {
185
+ void LoaderHarness::Error (const absl:: Status& status) {
184
186
mutex_lock l (mu_);
185
187
ErrorInternal (status);
186
188
}
187
189
188
- Status LoaderHarness::TransitionState (const State from, const State to) {
190
+ absl:: Status LoaderHarness::TransitionState (const State from, const State to) {
189
191
if (state_ != from) {
190
- const Status error = errors::Internal (
192
+ const absl:: Status error = errors::Internal (
191
193
" Illegal request to transition from state " , StateDebugString (state_),
192
194
" to " , StateDebugString (to));
193
195
#ifndef NDEBUG
@@ -198,10 +200,10 @@ Status LoaderHarness::TransitionState(const State from, const State to) {
198
200
return error;
199
201
}
200
202
state_ = to;
201
- return OkStatus ();
203
+ return absl:: OkStatus ();
202
204
}
203
205
204
- Status LoaderHarness::status () const {
206
+ absl:: Status LoaderHarness::status () const {
205
207
mutex_lock l (mu_);
206
208
return status_;
207
209
}
0 commit comments