Skip to content

Commit a95eb96

Browse files
authored
Refactor[mqbi::Cluster]: remove unused StateObserver APIs (#826)
Signed-off-by: Evgeny Malygin <emalygin@bloomberg.net>
1 parent cb23e4e commit a95eb96

7 files changed

Lines changed: 0 additions & 103 deletions

File tree

src/groups/mqb/mqbblp/mqbblp_cluster.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2714,28 +2714,6 @@ void Cluster::terminate(mqbu::ExitCode::Enum reason)
27142714
mqbu::ExitUtil::shutdown(reason); // EXIT
27152715
}
27162716

2717-
void Cluster::registerStateObserver(mqbc::ClusterStateObserver* observer)
2718-
{
2719-
// executed by *ANY* thread
2720-
2721-
dispatcher()->execute(
2722-
bdlf::BindUtil::bind(&mqbc::ClusterState::registerObserver,
2723-
&d_state,
2724-
observer),
2725-
this);
2726-
}
2727-
2728-
void Cluster::unregisterStateObserver(mqbc::ClusterStateObserver* observer)
2729-
{
2730-
// executed by *ANY* thread
2731-
2732-
dispatcher()->execute(
2733-
bdlf::BindUtil::bind(&mqbc::ClusterState::unregisterObserver,
2734-
&d_state,
2735-
observer),
2736-
this);
2737-
}
2738-
27392717
void Cluster::openQueue(
27402718
const bmqt::Uri& uri,
27412719
mqbi::Domain* domain,

src/groups/mqb/mqbblp/mqbblp_cluster.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -550,16 +550,6 @@ class Cluster : public mqbi::Cluster,
550550
/// Stop the `Cluster`.
551551
void stop() BSLS_KEYWORD_OVERRIDE;
552552

553-
/// Register the specified `observer` to be notified of cluster state
554-
/// changes.
555-
void registerStateObserver(mqbc::ClusterStateObserver* observer)
556-
BSLS_KEYWORD_OVERRIDE;
557-
558-
/// Un-register the specified `observer` from being notified of cluster
559-
/// state changes.
560-
void unregisterStateObserver(mqbc::ClusterStateObserver* observer)
561-
BSLS_KEYWORD_OVERRIDE;
562-
563553
/// Open the queue with the specified `uri`, belonging to the specified
564554
/// `domain` with the specified `parameters` from a client identified
565555
/// with the specified `clientContext`. Invoke the specified `callback`

src/groups/mqb/mqbblp/mqbblp_clusterproxy.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,28 +1201,6 @@ void ClusterProxy::stop()
12011201
dispatcher()->synchronize(this);
12021202
}
12031203

1204-
void ClusterProxy::registerStateObserver(
1205-
BSLA_UNUSED mqbc::ClusterStateObserver* observer)
1206-
{
1207-
// executed by *ANY* thread
1208-
1209-
// NOTHING
1210-
//
1211-
// TODO_CSL Register the observer to 'dummy state' after it becomes the
1212-
// true state.
1213-
}
1214-
1215-
void ClusterProxy::unregisterStateObserver(
1216-
BSLA_UNUSED mqbc::ClusterStateObserver* observer)
1217-
{
1218-
// executed by *ANY* thread
1219-
1220-
// NOTHING
1221-
//
1222-
// TODO_CSL Register the observer to 'dummy state' after it becomes the
1223-
// true state.
1224-
}
1225-
12261204
void ClusterProxy::openQueue(
12271205
const bmqt::Uri& uri,
12281206
mqbi::Domain* domain,

src/groups/mqb/mqbblp/mqbblp_clusterproxy.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -462,16 +462,6 @@ class ClusterProxy : public mqbc::ClusterStateObserver,
462462
/// used by this cluster.
463463
mqbnet::Cluster& netCluster() BSLS_KEYWORD_OVERRIDE;
464464

465-
/// Register the specified `observer` to be notified of cluster state
466-
/// changes.
467-
void registerStateObserver(mqbc::ClusterStateObserver* observer)
468-
BSLS_KEYWORD_OVERRIDE;
469-
470-
/// Un-register the specified `observer` from being notified of cluster
471-
/// state changes.
472-
void unregisterStateObserver(mqbc::ClusterStateObserver* observer)
473-
BSLS_KEYWORD_OVERRIDE;
474-
475465
/// Open the queue with the specified `uri`, belonging to the specified
476466
/// `domain` with the specified `parameters` from a client identified
477467
/// with the specified `clientContext`. Invoke the specified `callback`

src/groups/mqb/mqbi/mqbi_cluster.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@ class FixedThreadPool;
7070
namespace bmqt {
7171
class Uri;
7272
}
73-
namespace mqbc {
74-
class ClusterStateObserver;
75-
}
7673
namespace mqbcmd {
7774
class ClusterCommand;
7875
}
@@ -290,16 +287,6 @@ class Cluster : public DispatcherClient {
290287
// manager used by this cluster.
291288
virtual MultiRequestManagerType& multiRequestManager() = 0;
292289

293-
/// Register the specified `observer` to be notified of cluster state
294-
/// changes.
295-
virtual void
296-
registerStateObserver(mqbc::ClusterStateObserver* observer) = 0;
297-
298-
/// Un-register the specified `observer` from being notified of cluster
299-
/// state changes.
300-
virtual void
301-
unregisterStateObserver(mqbc::ClusterStateObserver* observer) = 0;
302-
303290
/// Send the specified `request` with the specified `timeout` to the
304291
/// specified `target` node. If `target` is 0, it is the Cluster's
305292
/// implementation responsibility to decide which node to use (in

src/groups/mqb/mqbmock/mqbmock_cluster.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -369,22 +369,6 @@ void Cluster::stop()
369369
d_isStarted = false;
370370
}
371371

372-
void Cluster::registerStateObserver(
373-
BSLA_UNUSED mqbc::ClusterStateObserver* observer)
374-
{
375-
// executed by *ANY* thread
376-
377-
// NOTHING
378-
}
379-
380-
void Cluster::unregisterStateObserver(
381-
BSLA_UNUSED mqbc::ClusterStateObserver* observer)
382-
{
383-
// executed by *ANY* thread
384-
385-
// NOTHING
386-
}
387-
388372
mqbnet::Cluster& Cluster::netCluster()
389373
{
390374
return *(d_clusterData_mp->membership().netCluster());

src/groups/mqb/mqbmock/mqbmock_cluster.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -315,16 +315,6 @@ class Cluster : public mqbi::Cluster {
315315
/// Stop the `Cluster`.
316316
void stop() BSLS_KEYWORD_OVERRIDE;
317317

318-
/// Register the specified `observer` to be notified of cluster state
319-
/// changes.
320-
void registerStateObserver(mqbc::ClusterStateObserver* observer)
321-
BSLS_KEYWORD_OVERRIDE;
322-
323-
/// Un-register the specified `observer` from being notified of cluster
324-
/// state changes.
325-
void unregisterStateObserver(mqbc::ClusterStateObserver* observer)
326-
BSLS_KEYWORD_OVERRIDE;
327-
328318
/// Return a reference offering modifiable access to the net cluster
329319
/// used by this cluster.
330320
mqbnet::Cluster& netCluster() BSLS_KEYWORD_OVERRIDE;

0 commit comments

Comments
 (0)