docs: private void initializeBuiltinRpcs(final OperationMode mode,
          final ImmutableMap.Builder<String, TelnetRpc> telnet,
          final ImmutableMap.Builder<String, HttpRpc> http) {
  
      final Boolean enableApi = tsdb.getConfig().getString("tsd.core.enable_api").equals("true");
      final Boolean enableUi = tsdb.getConfig().getString("tsd.core.enable_ui").equals("true");
      final Boolean enableDieDieDie = tsdb.getConfig().getString("tsd.no_diediedie").equals("false");
  
      LOG.info("Mode: {}, HTTP UI Enabled: {}, HTTP API Enabled: {}", mode, enableUi, enableApi);
  
      // defaults common to every mode
      final StatsRpc stats = new StatsRpc();
      final ListAggregators aggregators = new ListAggregators();
      final DropCachesRpc dropcaches = new DropCachesRpc();
      final Version version = new Version();
      
      telnet.put("stats", stats);
      telnet.put("dropcaches", dropcaches);
      telnet.put("version", version);
      telnet.put("exit", new Exit());
      telnet.put("help", new Help());
      
      if (enableUi) {
        http.put("aggregators", aggregators);
        http.put("logs", new LogsRpc());
        http.put("stats", stats);
        http.put("version", version);
      }
      
      if (enableApi) {
        http.put("api/aggregators", aggregators);
        http.put("api/config", new ShowConfig());
        http.put("api/dropcaches", dropcaches);
        http.put("api/stats", stats);
        http.put("api/version", version);
      }
      
      final PutDataPointRpc put = new PutDataPointRpc(tsdb.getConfig());
      final RollupDataPointRpc rollups = new RollupDataPointRpc(tsdb.getConfig());
      final HistogramDataPointRpc histos = new HistogramDataPointRpc(tsdb.getConfig());
      final SuggestRpc suggest_rpc = new SuggestRpc();
      final AnnotationRpc annotation_rpc = new AnnotationRpc();
      final StaticFileRpc staticfile = new StaticFileRpc();
      
      switch(mode) {
      case WRITEONLY:
        telnet.put("put", put);
        telnet.put("rollup", rollups);
        telnet.put("histogram", histos);
        
        if (enableApi) {
          http.put("api/annotation", annotation_rpc);
          http.put("api/annotations", annotation_rpc);
          http.put("api/put", put);
          http.put("api/rollup", rollups);
          http.put("api/histogram", histos);
          http.put("api/tree", new TreeRpc());
          http.put("api/uid", new UniqueIdRpc());
        }
        break;
      case READONLY:
        if (enableUi) {
          http.put("", new HomePage());
          http.put("s", staticfile);
          http.put("favicon.ico", staticfile);
          http.put("suggest", suggest_rpc);
          http.put("q", new GraphHandler());
        }
        
        if (enableApi) {
          http.put("api/query", new QueryRpc());
          http.put("api/search", new SearchRpc());
          http.put("api/suggest", suggest_rpc);
        }
        
        break;
      case READWRITE:
        telnet.put("put", put);
        telnet.put("rollup", rollups);
        telnet.put("histogram", histos);
        
        if (enableUi) {
          http.put("", new HomePage());
          http.put("s", staticfile);
          http.put("favicon.ico", staticfile);
          http.put("suggest", suggest_rpc);
          http.put("q", new GraphHandler());
        }
        
        if (enableApi) {
          http.put("api/query", new QueryRpc());
          http.put("api/search", new SearchRpc());
          http.put("api/annotation", annotation_rpc);
          http.put("api/annotations", annotation_rpc);
          http.put("api/suggest", suggest_rpc);
          http.put("api/put", put);
          http.put("api/rollup", rollups);
          http.put("api/histogram", histos);
          http.put("api/tree", new TreeRpc());
          http.put("api/uid", new UniqueIdRpc());
        }
      }
      
      
  
      if (enableDieDieDie) {
        final DieDieDie diediedie = new DieDieDie();
        telnet.put("diediedie", diediedie);
        if (enableUi) {
          http.put("diediedie", diediedie);
        }
      }
    }