Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
z
Classes
Class List
Class Hierarchy
Class Members
All
:
[
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
[
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
Enumerations
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Properties
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Related Functions
:
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
grpc
src
core
ext
filters
client_channel
global_subchannel_pool.h
Go to the documentation of this file.
1
/*
2
*
3
* Copyright 2018 gRPC authors.
4
*
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
* you may not use this file except in compliance with the License.
7
* You may obtain a copy of the License at
8
*
9
* http://www.apache.org/licenses/LICENSE-2.0
10
*
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
16
*
17
*/
18
19
#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_GLOBAL_SUBCHANNEL_POOL_H
20
#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_GLOBAL_SUBCHANNEL_POOL_H
21
22
#include <
grpc/support/port_platform.h
>
23
24
#include <map>
25
26
#include "absl/base/thread_annotations.h"
27
28
#include "
src/core/ext/filters/client_channel/subchannel_pool_interface.h
"
29
#include "
src/core/lib/gprpp/ref_counted_ptr.h
"
30
#include "
src/core/lib/gprpp/sync.h
"
31
32
namespace
grpc_core
{
33
34
// The global subchannel pool. It shares subchannels among channels. There
35
// should be only one instance of this class.
36
class
GlobalSubchannelPool
final :
public
SubchannelPoolInterface
{
37
public
:
38
// Gets the singleton instance.
39
static
RefCountedPtr<GlobalSubchannelPool>
instance
();
40
41
// Implements interface methods.
42
RefCountedPtr<Subchannel>
RegisterSubchannel
(
43
const
SubchannelKey
&
key
,
RefCountedPtr<Subchannel>
constructed)
override
44
ABSL_LOCKS_EXCLUDED
(
mu_
);
45
void
UnregisterSubchannel
(
const
SubchannelKey
&
key
,
46
Subchannel
*
subchannel
)
override
47
ABSL_LOCKS_EXCLUDED
(
mu_
);
48
RefCountedPtr<Subchannel>
FindSubchannel
(
const
SubchannelKey
&
key
)
override
49
ABSL_LOCKS_EXCLUDED
(
mu_
);
50
51
private
:
52
GlobalSubchannelPool
() {}
53
~GlobalSubchannelPool
()
override
{}
54
55
// A map from subchannel key to subchannel.
56
std::map<SubchannelKey, Subchannel*> subchannel_map_
ABSL_GUARDED_BY
(
mu_
);
57
// To protect subchannel_map_.
58
Mutex
mu_
;
59
};
60
61
}
// namespace grpc_core
62
63
#endif
/* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_GLOBAL_SUBCHANNEL_POOL_H */
grpc_core::GlobalSubchannelPool::RegisterSubchannel
RefCountedPtr< Subchannel > RegisterSubchannel(const SubchannelKey &key, RefCountedPtr< Subchannel > constructed) override ABSL_LOCKS_EXCLUDED(mu_)
Definition:
global_subchannel_pool.cc:34
grpc_core::GlobalSubchannelPool::UnregisterSubchannel
void UnregisterSubchannel(const SubchannelKey &key, Subchannel *subchannel) override ABSL_LOCKS_EXCLUDED(mu_)
Definition:
global_subchannel_pool.cc:46
grpc_core::GlobalSubchannelPool::GlobalSubchannelPool
GlobalSubchannelPool()
Definition:
global_subchannel_pool.h:52
grpc_core
Definition:
call_metric_recorder.h:31
grpc_core::GlobalSubchannelPool::ABSL_GUARDED_BY
std::map< SubchannelKey, Subchannel * > subchannel_map_ ABSL_GUARDED_BY(mu_)
subchannel
RingHashSubchannelData * subchannel
Definition:
ring_hash.cc:285
subchannel_pool_interface.h
grpc_core::RefCountedPtr
Definition:
ref_counted_ptr.h:35
grpc_core::GlobalSubchannelPool
Definition:
global_subchannel_pool.h:36
grpc_core::GlobalSubchannelPool::instance
static RefCountedPtr< GlobalSubchannelPool > instance()
Definition:
global_subchannel_pool.cc:29
grpc_core::GlobalSubchannelPool::FindSubchannel
RefCountedPtr< Subchannel > FindSubchannel(const SubchannelKey &key) override ABSL_LOCKS_EXCLUDED(mu_)
Definition:
global_subchannel_pool.cc:57
grpc_core::GlobalSubchannelPool::~GlobalSubchannelPool
~GlobalSubchannelPool() override
Definition:
global_subchannel_pool.h:53
grpc_core::SubchannelKey
Definition:
subchannel_pool_interface.h:40
grpc_core::Mutex
Definition:
src/core/lib/gprpp/sync.h:61
grpc_core::Subchannel
Definition:
subchannel.h:166
key
const char * key
Definition:
hpack_parser_table.cc:164
grpc_core::SubchannelPoolInterface
Definition:
subchannel_pool_interface.h:76
ABSL_LOCKS_EXCLUDED
#define ABSL_LOCKS_EXCLUDED(...)
Definition:
abseil-cpp/absl/base/thread_annotations.h:163
ref_counted_ptr.h
grpc_core::GlobalSubchannelPool::mu_
Mutex mu_
Definition:
global_subchannel_pool.h:58
sync.h
port_platform.h
grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:59:26