From 7510b04efcaaece7978abdec7fb15da261e87cf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-Xavier=20Thomas?= Date: Sat, 16 Mar 2019 17:28:00 +0100 Subject: [PATCH] Make checkpoint() method void (return value is not used) --- .../src/main/java/org/airsonic/player/dao/AbstractDao.java | 2 +- .../src/main/java/org/airsonic/player/dao/DaoHelper.java | 4 +--- .../java/org/airsonic/player/dao/LegacyHsqlDaoHelper.java | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/airsonic-main/src/main/java/org/airsonic/player/dao/AbstractDao.java b/airsonic-main/src/main/java/org/airsonic/player/dao/AbstractDao.java index a01836ab..757accc5 100644 --- a/airsonic-main/src/main/java/org/airsonic/player/dao/AbstractDao.java +++ b/airsonic-main/src/main/java/org/airsonic/player/dao/AbstractDao.java @@ -189,6 +189,6 @@ public class AbstractDao { this.daoHelper = daoHelper; } - public boolean checkpoint() { return daoHelper.checkpoint(); } + public void checkpoint() { daoHelper.checkpoint(); } } diff --git a/airsonic-main/src/main/java/org/airsonic/player/dao/DaoHelper.java b/airsonic-main/src/main/java/org/airsonic/player/dao/DaoHelper.java index 5590b5cf..28acc180 100644 --- a/airsonic-main/src/main/java/org/airsonic/player/dao/DaoHelper.java +++ b/airsonic-main/src/main/java/org/airsonic/player/dao/DaoHelper.java @@ -52,8 +52,6 @@ public interface DaoHelper { * * Database checkpoints will make sure that the database is written on the disk * and optimize on-disk storage. - * - * @return true if the checkpoint succeeded, false otherwise */ - public default boolean checkpoint() { return false; } + public default void checkpoint() { } } diff --git a/airsonic-main/src/main/java/org/airsonic/player/dao/LegacyHsqlDaoHelper.java b/airsonic-main/src/main/java/org/airsonic/player/dao/LegacyHsqlDaoHelper.java index b199a75c..d8d8c386 100644 --- a/airsonic-main/src/main/java/org/airsonic/player/dao/LegacyHsqlDaoHelper.java +++ b/airsonic-main/src/main/java/org/airsonic/player/dao/LegacyHsqlDaoHelper.java @@ -23,13 +23,12 @@ public class LegacyHsqlDaoHelper extends GenericDaoHelper { } @Override - public boolean checkpoint() { + public void checkpoint() { // HSQLDB (at least version 1) does not handle automatic checkpoints very well by default. // This makes sure the temporary log is actually written to more persistent storage. LOG.info("Database checkpoint in progress..."); getJdbcTemplate().execute("CHECKPOINT DEFRAG"); LOG.info("Database checkpoint complete."); - return true; } @PreDestroy