Skip to content

Commit 0e0425f

Browse files
committed
Replace GUARDED_BY with ABSL_GUARDED_BY in preparation for abseil upgraade
Signed-off-by: Dom Del Nano <ddelnano@gmail.com> (cherry picked from commit e368218)
1 parent 2ae9747 commit 0e0425f

File tree

6 files changed

+17
-16
lines changed

6 files changed

+17
-16
lines changed

src/carnot/exec/grpc_router.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,14 @@ class GRPCRouter final : public carnotpb::ResultSinkService::Service {
110110
*/
111111
struct SourceNodeTracker {
112112
SourceNodeTracker() = default;
113-
GRPCSourceNode* source_node GUARDED_BY(node_lock) = nullptr;
113+
GRPCSourceNode* source_node ABSL_GUARDED_BY(node_lock) = nullptr;
114114
// connection_initiated_by_sink and connection_closed_by_sink are true when the
115115
// grpc sink (aka the client) initiates the query result stream or closes a query result stream,
116116
// respectively.
117-
bool connection_initiated_by_sink GUARDED_BY(node_lock) = false;
118-
bool connection_closed_by_sink GUARDED_BY(node_lock) = false;
117+
bool connection_initiated_by_sink ABSL_GUARDED_BY(node_lock) = false;
118+
bool connection_closed_by_sink ABSL_GUARDED_BY(node_lock) = false;
119119
std::vector<std::unique_ptr<::px::carnotpb::TransferResultChunkRequest>> response_backlog
120-
GUARDED_BY(node_lock);
120+
ABSL_GUARDED_BY(node_lock);
121121
absl::base_internal::SpinLock node_lock;
122122
};
123123

@@ -126,17 +126,17 @@ class GRPCRouter final : public carnotpb::ResultSinkService::Service {
126126
*/
127127
struct QueryTracker {
128128
QueryTracker() : create_time(std::chrono::steady_clock::now()) {}
129-
absl::node_hash_map<int64_t, SourceNodeTracker> source_node_trackers GUARDED_BY(query_lock);
130-
const std::chrono::steady_clock::time_point create_time GUARDED_BY(query_lock);
131-
std::function<void()> restart_execution_func_ GUARDED_BY(query_lock);
129+
absl::node_hash_map<int64_t, SourceNodeTracker> source_node_trackers ABSL_GUARDED_BY(query_lock);
130+
const std::chrono::steady_clock::time_point create_time ABSL_GUARDED_BY(query_lock);
131+
std::function<void()> restart_execution_func_ ABSL_GUARDED_BY(query_lock);
132132
// The set of agents we've seen for the query.
133-
absl::flat_hash_set<sole::uuid> seen_agents GUARDED_BY(query_lock);
134-
absl::flat_hash_set<::grpc::ServerContext*> active_agent_contexts GUARDED_BY(query_lock);
133+
absl::flat_hash_set<sole::uuid> seen_agents ABSL_GUARDED_BY(query_lock);
134+
absl::flat_hash_set<::grpc::ServerContext*> active_agent_contexts ABSL_GUARDED_BY(query_lock);
135135
// The execution stats for agents that are clients to this service.
136-
std::vector<queryresultspb::AgentExecutionStats> agent_exec_stats GUARDED_BY(query_lock);
136+
std::vector<queryresultspb::AgentExecutionStats> agent_exec_stats ABSL_GUARDED_BY(query_lock);
137137

138138
// Errors that occur during execution from parent_agents.
139-
std::vector<statuspb::Status> upstream_exec_errors GUARDED_BY(query_lock);
139+
std::vector<statuspb::Status> upstream_exec_errors ABSL_GUARDED_BY(query_lock);
140140
absl::base_internal::SpinLock query_lock;
141141

142142
void ResetRestartExecutionFunc() ABSL_EXCLUSIVE_LOCKS_REQUIRED(query_lock) {
@@ -178,7 +178,7 @@ class GRPCRouter final : public carnotpb::ResultSinkService::Service {
178178
SourceNodeTracker* GetSourceNodeTracker(QueryTracker* query_tracker, int64_t source_id);
179179

180180
absl::node_hash_map<sole::uuid, std::shared_ptr<QueryTracker>> id_to_query_tracker_map_
181-
GUARDED_BY(id_to_query_tracker_map_lock_);
181+
ABSL_GUARDED_BY(id_to_query_tracker_map_lock_);
182182
mutable absl::base_internal::SpinLock id_to_query_tracker_map_lock_;
183183
};
184184

src/carnot/udf/borrow_pool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class BorrowPool {
6666
}
6767

6868
private:
69-
std::vector<StoredPtrType> pool_ GUARDED_BY(pool_lock_);
69+
std::vector<StoredPtrType> pool_ ABSL_GUARDED_BY(pool_lock_);
7070
absl::base_internal::SpinLock pool_lock_;
7171
};
7272

src/experimental/standalone_pem/sink_server.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ class StandaloneResultSinkServer final : public carnotpb::ResultSinkService::Ser
180180
}
181181

182182
absl::flat_hash_map<sole::uuid, ::grpc::ServerWriter<::px::api::vizierpb::ExecuteScriptResponse>*>
183-
consumer_map_ GUARDED_BY(id_to_query_consumer_map_lock_);
183+
consumer_map_ ABSL_GUARDED_BY(id_to_query_consumer_map_lock_);
184184
mutable absl::base_internal::SpinLock id_to_query_consumer_map_lock_;
185185
};
186186

src/stirling/source_connectors/socket_tracer/uprobe_manager.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#include <map>
2222
#include <memory>
23+
#include <mutex>
2324
#include <string>
2425
#include <utility>
2526
#include <vector>

src/vizier/services/agent/shared/manager/chan_cache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class ChanCache {
8383
};
8484

8585
// The cache of channels (grpc conns) made to other agents.
86-
absl::flat_hash_map<std::string, Channel> chan_cache_ GUARDED_BY(chan_cache_lock_);
86+
absl::flat_hash_map<std::string, Channel> chan_cache_ ABSL_GUARDED_BY(chan_cache_lock_);
8787
absl::base_internal::SpinLock chan_cache_lock_;
8888
// Connections that are alive for shorter than warm_up_period_ won't be cleared.
8989
std::chrono::nanoseconds warm_up_period_;

src/vizier/services/agent/shared/manager/relation_info_manager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class RelationInfoManager {
6565
private:
6666
mutable std::atomic<bool> has_updates_ = false;
6767
mutable absl::base_internal::SpinLock relation_info_map_lock_;
68-
absl::btree_map<std::string, RelationInfo> relation_info_map_ GUARDED_BY(relation_info_map_lock_);
68+
absl::btree_map<std::string, RelationInfo> relation_info_map_ ABSL_GUARDED_BY(relation_info_map_lock_);
6969
};
7070

7171
} // namespace agent

0 commit comments

Comments
 (0)