Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions cpp/src/arrow/compute/exec/aggregate_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,34 +60,6 @@ Result<FieldVector> ResolveKernels(

namespace {

class ThreadIndexer {
public:
size_t operator()() {
auto id = std::this_thread::get_id();

std::unique_lock<std::mutex> lock(mutex_);
const auto& id_index = *id_to_index_.emplace(id, id_to_index_.size()).first;

return Check(id_index.second);
}

static size_t Capacity() {
static size_t max_size = arrow::internal::ThreadPool::DefaultCapacity();
return max_size;
}

private:
size_t Check(size_t thread_index) {
DCHECK_LT(thread_index, Capacity()) << "thread index " << thread_index
<< " is out of range [0, " << Capacity() << ")";

return thread_index;
}

std::mutex mutex_;
std::unordered_map<std::thread::id, size_t> id_to_index_;
};

void AggregatesToString(
std::stringstream* ss, const Schema& input_schema,
const std::vector<internal::Aggregate>& aggs,
Expand Down