@@ -207,6 +207,9 @@ public class cfgCarbonJ
207207 @ Value ("${metrics.store.sync.secondary.db:false}" )
208208 private boolean syncSecondaryDb ;
209209
210+ @ Value ("${carbonj.env:dev}" )
211+ private String carbonjEnv ;
212+
210213 @ Bean
211214 public RestTemplate restTemplate () {
212215 return new RestTemplate ();
@@ -424,7 +427,7 @@ Consumers consumer( PointProcessor pointProcessor,
424427 File rulesFile = locateConfigFile ( serviceDir , consumerRulesFile );
425428 Consumers consumer = new Consumers ( metricRegistry , pointProcessor , recoveryPointProcessor , rulesFile ,
426429 kinesisConfig , checkPointMgr , kinesisConsumerRegion ,
427- nsCounter , dataDir == null ? null : new File (dataDir , "index-name-sync" ));
430+ nsCounter , dataDir == null ? null : new File (dataDir , "index-name-sync" ), carbonjEnv );
428431 s .scheduleWithFixedDelay ( consumer ::reload , 15 , 30 , TimeUnit .SECONDS );
429432 if (syncSecondaryDb ) {
430433 s .scheduleWithFixedDelay ( consumer ::syncNamespaces , 60 , 60 , TimeUnit .SECONDS );
@@ -468,8 +471,7 @@ Void checkExpiredNamespaces( ScheduledExecutorService s, NamespaceCounter ns )
468471 {
469472 if ( runInactiveNamespaceCheckEverySeconds > 0 )
470473 {
471- log .info ( String .format ( "scheduling removal of expired namespace counters to run every %s sec" ,
472- runInactiveNamespaceCheckEverySeconds ) );
474+ log .info ("scheduling removal of expired namespace counters to run every {} sec" , runInactiveNamespaceCheckEverySeconds );
473475 s .scheduleWithFixedDelay ( ns ::removeInactive , 120 , runInactiveNamespaceCheckEverySeconds ,
474476 TimeUnit .SECONDS );
475477 }
@@ -506,16 +508,14 @@ Void checkExpiredNamespaces( ScheduledExecutorService s, NamespaceCounter ns )
506508 NettyChannel lineProtocolChannel ( NettyServer netty , InputQueue r )
507509 {
508510 lineProtocolTcpPort = ( lineProtocolTcpPort == -1 ) ? jettyPort + 2 : lineProtocolTcpPort ;
509- return netty .bind ( lineProtocolTcpHost , lineProtocolTcpPort , new ChannelInitializer <SocketChannel >()
510- {
511- @ Override public void initChannel (@ SuppressWarnings ("NullableProblems" ) SocketChannel ch )
512- {
513- if ( log .isDebugEnabled () )
514- {
515- log .debug ( "accepted TCP line protocol from " + ch );
511+ return netty .bind ( lineProtocolTcpHost , lineProtocolTcpPort , new ChannelInitializer <>() {
512+ @ Override
513+ public void initChannel (SocketChannel ch ) {
514+ if (log .isDebugEnabled ()) {
515+ log .debug ("accepted TCP line protocol from {}" , ch );
516516 }
517- ch .pipeline ().addLast ( new DelimiterBasedFrameDecoder ( tcpBuff , Delimiters .lineDelimiter () ),
518- new LineProtocolHandler ( metricRegistry , r ) );
517+ ch .pipeline ().addLast (new DelimiterBasedFrameDecoder (tcpBuff , Delimiters .lineDelimiter ()),
518+ new LineProtocolHandler (metricRegistry , r ) );
519519 }
520520 } );
521521 }
@@ -536,7 +536,7 @@ NettyChannel udpLineProtocolChannel( NettyServer netty, InputQueue r )
536536 NettyServer .udpMsgsReceived .mark ();
537537 if ( log .isDebugEnabled () )
538538 {
539- log .debug ( "accepted UDP line protocol from " + ctx .channel () );
539+ log .debug ("accepted UDP line protocol from {}" , ctx .channel ());
540540 }
541541 lp .process ( msg .content () );
542542 }
@@ -551,13 +551,13 @@ NettyChannel udpLineProtocolChannel( NettyServer netty, InputQueue r )
551551 @ ConditionalOnProperty (name = "carbonj.relay" , havingValue = "true" , matchIfMissing = true )
552552 NettyChannel pickleProtocolChannel ( NettyServer netty , InputQueue r )
553553 {
554- return netty .bind ( "0.0.0.0" , jettyPort + 3 , new ChannelInitializer <SocketChannel >()
554+ return netty .bind ( "0.0.0.0" , jettyPort + 3 , new ChannelInitializer <>()
555555 {
556- @ Override public void initChannel (@ SuppressWarnings ( "NullableProblems" ) SocketChannel ch )
556+ @ Override public void initChannel (SocketChannel ch )
557557 {
558558 if ( log .isDebugEnabled () )
559559 {
560- log .debug ( "accepted pickle protocol from " + ch );
560+ log .debug ("accepted pickle protocol from {}" , ch );
561561 }
562562
563563 ch .pipeline ().addLast ( new LengthFieldBasedFrameDecoder ( pickleBuff , 0 , 4 ) )
@@ -625,7 +625,7 @@ class Store:
625625 {
626626 for ( String profileName : environment .getActiveProfiles () )
627627 {
628- log .warn ( "Currently active profile: " + profileName );
628+ log .warn ("Currently active profile: {}" , profileName );
629629 }
630630 }
631631
0 commit comments