Skip to content

Commit d170647

Browse files
committed
rename context_base inactive() to aborted()
1 parent ddd0fdd commit d170647

File tree

18 files changed

+23
-23
lines changed

18 files changed

+23
-23
lines changed

src/jogasaki/executor/process/impl/ops/aggregate_group.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ operation_status aggregate_group::operator()(
158158
bool last_member,
159159
abstract::task_context* context
160160
) {
161-
if (ctx.inactive()) {
161+
if (ctx.aborted()) {
162162
return {operation_status_kind::aborted};
163163
}
164164
for(std::size_t i=0, n=arguments_.size(); i < n; ++i) {
@@ -215,7 +215,7 @@ operator_kind aggregate_group::kind() const noexcept {
215215
void aggregate_group::finish(abstract::task_context* context) {
216216
auto& ctx = *create_context_if_not_found(context);
217217
context_helper helper{*context};
218-
if (ctx.inactive()) {
218+
if (ctx.aborted()) {
219219
return;
220220
}
221221
if (helper.empty_input_from_shuffle()) {

src/jogasaki/executor/process/impl/ops/apply.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ operation_status apply::process_record(abstract::task_context* context) {
9595
}
9696

9797
operation_status apply::operator()(apply_context& ctx, abstract::task_context* context) { //NOLINT(readability-function-cognitive-complexity)
98-
if (ctx.inactive()) {
98+
if (ctx.aborted()) {
9999
return {operation_status_kind::aborted};
100100
}
101101

src/jogasaki/executor/process/impl/ops/context_base.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class request_context* context_base::req_context() noexcept {
9494
}
9595

9696
void context_base::abort() noexcept {
97-
state(context_state::abort);
97+
state(context_state::aborted);
9898
}
9999

100100
void context_base::dump() const noexcept {

src/jogasaki/executor/process/impl/ops/context_base.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ enum class context_state {
3737
/**
3838
* @brief the operator with this context met error and is aborting/aborted
3939
*/
40-
abort,
40+
aborted,
4141
};
4242

4343
/**
@@ -49,7 +49,7 @@ enum class context_state {
4949
using namespace std::string_view_literals;
5050
switch (state) {
5151
case context_state::active: return "active"sv;
52-
case context_state::abort: return "abort"sv;
52+
case context_state::aborted: return "aborted"sv;
5353
}
5454
std::abort();
5555
}
@@ -166,10 +166,10 @@ class context_base {
166166
void abort() noexcept;
167167

168168
/**
169-
* @brief update the context state aborted
169+
* @brief returns whether the context state is aborted
170170
*/
171-
[[nodiscard]] bool inactive() const noexcept {
172-
return state_ != context_state::active;
171+
[[nodiscard]] bool aborted() const noexcept {
172+
return state_ == context_state::aborted;
173173
}
174174

175175
/**

src/jogasaki/executor/process/impl/ops/emit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ operation_status emit::process_record(abstract::task_context *context) {
7878
}
7979

8080
operation_status emit::operator()(emit_context &ctx) {
81-
if (ctx.inactive()) {
81+
if (ctx.aborted()) {
8282
return {operation_status_kind::aborted};
8383
}
8484
auto target = ctx.buffer_.ref();

src/jogasaki/executor/process/impl/ops/filter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ operation_status filter::process_record(abstract::task_context* context) {
6565
}
6666

6767
operation_status filter::operator()(filter_context& ctx, abstract::task_context* context) {
68-
if (ctx.inactive()) {
68+
if (ctx.aborted()) {
6969
return {operation_status_kind::aborted};
7070
}
7171
auto& vars = ctx.input_variables();

src/jogasaki/executor/process/impl/ops/find.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ operation_status find::call_downstream(
160160
}
161161

162162
operation_status find::operator()(class find_context& ctx, abstract::task_context* context) { //NOLINT(readability-function-cognitive-complexity)
163-
if (ctx.inactive()) {
163+
if (ctx.aborted()) {
164164
return {operation_status_kind::aborted};
165165
}
166166
if(utils::request_cancel_enabled(request_cancel_kind::find) && ctx.req_context()) {

src/jogasaki/executor/process/impl/ops/flatten.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ operation_status flatten::process_group(abstract::task_context* context, bool la
5858
}
5959

6060
operation_status flatten::operator()(flatten_context& ctx, abstract::task_context* context) {
61-
if (ctx.inactive()) {
61+
if (ctx.aborted()) {
6262
return {operation_status_kind::aborted};
6363
}
6464
if (downstream_) {

src/jogasaki/executor/process/impl/ops/index_join.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ class index_join : public record_operator {
325325
* @return status of the operation
326326
*/
327327
operation_status operator()(index_join_context<MatchInfo>& ctx, abstract::task_context* context = nullptr) { //NOLINT(readability-function-cognitive-complexity)
328-
if (ctx.inactive()) {
328+
if (ctx.aborted()) {
329329
return {operation_status_kind::aborted};
330330
}
331331
auto resource = ctx.varlen_resource();

src/jogasaki/executor/process/impl/ops/join.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ class join : public cogroup_operator<Iterator> {
201201
constexpr static std::size_t primary_group_index = 0;
202202
constexpr static std::size_t secondary_group_index = 1;
203203

204-
if (ctx.inactive()) {
204+
if (ctx.aborted()) {
205205
return {operation_status_kind::aborted};
206206
}
207207
std::size_t n = cgrp.groups().size();

0 commit comments

Comments
 (0)