diff --git a/server/src/main/java/io/unitycatalog/server/UnityCatalogServer.java b/server/src/main/java/io/unitycatalog/server/UnityCatalogServer.java index 60530f061..bfd885274 100644 --- a/server/src/main/java/io/unitycatalog/server/UnityCatalogServer.java +++ b/server/src/main/java/io/unitycatalog/server/UnityCatalogServer.java @@ -36,13 +36,7 @@ import io.vertx.core.Verticle; import io.vertx.core.Vertx; import java.nio.file.Path; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.CommandLineParser; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.HelpFormatter; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; -import org.apache.commons.cli.ParseException; +import org.apache.commons.cli.*; import org.apache.logging.log4j.core.config.Configurator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/server/src/main/java/io/unitycatalog/server/persist/MetastoreRepository.java b/server/src/main/java/io/unitycatalog/server/persist/MetastoreRepository.java index 0fb2dce06..db47b37c9 100644 --- a/server/src/main/java/io/unitycatalog/server/persist/MetastoreRepository.java +++ b/server/src/main/java/io/unitycatalog/server/persist/MetastoreRepository.java @@ -20,7 +20,6 @@ public class MetastoreRepository { private static final MetastoreRepository INSTANCE = new MetastoreRepository(); private static final Logger LOGGER = LoggerFactory.getLogger(MetastoreRepository.class); private static final SessionFactory SESSION_FACTORY = HibernateUtils.getSessionFactory(); - private static MetastoreDAO CACHED_METASTORE_DAO = null; private MetastoreRepository() {} @@ -29,16 +28,12 @@ public static MetastoreRepository getInstance() { } public GetMetastoreSummaryResponse getMetastoreSummary() { - if (CACHED_METASTORE_DAO != null) { - return CACHED_METASTORE_DAO.toGetMetastoreSummaryResponse(); - } try (Session session = SESSION_FACTORY.openSession()) { session.setDefaultReadOnly(true); MetastoreDAO metastoreDAO = getMetastoreDAO(session); if (metastoreDAO == null) { throw new BaseException(ErrorCode.NOT_FOUND, "No metastore found!"); } - CACHED_METASTORE_DAO = metastoreDAO; return metastoreDAO.toGetMetastoreSummaryResponse(); } } @@ -69,7 +64,6 @@ public MetastoreDAO initMetastoreIfNeeded() { tx.commit(); } LOGGER.info("Server initialized with metastore id: {}", metastoreDAO.getId()); - CACHED_METASTORE_DAO = metastoreDAO; return metastoreDAO; } catch (Exception e) { tx.rollback();