8000 clean up BlocksWithClients (#17879) · cloudhub-js/arangodb@b65c773 · GitHub
[go: up one dir, main page]

Skip to content

Commit b65c773

Browse files
authored
clean up BlocksWithClients (arangodb#17879)
1 parent a7169c2 commit b65c773

File tree

3 files changed

+3
-66
lines changed

3 files changed

+3
-66
lines changed

arangod/Aql/AqlCall.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -121,22 +121,6 @@ struct AqlCall {
121121
/*hardLimit*/ AqlCall::Infinity{}, /*fullCount*/ false};
122122
}
123123

124-
// TODO Remove me, this will not be necessary later
125-
static bool IsSkipSomeCall(AqlCall const& call) noexcept {
126-
return call.getOffset() > 0;
127-
}
128-
129-
// TODO Remove me, this will not be necessary later
130-
static bool IsGetSomeCall(AqlCall const& call) noexcept {
131-
return call.getLimit() > 0 && call.getOffset() == 0;
132-
}
133-
134-
// TODO Remove me, this will not be necessary later
135-
static bool IsFullCountCall(AqlCall const& call) noexcept {
136-
return call.hasHardLimit() && call.getLimit() == 0 &&
137-
call.getOffset() == 0 && call.needsFullCount();
138-
}
139-
140124
static bool IsFastForwardCall(AqlCall const& call) noexcept {
141125
return call.hasHardLimit() && call.getLimit() == 0 &&
142126
call.getOffset() == 0 && !call.needsFullCount();

arangod/Aql/BlocksWithClients.cpp

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ BlocksWithClientsImpl<Executor>::BlocksWithClientsImpl(
8080
RegisterInfos registerInfos, typename Executor::Infos executorInfos)
8181
: ExecutionBlock(engine, ep),
8282
BlocksWithClients(),
83-
_nrClients(executorInfos.nrClients()),
8483
_type(ScatterNode::ScatterType::SHARD),
8584
_registerInfos(std::move(registerInfos)),
8685
_executorInfos(std::move(executorInfos)),
8786
_executor{_executorInfos},
8887
_clientBlockData{} {
89-
_shardIdMap.reserve(_nrClients);
88+
size_t nrClients = executorInfos.nrClients();
89+
_shardIdMap.reserve(nrClients);
9090
auto const& shardIds = _executorInfos.clientIds();
91-
for (size_t i = 0; i < _nrClients; i++) {
91+
for (size_t i = 0; i < nrClients; i++) {
9292
_shardIdMap.try_emplace(shardIds[i], i);
9393
}
9494

@@ -273,30 +273,6 @@ auto BlocksWithClientsImpl<Executor>::fetchMore(AqlCallStack stack)
273273
return state;
274274
}
275275

276-
/// @brief getSomeForShard
277-
/// @deprecated
278-
template<class Executor>
279-
std::pair<ExecutionState, SharedAqlItemBlockPtr>
280-
BlocksWithClientsImpl<Executor>::getSomeForShard(size_t atMost,
281-
std::string const& shardId) {
282-
AqlCallStack stack(AqlCallList{AqlCall::SimulateGetSome(atMost)});
283-
auto [state, skipped, block] = executeForClient(std::move(stack), shardId);
284-
TRI_ASSERT(skipped.nothingSkipped());
285-
return {state, std::move(block)};
286-
}
287-
288-
/// @brief skipSomeForShard
289-
/// @deprecated
290-
template<class Executor>
291-
std::pair<ExecutionState, size_t>
292-
BlocksWithClientsImpl<Executor>::skipSomeForShard(size_t atMost,
293-
std::string const& shardId) {
294-
AqlCallStack stack(AqlCallList{AqlCall::SimulateSkipSome(atMost)});
295-
auto [state, skipped, block] = executeForClient(std::move(stack), shardId);
296-
TRI_ASSERT(block == nullptr);
297-
return {state, skipped.getSkipCount()};
298-
}
299-
300276
template class ::arangodb::aql::BlocksWithClientsImpl<ScatterExecutor>;
301277
template class ::arangodb::aql::BlocksWithClientsImpl<DistributeExecutor>;
302278
template class ::arangodb::aql::BlocksWithClientsImpl<MutexExecutor>;

arangod/Aql/BlocksWithClients.h

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,6 @@ class BlocksWithClients {
6969
public:
7070
virtual ~BlocksWithClients() = default;
7171

72-
/// @brief getSomeForShard
73-
/// @deprecated
74-
virtual std::pair<ExecutionState, SharedAqlItemBlockPtr> getSomeForShard(
75-
size_t atMost, std::string const& shardId) = 0;
76-
77-
/// @brief skipSomeForShard
78-
/// @deprecated
79-
virtual std::pair<ExecutionState, size_t> skipSomeForShard(
80-
size_t atMost, std::string const& shardId) = 0;
81-
8272
/**
8373
* @brief Execute for client.
8474
* Like execute, but bound to the dataset, that needs to be send to the given
@@ -156,16 +146,6 @@ class BlocksWithClientsImpl : public ExecutionBlock, public BlocksWithClients {
156146
*/
157147
auto fetchMore(AqlCallStack stack) -> ExecutionState;
158148

159-
/// @brief getSomeForShard
160-
/// @deprecated
161-
std::pair<ExecutionState, SharedAqlItemBlockPtr> getSomeForShard(
162-
size_t atMost, std::string const& shardId) override;
163-
164-
/// @brief skipSomeForShard
165-
/// @deprecated
166-
std::pair<ExecutionState, size_t> skipSomeForShard(
167-
size_t atMost, std::string const& shardId) override;
168-
169149
protected:
170150
/// @brief getClientId: get the number <clientId> (used internally)
171151
/// corresponding to <shardId>
@@ -175,9 +155,6 @@ class BlocksWithClientsImpl : public ExecutionBlock, public BlocksWithClients {
175155
/// @deprecated
176156
std::unordered_map<std::string, size_t> _shardIdMap;
177157

178-
/// @brief _nrClients: total number of clients
179-
size_t _nrClients;
180-
181158
/// @brief type of distribution that this nodes follows.
182159
ScatterNode::ScatterType _type;
183160

0 commit comments

Comments
 (0)
0