@Override
  public void init(SubsetConfiguration conf) {
    String nameNodeUrl;
    String blockSizeString;

    logger.info("Entering init");

    currentServiceName = getFirstConfigPrefix(conf);

    databaseUrl = conf.getString(DATABASE_URL_KEY);

    if (databaseUrl == null)
      throw new MetricsException(
        "databaseUrl required in the metrics2 configuration for SqlServerSink.");

    try {
      Class.forName(getDatabaseDriverClassName());
    } catch (ClassNotFoundException cnfe) {
      throw new MetricsException(
        "SqlServerSink requires the Microsoft JDBC driver for SQL Server.");
    }

    hadoopConfig = new org.apache.hadoop.conf.Configuration();
    if (hadoopConfig != null) {
      nameNodeUrl = hadoopConfig.get(NAMENODE_URL_KEY);
      if (nameNodeUrl != null) {
        Matcher matcher = NAME_URL_REGEX.matcher(nameNodeUrl);
        if (matcher.find()) {
          clusterName = matcher.group(1);
        }
      }
      blockSizeString = hadoopConfig.get(DFS_BLOCK_SIZE_KEY);
      if (blockSizeString != null) {
        try {
          blockSize = Integer.parseInt(blockSizeString);
          logger.info("blockSize = " + blockSize);
        } catch (NumberFormatException nfe) {
          logger.warn("Exception on init: ", nfe);
        }
      }

    }
    logger.info("Exit init, cluster name = " + clusterName);
  }
This class stores published metrics to the SQL Server database.
contrib/ambari-scom/metrics-sink/src/main/java/org/apache/hadoop/metrics2/sink/SqlSink.java