Skip to content
Snippets Groups Projects
Commit f83c1b10 authored by buczekp's avatar buczekp
Browse files

[LMS-1879] minor: renaming; introduced incoming-dir-create to simplify...

[LMS-1879] minor: renaming; introduced incoming-dir-create to simplify development/testing of datastore

SVN: 18947
parent 4f68dc49
No related branches found
No related tags found
No related merge requests found
...@@ -169,7 +169,7 @@ main-thread.incoming-data-completeness-condition = marker-file ...@@ -169,7 +169,7 @@ main-thread.incoming-data-completeness-condition = marker-file
# Path to the script that will be executed after successful data set registration. # Path to the script that will be executed after successful data set registration.
# The script will be called with two parameters: <data-set-code> and <absolute-data-set-path> (in the data store). # The script will be called with two parameters: <data-set-code> and <absolute-data-set-path> (in the data store).
# main-thread.postregistration-script = /example/scripts/my-script.sh # main-thread.post-registration-script = /example/scripts/my-script.sh
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# maintenance plugins configuration # maintenance plugins configuration
......
...@@ -110,7 +110,7 @@ demo-reporter.class = ch.systemsx.cisd.openbis.dss.generic.server.plugins.demo.D ...@@ -110,7 +110,7 @@ demo-reporter.class = ch.systemsx.cisd.openbis.dss.generic.server.plugins.demo.D
# The property file. Its content will be passed as a parameter to the plugin. # The property file. Its content will be passed as a parameter to the plugin.
demo-reporter.properties-file = demo-reporter.properties-file =
tsv-viewer.label = TSV View tsv-viewer.label = TSV View
tsv-viewer.dataset-types = TSV tsv-viewer.dataset-types = TSV
tsv-viewer.class = ch.systemsx.cisd.openbis.dss.generic.server.plugins.standard.TSVViewReportingPlugin tsv-viewer.class = ch.systemsx.cisd.openbis.dss.generic.server.plugins.standard.TSVViewReportingPlugin
tsv-viewer.properties-file = tsv-viewer.properties-file =
...@@ -177,6 +177,10 @@ validator.site.value-range = [0,Infinity) ...@@ -177,6 +177,10 @@ validator.site.value-range = [0,Infinity)
# E.g. 'code-extractor' property for the thread 'my-etl' should be specified as 'my-etl.code-extractor' # E.g. 'code-extractor' property for the thread 'my-etl' should be specified as 'my-etl.code-extractor'
inputs=main-thread, tsv-thread, csv-thread, simple-thread, hdf5-thread, dss-system-test-thread inputs=main-thread, tsv-thread, csv-thread, simple-thread, hdf5-thread, dss-system-test-thread
# True if incoming directories should be created on server startup if they don't exist.
# Default - false (server will fail at startup if one of incoming directories doesn't exist).
incoming-dir-create = true
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Dataset uploader 'main-thread' configuration # Dataset uploader 'main-thread' configuration
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
...@@ -228,7 +232,7 @@ main-thread.storage-processor.file-extractor = ch.systemsx.cisd.etlserver.imsb.H ...@@ -228,7 +232,7 @@ main-thread.storage-processor.file-extractor = ch.systemsx.cisd.etlserver.imsb.H
# Path to the script that will be executed after successful data set registration. # Path to the script that will be executed after successful data set registration.
# The script will be called with two parameters: <data-set-code> and <absolute-data-set-path> (in the data store). # The script will be called with two parameters: <data-set-code> and <absolute-data-set-path> (in the data store).
# main-thread.postregistration-script = /example/scripts/my-script.sh # main-thread.post-registration-script = /example/scripts/my-script.sh
# The directory to watch for incoming data. # The directory to watch for incoming data.
tsv-thread.incoming-dir = ${root-dir}/incoming-tsv tsv-thread.incoming-dir = ${root-dir}/incoming-tsv
......
...@@ -45,7 +45,7 @@ public final class ThreadParameters ...@@ -45,7 +45,7 @@ public final class ThreadParameters
* in the data store. * in the data store.
*/ */
@Private @Private
static final String POSTREFGISTRATION_SCRIPT_KEY = "postregistration-script"; static final String POST_REGISTRATION_SCRIPT_KEY = "post-registration-script";
@Private @Private
static final String GROUP_CODE_KEY = "group-code"; static final String GROUP_CODE_KEY = "group-code";
...@@ -65,6 +65,8 @@ public final class ThreadParameters ...@@ -65,6 +65,8 @@ public final class ThreadParameters
private static final String INCOMING_DIR = "incoming-dir"; private static final String INCOMING_DIR = "incoming-dir";
private static final String INCOMING_DIR_CREATE = "incoming-dir-create";
private static final String DELETE_UNIDENTIFIED_KEY = "delete-unidentified"; private static final String DELETE_UNIDENTIFIED_KEY = "delete-unidentified";
private static final String REPROCESS_FAULTY_DATASETS_NAME = "reprocess-faulty-datasets"; private static final String REPROCESS_FAULTY_DATASETS_NAME = "reprocess-faulty-datasets";
...@@ -75,6 +77,8 @@ public final class ThreadParameters ...@@ -75,6 +77,8 @@ public final class ThreadParameters
*/ */
private final File incomingDataDirectory; private final File incomingDataDirectory;
private final boolean createIncomingDirectories;
private final IETLServerPlugin plugin; private final IETLServerPlugin plugin;
private final String threadName; private final String threadName;
...@@ -96,6 +100,8 @@ public final class ThreadParameters ...@@ -96,6 +100,8 @@ public final class ThreadParameters
public ThreadParameters(final Properties threadProperties, final String threadName) public ThreadParameters(final Properties threadProperties, final String threadName)
{ {
this.incomingDataDirectory = extractIncomingDataDir(threadProperties); this.incomingDataDirectory = extractIncomingDataDir(threadProperties);
this.createIncomingDirectories =
PropertyUtils.getBoolean(threadProperties, INCOMING_DIR_CREATE, false);
this.plugin = new PropertiesBasedETLServerPlugin(threadProperties); this.plugin = new PropertiesBasedETLServerPlugin(threadProperties);
this.groupCode = tryGetGroupCode(threadProperties); this.groupCode = tryGetGroupCode(threadProperties);
this.postRegistrationScript = tryGetPostRegistartionScript(threadProperties); this.postRegistrationScript = tryGetPostRegistartionScript(threadProperties);
...@@ -136,6 +142,11 @@ public final class ThreadParameters ...@@ -136,6 +142,11 @@ public final class ThreadParameters
final void check() final void check()
{ {
if (createIncomingDirectories && incomingDataDirectory.exists() == false)
{
incomingDataDirectory.mkdir();
operationLog.info("Created incoming directory '" + incomingDataDirectory + "'.");
}
if (incomingDataDirectory.isDirectory() == false) if (incomingDataDirectory.isDirectory() == false)
{ {
throw new ConfigurationFailureException("Incoming directory '" + incomingDataDirectory throw new ConfigurationFailureException("Incoming directory '" + incomingDataDirectory
...@@ -165,7 +176,7 @@ public final class ThreadParameters ...@@ -165,7 +176,7 @@ public final class ThreadParameters
@Private @Private
static final String tryGetPostRegistartionScript(final Properties properties) static final String tryGetPostRegistartionScript(final Properties properties)
{ {
return nullIfEmpty(PropertyUtils.getProperty(properties, POSTREFGISTRATION_SCRIPT_KEY)); return nullIfEmpty(PropertyUtils.getProperty(properties, POST_REGISTRATION_SCRIPT_KEY));
} }
private static String nullIfEmpty(String value) private static String nullIfEmpty(String value)
...@@ -223,6 +234,10 @@ public final class ThreadParameters ...@@ -223,6 +234,10 @@ public final class ThreadParameters
: "no write access for some period"; : "no write access for some period";
logLine("Condition of incoming data completeness: %s.", completenessCond); logLine("Condition of incoming data completeness: %s.", completenessCond);
logLine("Delete unidentified: '%s'.", deleteUnidentified); logLine("Delete unidentified: '%s'.", deleteUnidentified);
if (postRegistrationScript != null)
{
logLine("Post registration script: '%s'.", postRegistrationScript);
}
} }
} }
......
...@@ -40,7 +40,7 @@ import ch.systemsx.cisd.common.mail.IMailClient; ...@@ -40,7 +40,7 @@ import ch.systemsx.cisd.common.mail.IMailClient;
import ch.systemsx.cisd.common.utilities.IDelegatedActionWithResult; import ch.systemsx.cisd.common.utilities.IDelegatedActionWithResult;
import ch.systemsx.cisd.common.utilities.ISelfTestable; import ch.systemsx.cisd.common.utilities.ISelfTestable;
import ch.systemsx.cisd.etlserver.IStorageProcessor.UnstoreDataAction; import ch.systemsx.cisd.etlserver.IStorageProcessor.UnstoreDataAction;
import ch.systemsx.cisd.etlserver.utils.PostregistrationExecutor; import ch.systemsx.cisd.etlserver.utils.PostRegistrationExecutor;
import ch.systemsx.cisd.etlserver.validation.IDataSetValidator; import ch.systemsx.cisd.etlserver.validation.IDataSetValidator;
import ch.systemsx.cisd.openbis.dss.generic.shared.IEncapsulatedOpenBISService; import ch.systemsx.cisd.openbis.dss.generic.shared.IEncapsulatedOpenBISService;
import ch.systemsx.cisd.openbis.dss.generic.shared.dto.DataSetInformation; import ch.systemsx.cisd.openbis.dss.generic.shared.dto.DataSetInformation;
...@@ -150,7 +150,7 @@ public final class TransferredDataSetHandler implements IPathHandler, ISelfTesta ...@@ -150,7 +150,7 @@ public final class TransferredDataSetHandler implements IPathHandler, ISelfTesta
this.fileOperations = FileOperations.getMonitoredInstanceForCurrentThread(); this.fileOperations = FileOperations.getMonitoredInstanceForCurrentThread();
this.useIsFinishedMarkerFile = useIsFinishedMarkerFile; this.useIsFinishedMarkerFile = useIsFinishedMarkerFile;
this.deleteUnidentified = deleteUnidentified; this.deleteUnidentified = deleteUnidentified;
this.postRegistrationAction = PostregistrationExecutor.create(postRegistrationScriptOrNull); this.postRegistrationAction = PostRegistrationExecutor.create(postRegistrationScriptOrNull);
} }
/** /**
......
...@@ -39,14 +39,14 @@ import ch.systemsx.cisd.etlserver.IPostRegistrationAction; ...@@ -39,14 +39,14 @@ import ch.systemsx.cisd.etlserver.IPostRegistrationAction;
* *
* @author Izabela Adamczyk * @author Izabela Adamczyk
*/ */
public class PostregistrationExecutor implements IPostRegistrationAction public class PostRegistrationExecutor implements IPostRegistrationAction
{ {
private final static Logger operationLog = LogFactory.getLogger(LogCategory.OPERATION, private final static Logger operationLog = LogFactory.getLogger(LogCategory.OPERATION,
PostregistrationExecutor.class); PostRegistrationExecutor.class);
private final static Logger machineLog = LogFactory.getLogger(LogCategory.MACHINE, private final static Logger machineLog = LogFactory.getLogger(LogCategory.MACHINE,
PostregistrationExecutor.class); PostRegistrationExecutor.class);
static class EmptyScriptExecutor implements IPostRegistrationAction static class EmptyScriptExecutor implements IPostRegistrationAction
{ {
...@@ -61,7 +61,7 @@ public class PostregistrationExecutor implements IPostRegistrationAction ...@@ -61,7 +61,7 @@ public class PostregistrationExecutor implements IPostRegistrationAction
{ {
if (scriptPath != null) if (scriptPath != null)
{ {
return new PostregistrationExecutor(scriptPath); return new PostRegistrationExecutor(scriptPath);
} else } else
{ {
operationLog.debug("No postregistration script found, skipping execution."); operationLog.debug("No postregistration script found, skipping execution.");
...@@ -71,7 +71,7 @@ public class PostregistrationExecutor implements IPostRegistrationAction ...@@ -71,7 +71,7 @@ public class PostregistrationExecutor implements IPostRegistrationAction
private final String scriptPath; private final String scriptPath;
private PostregistrationExecutor(String script) private PostRegistrationExecutor(String script)
{ {
this.scriptPath = script; this.scriptPath = script;
File file = new File(script); File file = new File(script);
......
...@@ -161,6 +161,10 @@ data-set-clean-up.data-source = imaging-db ...@@ -161,6 +161,10 @@ data-set-clean-up.data-source = imaging-db
incoming-root-dir = ${root-dir} incoming-root-dir = ${root-dir}
# True if incoming directories should be created on server startup if they don't exist.
# Default - false (server will fail at startup if one of incoming directories doesn't exist).
incoming-dir-create = true
# Globally used separator character which separates entities in a data set file name # Globally used separator character which separates entities in a data set file name
data-set-file-name-entity-separator = _ data-set-file-name-entity-separator = _
...@@ -224,7 +228,6 @@ merged-channels-images.storage-processor.data-source = imaging-db ...@@ -224,7 +228,6 @@ merged-channels-images.storage-processor.data-source = imaging-db
merged-channels-images.storage-processor.extract-single-image-channels = GREEN, BLUE merged-channels-images.storage-processor.extract-single-image-channels = GREEN, BLUE
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# The directory to watch for incoming data. # The directory to watch for incoming data.
split-channels-images.incoming-dir = ${incoming-root-dir}/incoming-images-split-channels split-channels-images.incoming-dir = ${incoming-root-dir}/incoming-images-split-channels
split-channels-images.incoming-data-completeness-condition = auto-detection split-channels-images.incoming-data-completeness-condition = auto-detection
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment