@@ -104,8 +104,7 @@ public class StandaloneStarter extends BaseEngineStarter<StandaloneConfig> {
104
104
private EventCollectorManager eventCollectorMgr ;
105
105
private SettingProviderManager settingProviderMgr ;
106
106
private IAgentHost agentHost ;
107
- private ICRDTService clientCrdtService ;
108
- private ICRDTService serverCrdtService ;
107
+ private ICRDTService crdtService ;
109
108
private IRPCServer sharedIORpcServer ;
110
109
private IRPCServer sharedBaseKVRpcServer ;
111
110
private ISessionDictClient sessionDictClient ;
@@ -202,10 +201,8 @@ protected void init(StandaloneConfig config) {
202
201
agentHost = IAgentHost .newInstance (agentHostOptions );
203
202
agentHost .start ();
204
203
log .debug ("Agent host started" );
205
- clientCrdtService = ICRDTService .newInstance (CRDTServiceOptions .builder ().build ());
206
- clientCrdtService .start (agentHost );
207
- serverCrdtService = ICRDTService .newInstance (CRDTServiceOptions .builder ().build ());
208
- serverCrdtService .start (agentHost );
204
+ crdtService = ICRDTService .newInstance (CRDTServiceOptions .builder ().build ());
205
+ crdtService .start (agentHost );
209
206
log .debug ("CRDT service started" );
210
207
211
208
EventLoopGroup rpcServerBossELG =
@@ -225,14 +222,14 @@ protected void init(StandaloneConfig config) {
225
222
.port (config .getRpcServerConfig ().getPort ())
226
223
.bossEventLoopGroup (rpcServerBossELG )
227
224
.workerEventLoopGroup (ioRPCWorkerELG )
228
- .crdtService (serverCrdtService )
225
+ .crdtService (crdtService )
229
226
.executor (rpcServerExecutor );
230
227
RPCServerBuilder sharedBaseKVRPCServerBuilder = IRPCServer .newBuilder ()
231
228
.host (config .getBaseKVServerConfig ().getHost ())
232
229
.port (config .getBaseKVServerConfig ().getPort ())
233
230
.bossEventLoopGroup (rpcServerBossELG )
234
231
.workerEventLoopGroup (kvRPCWorkerELG )
235
- .crdtService (serverCrdtService )
232
+ .crdtService (crdtService )
236
233
.executor (baseKVServerExecutor );
237
234
if (config .getRpcServerConfig ().isEnableSSL ()) {
238
235
sharedIORPCServerBuilder .sslContext (buildRPCServerSslContext (config .getRpcServerConfig ().getSslConfig ()));
@@ -246,18 +243,18 @@ protected void init(StandaloneConfig config) {
246
243
SslContext baseKVClientSslContext = config .getBaseKVClientConfig ().isEnableSSL ()
247
244
? buildRPCClientSslContext (config .getBaseKVClientConfig ().getSslConfig ()) : null ;
248
245
distClient = IDistClient .newBuilder ()
249
- .crdtService (clientCrdtService )
246
+ .crdtService (crdtService )
250
247
.executor (rpcClientExecutor )
251
248
.sslContext (rpcClientSslContext )
252
249
.build ();
253
250
retainClient = IRetainClient .newBuilder ()
254
- .crdtService (clientCrdtService )
251
+ .crdtService (crdtService )
255
252
.executor (rpcClientExecutor )
256
253
.sslContext (rpcClientSslContext )
257
254
.build ();
258
255
retainStoreClient = IBaseKVStoreClient .newBuilder ()
259
256
.clusterId (IRetainStore .CLUSTER_NAME )
260
- .crdtService (clientCrdtService )
257
+ .crdtService (crdtService )
261
258
.executor (baseKVClientExecutor )
262
259
.sslContext (baseKVClientSslContext )
263
260
.queryPipelinesPerStore (config
@@ -269,7 +266,7 @@ protected void init(StandaloneConfig config) {
269
266
.rpcServerBuilder (sharedBaseKVRPCServerBuilder )
270
267
.bootstrap (config .isBootstrap ())
271
268
.agentHost (agentHost )
272
- .crdtService (serverCrdtService )
269
+ .crdtService (crdtService )
273
270
.storeClient (retainStoreClient )
274
271
.queryExecutor (MoreExecutors .directExecutor ())
275
272
.tickerThreads (config .getStateStoreConfig ().getTickerThreads ())
@@ -296,13 +293,13 @@ protected void init(StandaloneConfig config) {
296
293
.getWalEngineConfig (), "retain_wal" )))
297
294
.build ();
298
295
inboxClient = IInboxClient .newBuilder ()
299
- .crdtService (clientCrdtService )
296
+ .crdtService (crdtService )
300
297
.executor (rpcClientExecutor )
301
298
.sslContext (rpcClientSslContext )
302
299
.build ();
303
300
inboxStoreClient = IBaseKVStoreClient .newBuilder ()
304
301
.clusterId (IInboxStore .CLUSTER_NAME )
305
- .crdtService (clientCrdtService )
302
+ .crdtService (crdtService )
306
303
.executor (baseKVClientExecutor )
307
304
.sslContext (baseKVClientSslContext )
308
305
.queryPipelinesPerStore (config .getStateStoreConfig ().getInboxStoreConfig ()
@@ -312,7 +309,7 @@ protected void init(StandaloneConfig config) {
312
309
.rpcServerBuilder (sharedBaseKVRPCServerBuilder )
313
310
.bootstrap (config .isBootstrap ())
314
311
.agentHost (agentHost )
315
- .crdtService (serverCrdtService )
312
+ .crdtService (crdtService )
316
313
.inboxClient (inboxClient )
317
314
.storeClient (inboxStoreClient )
318
315
.settingProvider (settingProviderMgr )
@@ -354,7 +351,7 @@ protected void init(StandaloneConfig config) {
354
351
.build ();
355
352
distWorkerClient = IBaseKVStoreClient .newBuilder ()
356
353
.clusterId (IDistWorker .CLUSTER_NAME )
357
- .crdtService (clientCrdtService )
354
+ .crdtService (crdtService )
358
355
.executor (baseKVClientExecutor )
359
356
.sslContext (baseKVClientSslContext )
360
357
.queryPipelinesPerStore (config
@@ -363,15 +360,15 @@ protected void init(StandaloneConfig config) {
363
360
.getQueryPipelinePerStore ())
364
361
.build ();
365
362
mqttBrokerClient = IMqttBrokerClient .newBuilder ()
366
- .crdtService (clientCrdtService )
363
+ .crdtService (crdtService )
367
364
.executor (rpcClientExecutor )
368
365
.sslContext (rpcClientSslContext )
369
366
.build ();
370
367
371
368
subBrokerManager = new SubBrokerManager (pluginMgr , mqttBrokerClient , inboxClient );
372
369
373
370
sessionDictClient = ISessionDictClient .newBuilder ()
374
- .crdtService (clientCrdtService )
371
+ .crdtService (crdtService )
375
372
.executor (rpcClientExecutor )
376
373
.sslContext (rpcClientSslContext )
377
374
.build ();
@@ -390,7 +387,7 @@ protected void init(StandaloneConfig config) {
390
387
.rpcServerBuilder (sharedBaseKVRPCServerBuilder )
391
388
.bootstrap (config .isBootstrap ())
392
389
.agentHost (agentHost )
393
- .crdtService (serverCrdtService )
390
+ .crdtService (crdtService )
394
391
.eventCollector (eventCollectorMgr )
395
392
.resourceThrottler (resourceThrottlerMgr )
396
393
.distClient (distClient )
@@ -421,7 +418,7 @@ protected void init(StandaloneConfig config) {
421
418
422
419
distServer = IDistServer .nonStandaloneBuilder ()
423
420
.rpcServerBuilder (sharedIORPCServerBuilder )
424
- .crdtService (serverCrdtService )
421
+ .crdtService (crdtService )
425
422
.distWorkerClient (distWorkerClient )
426
423
.settingProvider (settingProviderMgr )
427
424
.eventCollector (eventCollectorMgr )
@@ -572,8 +569,7 @@ public void stop() {
572
569
sessionDictClient .stop ();
573
570
sessionDictServer .shutdown ();
574
571
575
- clientCrdtService .stop ();
576
- serverCrdtService .stop ();
572
+ crdtService .stop ();
577
573
578
574
agentHost .shutdown ();
579
575
0 commit comments