couchbase-protolib/src/main/java/com/streamsets/pipeline/lib/couchbase/CouchbaseConnector.java
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);
  }
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

@param config the stage configuration
@param issues the list of configuration issues
@param context the context for the stage
@return a singleton instance for Couchbase connections