@Override
  @SuppressWarnings("nls")
  public void setConf(Configuration conf) {
    isInitialized = false;
    this.conf = conf;
    this.areTxnStatsSupported = MetastoreConf.getBoolVar(conf, ConfVars.HIVE_TXN_STATS_ENABLED);
    configureSSL(conf);
    PersistenceManagerProvider.updatePmfProperties(conf);

    assert (!isActiveTransaction());
    shutdown();
    // Always want to re-create pm as we don't know if it were created by the
    // most recent instance of the pmf
    pm = null;
    directSql = null;
    expressionProxy = null;
    openTrasactionCalls = 0;
    currentTransaction = null;
    transactionStatus = TXN_STATUS.NO_STATE;

    initialize();

    String partitionValidationRegex =
        MetastoreConf.getVar(this.conf, ConfVars.PARTITION_NAME_WHITELIST_PATTERN);
    if (partitionValidationRegex != null && !partitionValidationRegex.isEmpty()) {
      partitionValidationPattern = Pattern.compile(partitionValidationRegex);
    } else {
      partitionValidationPattern = null;
    }

    // Note, if metrics have not been initialized this will return null, which means we aren't
    // using metrics.  Thus we should always check whether this is non-null before using.
    MetricRegistry registry = Metrics.getRegistry();
    if (registry != null) {
      directSqlErrors = Metrics.getOrCreateCounter(MetricsConstants.DIRECTSQL_ERRORS);
    }

    this.batchSize = MetastoreConf.getIntVar(conf, ConfVars.RAWSTORE_PARTITION_BATCH_SIZE);

    if (!isInitialized) {
      throw new RuntimeException("Unable to create persistence manager. Check log for details");
    } else {
      LOG.debug("Initialized ObjectStore");
    }

    if (tablelocks == null) {
      synchronized (ObjectStore.class) {
        if (tablelocks == null) {
          int numTableLocks = MetastoreConf.getIntVar(conf, ConfVars.METASTORE_NUM_STRIPED_TABLE_LOCKS);
          tablelocks = Striped.lazyWeakLock(numTableLocks);
        }
      }
    }
  }
@Ignore // See comment in ObjectStore.getDataSourceProps
  @Test
  public void testNonConfDatanucleusValueSet() {
    String key = "datanucleus.no.such.key";
    String value = "test_value";
    String key1 = "blabla.no.such.key";
    String value1 = "another_value";
    Assume.assumeTrue(System.getProperty(key) == null);
    Configuration localConf = MetastoreConf.newMetastoreConf();
    MetaStoreTestUtils.setConfForStandloneMode(localConf);
    localConf.set(key, value);
    localConf.set(key1, value1);
    objectStore = new ObjectStore();
    objectStore.setConf(localConf);
    Assert.assertEquals(value, PersistenceManagerProvider.getProperty(key));
    Assert.assertNull(PersistenceManagerProvider.getProperty(key1));
  }