public static synchronized CouchbaseConnector getInstance ( BaseCouchbaseConfig config , List < Stage . ConfigIssue > issues , Stage . Context context ) { Map < String , Object > runnerSharedMap = context . getStageRunnerSharedMap ( ) ; if ( runnerSharedMap . containsKey ( INSTANCE ) ) { LOG . debug ( "Using existing instance of CouchbaseConnector" ) ; } else { LOG . debug ( "CouchbaseConnector not yet instantiated. Creating new instance" ) ; validateConfig ( config , issues , context ) ; if ( issues . isEmpty ( ) ) { runnerSharedMap . put ( INSTANCE , new CouchbaseConnector ( config , issues , context ) ) ; } } return ( CouchbaseConnector ) runnerSharedMap . get ( INSTANCE ) ; }
Maintains a singleton instance of the CouchbaseConnector object per pipeline