(os.size());
- for (Object o : os) {
- EntityBaseBean eb = (EntityBaseBean) o;
- Thread worker = new Thread(new CheckOneFile(eb));
- worker.start();
- threads.add(worker);
- maxId = eb.getId();
- }
- for (Thread thread : threads) {
- try {
- thread.join();
- } catch (InterruptedException e) {
- logger.info("Thread interrupted");
- return;
- }
- }
- }
-
- try {
- if (maxId != null) {
- Files.write(filesCheckLastIdFile, Long.toString(maxId).getBytes());
- } else {
- Files.deleteIfExists(filesCheckLastIdFile);
- }
- } catch (IOException e) {
- logger.error("Unable to write FileChecker last id file " + e.getClass() + " " + e.getMessage());
- }
-
- } catch (IcatException_Exception e) {
- logger.error(e.getFaultInfo().getType() + " " + e.getMessage());
- } catch (Throwable e) {
- logger.error("Throwable " + e.getClass() + " " + e.getMessage());
- } finally {
- timer.schedule(new Action(), filesCheckGapMillis);
- }
- }
-
- }
-
- private final static Logger logger = LoggerFactory.getLogger(FileChecker.class);
-
- private Timer timer = new Timer();
-
- private int filesCheckParallelCount;
- private long filesCheckGapMillis;
- private Path filesCheckLastIdFile;
- private Path filesCheckErrorLog;
-
- private boolean twoLevel;
-
- private MainStorageInterface mainStorage;
-
- private ArchiveStorageInterface archiveStorage;
-
- private ZipMapperInterface zipMapper;
-
- private PropertyHandler propertyHandler;
-
- @PostConstruct
- public void init() {
-
- propertyHandler = PropertyHandler.getInstance();
- StorageUnit storageUnit = propertyHandler.getStorageUnit();
- filesCheckParallelCount = propertyHandler.getFilesCheckParallelCount();
- if (filesCheckParallelCount > 0) {
- logger.warn("The FileChecker is deprecated and slated for removal in ids.server 3.0");
- if (storageUnit == null || storageUnit == StorageUnit.DATASET) {
- filesCheckGapMillis = propertyHandler.getFilesCheckGapMillis();
- filesCheckLastIdFile = propertyHandler.getFilesCheckLastIdFile();
- filesCheckErrorLog = propertyHandler.getFilesCheckErrorLog();
- mainStorage = propertyHandler.getMainStorage();
- archiveStorage = propertyHandler.getArchiveStorage();
- twoLevel = archiveStorage != null;
- zipMapper = propertyHandler.getZipMapper();
-
- maxId = null;
- if (Files.exists(filesCheckLastIdFile)) {
- try {
- maxId = Long.parseLong(Files.readAllLines(filesCheckLastIdFile, StandardCharsets.UTF_8).get(0));
- } catch (Exception e) {
- logger.error("Unable to read FileChecker last id file " + e.getClass() + " " + e.getMessage());
- }
- }
-
- timer.schedule(new Action(), filesCheckGapMillis);
-
- logger.info("FileChecker started with maxId: " + maxId);
- } else {
- logger.info("FileChecker not supported for storageUnit " + storageUnit);
- }
- } else {
- logger.info("FileChecker startup not requested");
- }
-
- }
-
- @PreDestroy
- public void exit() {
- timer.cancel();
- logger.info("FileChecker stopped");
- }
-
-}
diff --git a/src/main/java/org/icatproject/ids/PropertyHandler.java b/src/main/java/org/icatproject/ids/PropertyHandler.java
index 72cc617f..8893a084 100644
--- a/src/main/java/org/icatproject/ids/PropertyHandler.java
+++ b/src/main/java/org/icatproject/ids/PropertyHandler.java
@@ -51,10 +51,6 @@ public static Logger getLogger() {
private ArchiveStorageInterface archiveStorage;
private Path cacheDir;
private boolean enableWrite;
- private Path filesCheckErrorLog;
- private int filesCheckGapMillis;
- private Path filesCheckLastIdFile;
- private int filesCheckParallelCount;
private ICAT icatService;
private long linkLifetimeMillis;
@@ -198,23 +194,6 @@ private PropertyHandler() {
abort(cacheDir + " must be an existing directory");
}
- if (props.has("filesCheck.parallelCount")) {
- filesCheckParallelCount = props.getNonNegativeInt("filesCheck.parallelCount");
- } else {
- filesCheckParallelCount = 0;
- }
- if (filesCheckParallelCount > 0) {
- filesCheckGapMillis = props.getPositiveInt("filesCheck.gapSeconds") * 1000;
- filesCheckLastIdFile = props.getFile("filesCheck.lastIdFile").toPath();
- if (!Files.exists(filesCheckLastIdFile.getParent())) {
- abort("Directory for " + filesCheckLastIdFile + " does not exist");
- }
- filesCheckErrorLog = props.getFile("filesCheck.errorLog").toPath();
- if (!Files.exists(filesCheckErrorLog.getParent())) {
- abort("Directory for " + filesCheckErrorLog + " does not exist");
- }
- }
-
if (props.has("linkLifetimeSeconds")) {
linkLifetimeMillis = props.getNonNegativeLong("linkLifetimeSeconds") * 1000L;
} else {
@@ -266,22 +245,6 @@ public boolean getEnableWrite() {
return enableWrite;
}
- public Path getFilesCheckErrorLog() {
- return filesCheckErrorLog;
- }
-
- public long getFilesCheckGapMillis() {
- return filesCheckGapMillis;
- }
-
- public Path getFilesCheckLastIdFile() {
- return filesCheckLastIdFile;
- }
-
- public int getFilesCheckParallelCount() {
- return filesCheckParallelCount;
- }
-
public synchronized ICAT getIcatService() {
// Keep trying every 10 seconds to connect to ICAT. Each failure
// will produce an error message.
diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml
index c6cd0ad2..ba06d172 100644
--- a/src/main/resources/logback.xml
+++ b/src/main/resources/logback.xml
@@ -23,6 +23,4 @@
-
-
diff --git a/src/main/scripts/setup b/src/main/scripts/setup
index e0594813..6ba0a6e4 100755
--- a/src/main/scripts/setup
+++ b/src/main/scripts/setup
@@ -40,19 +40,6 @@ if arg == "INSTALL":
if not (idsProperties.get("delayDatafileOperationsSeconds")):
abort("delayDatafileOperationsSeconds is not set in run.properties")
- if int(idsProperties.get("filesCheck.parallelCount", 0)) > 0:
- warnings.warn("The FileChecker is deprecated and slated for removal in ids.server 3.0")
- if not idsProperties.get("filesCheck.gapSeconds"): abort("filesCheck.gapSeconds is not set in run.properties")
- if not idsProperties.get("filesCheck.lastIdFile"): abort("filesCheck.lastIdFile is not set in run.properties")
- parent = os.path.dirname(os.path.expandvars(idsProperties["filesCheck.lastIdFile"]))
- if not os.path.exists(parent):
- abort("Please create directory " + parent + " for filesCheck.lastIdFile specified in run.properties")
- if not idsProperties.get("filesCheck.errorLog"): abort("filesCheck.errorLog is not set in run.properties")
- parent = os.path.dirname(os.path.expandvars(idsProperties["filesCheck.errorLog"]))
- if not os.path.exists(parent):
- abort("Please create directory " + parent + " for filesCheck.errorLog specified in run.properties")
- if not idsProperties.get("reader"): abort("reader is not set in run.properties")
-
if int(idsProperties.get("linkLifetimeSeconds", 0)) > 0:
warnings.warn("The getLink API call is deprecated and slated for removal in ids.server 3.0")
diff --git a/src/site/xhtml/installation.xhtml.vm b/src/site/xhtml/installation.xhtml.vm
index 2f4ec985..4fcaaeae 100644
--- a/src/site/xhtml/installation.xhtml.vm
+++ b/src/site/xhtml/installation.xhtml.vm
@@ -251,58 +251,6 @@ please consult the documentation for your plugin(s).
-
-Properties for file checking
-When a datafile is added to the IDS its length and checksum are
- computed and stored in ICAT. File checking, if enabled, cycles through
- all the stored data making sure that they can be read and that files
- have the expected size and checksum.
-Deprecated: the FileChecker is deprecated and slated for removal
- along with the properties in this section in ids.server 3.0.
-
- - filesCheck.parallelCount
- -
- Optional, default zero. If non zero then the readability of the
- data will be checked. The behaviour is dependent upon whether or not
- archive storage has a been requested. In the case of single level
- storage this is done in groups of files where the group size is
- defined by this parameter. If archive storage has been requested then
- only the archive is checked. Each file in the archive holds a
- complete dataset and this filesCheck.parallelCount parameter then
- defines how many dataset files will be checked in parallel.
-
In the case of checking datasets in the archive storage these
- are unzipped on the fly to compute the checksum of each file inside
- the zip file as well as its length.
- If the archive storage has a long latency then it is useful to
- have a "large" value, however a thread is started for each stored
- file so the value of this parameter should not be too large.
- If this is set to zero then the FileChecker is disabled and all other
- properties in this section will be ignored.
-
- - filesCheck.gapSeconds
- - the number of seconds to wait before launching a check of the
- next batch of datafiles or datasets.
-
- - filesCheck.lastIdFile
- - the location of a file which is used to store the id value of
- the last datafile or dataset to be checked. This is so that if the
- IDS is restarted it will continue checking where it left off. If this
- file is deleted the ids will restart checking from the beginning. The
- parameters filesCheck.parallelCount and filesCheck.gapSeconds should
- be set so that the data are all checked with the desired frequency
- but without excessive I/O. A nagios plugin might check that this file
- is being written periodically and that its contents change.
-
- - filesCheck.errorLog
- - the file with a list of errors found. The file is not kept
- open but instead is opened in append mode each time a problem is
- spotted and then closed. A nagios plugin might be set up to watch
- this file. Entries in the file are data stamped and new entries are
- simply appended without regard for the existence of an entry for the
- same file.
-
-
-
Check that the ids server works
Enter a url of the form
diff --git a/src/site/xhtml/release-notes.xhtml b/src/site/xhtml/release-notes.xhtml
index 1e3bff32..654949a3 100644
--- a/src/site/xhtml/release-notes.xhtml
+++ b/src/site/xhtml/release-notes.xhtml
@@ -6,6 +6,11 @@
IDS Server Release Notes
+3.0.0 (not yet released)
+
+ - #147: Drop FileChecker, deprecated in 2.0.0.
+
+
2.0.0
Make the transition to Payara 6
diff --git a/src/test/java/org/icatproject/ids/integration/one/FileCheckerTest.java b/src/test/java/org/icatproject/ids/integration/one/FileCheckerTest.java
deleted file mode 100644
index 7f23dc8b..00000000
--- a/src/test/java/org/icatproject/ids/integration/one/FileCheckerTest.java
+++ /dev/null
@@ -1,94 +0,0 @@
-package org.icatproject.ids.integration.one;
-
-import java.io.IOException;
-import java.nio.charset.Charset;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import org.icatproject.Datafile;
-import org.icatproject.EntityBaseBean;
-import org.icatproject.ids.integration.BaseTest;
-import org.icatproject.ids.integration.util.Setup;
-
-public class FileCheckerTest extends BaseTest {
-
- private static Path errorLog;
-
- @BeforeClass
- public static void setup() throws Exception {
- setup = new Setup("one.properties");
- icatsetup();
- errorLog = setup.getErrorLog();
- }
-
- @Test
- public void everythingTest() throws Exception {
-
- List