diff --git a/datastore_server/source/java/ch/systemsx/cisd/etlserver/path/PathInfoDatabaseFeedingTask.java b/datastore_server/source/java/ch/systemsx/cisd/etlserver/path/PathInfoDatabaseFeedingTask.java index 71f648a36a737f4a27a80adf167306fe188186fe..70a04b1a225749626bf631058c6cd5bb1758f9e3 100644 --- a/datastore_server/source/java/ch/systemsx/cisd/etlserver/path/PathInfoDatabaseFeedingTask.java +++ b/datastore_server/source/java/ch/systemsx/cisd/etlserver/path/PathInfoDatabaseFeedingTask.java @@ -118,7 +118,7 @@ public class PathInfoDatabaseFeedingTask implements IMaintenanceTask, IPostRegis } } - public IPostRegistrationTaskExecutor createExecutor(final String dataSetCode) + public IPostRegistrationTaskExecutor createExecutor(final String dataSetCode, boolean container) { return new IPostRegistrationTaskExecutor() { diff --git a/datastore_server/source/java/ch/systemsx/cisd/etlserver/plugins/SimpleShuffling.java b/datastore_server/source/java/ch/systemsx/cisd/etlserver/plugins/SimpleShuffling.java index 5abbdfc1a3b1ef3557c08106be9362d51ac72a95..7695e94162e872078605178a596e2544e64e298e 100644 --- a/datastore_server/source/java/ch/systemsx/cisd/etlserver/plugins/SimpleShuffling.java +++ b/datastore_server/source/java/ch/systemsx/cisd/etlserver/plugins/SimpleShuffling.java @@ -127,7 +127,7 @@ public class SimpleShuffling implements ISegmentedStoreShuffling SimpleDataSetInformationDTO dataSet = dataSets.get(i); try { - taskExecutor.execute(shufflingTask, "shuffling", dataSet.getDataSetCode()); + taskExecutor.execute(shufflingTask, "shuffling", dataSet.getDataSetCode(), false); } catch (Throwable ex) { throw CheckedExceptionTunnel.wrapIfNecessary(ex); diff --git a/datastore_server/source/java/ch/systemsx/cisd/etlserver/postregistration/ArchivingPostRegistrationTask.java b/datastore_server/source/java/ch/systemsx/cisd/etlserver/postregistration/ArchivingPostRegistrationTask.java index 1ac4a458d6e56fdf26ef32505471d7a6fe8b1179..e767f2f099df056ee526d899d9370aa3c3ab0199 100644 --- a/datastore_server/source/java/ch/systemsx/cisd/etlserver/postregistration/ArchivingPostRegistrationTask.java +++ b/datastore_server/source/java/ch/systemsx/cisd/etlserver/postregistration/ArchivingPostRegistrationTask.java @@ -67,8 +67,12 @@ public class ArchivingPostRegistrationTask extends AbstractPostRegistrationTask return true; } - public IPostRegistrationTaskExecutor createExecutor(String dataSetCode) + public IPostRegistrationTaskExecutor createExecutor(String dataSetCode, boolean container) { + if (container) + { + return DummyPostRegistrationTaskExecutor.INSTANCE; + } return new Executor(dataSetCode); } diff --git a/datastore_server/source/java/ch/systemsx/cisd/etlserver/postregistration/DummyPostRegistrationTaskExecutor.java b/datastore_server/source/java/ch/systemsx/cisd/etlserver/postregistration/DummyPostRegistrationTaskExecutor.java new file mode 100644 index 0000000000000000000000000000000000000000..6d6814c896ca50ebf303cbb80052207d410daaa6 --- /dev/null +++ b/datastore_server/source/java/ch/systemsx/cisd/etlserver/postregistration/DummyPostRegistrationTaskExecutor.java @@ -0,0 +1,36 @@ +/* + * Copyright 2011 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.systemsx.cisd.etlserver.postregistration; + +/** + * + * + * @author Franz-Josef Elmer + */ +public class DummyPostRegistrationTaskExecutor implements IPostRegistrationTaskExecutor +{ + public static final IPostRegistrationTaskExecutor INSTANCE = new DummyPostRegistrationTaskExecutor(); + + public void execute() + { + } + + public ICleanupTask createCleanupTask() + { + return new NoCleanupTask(); + } +} diff --git a/datastore_server/source/java/ch/systemsx/cisd/etlserver/postregistration/EagerShufflingTask.java b/datastore_server/source/java/ch/systemsx/cisd/etlserver/postregistration/EagerShufflingTask.java index a4b7bad37683d230c66a942eaa149f78613618fd..5cd40f2bad48e0a019c9728faa3125edffb7e88d 100644 --- a/datastore_server/source/java/ch/systemsx/cisd/etlserver/postregistration/EagerShufflingTask.java +++ b/datastore_server/source/java/ch/systemsx/cisd/etlserver/postregistration/EagerShufflingTask.java @@ -129,8 +129,12 @@ public class EagerShufflingTask extends AbstractPostRegistrationTask return true; } - public IPostRegistrationTaskExecutor createExecutor(String dataSetCode) + public IPostRegistrationTaskExecutor createExecutor(String dataSetCode, boolean container) { + if (container) + { + return DummyPostRegistrationTaskExecutor.INSTANCE; + } return new Executor(dataSetCode); } diff --git a/datastore_server/source/java/ch/systemsx/cisd/etlserver/postregistration/IPostRegistrationTask.java b/datastore_server/source/java/ch/systemsx/cisd/etlserver/postregistration/IPostRegistrationTask.java index f9fda6997f137f6b3fdfa0b46ef30cf87ed4a883..628eeb9f9a1cdd0a0712f310c360938e5a663b05 100644 --- a/datastore_server/source/java/ch/systemsx/cisd/etlserver/postregistration/IPostRegistrationTask.java +++ b/datastore_server/source/java/ch/systemsx/cisd/etlserver/postregistration/IPostRegistrationTask.java @@ -36,8 +36,9 @@ public interface IPostRegistrationTask /** * Creates a task executor for the specified data set. + * @param container If <code>true</code> the data set is a container data set. */ - public IPostRegistrationTaskExecutor createExecutor(String dataSetCode); + public IPostRegistrationTaskExecutor createExecutor(String dataSetCode, boolean container); } diff --git a/datastore_server/source/java/ch/systemsx/cisd/etlserver/postregistration/NotifyingTask.java b/datastore_server/source/java/ch/systemsx/cisd/etlserver/postregistration/NotifyingTask.java index 85693333f67d55c5369c822b54fd2d13bb2f27ee..390d41e2e9dac1a83fc4bdb46c6ab3774f5a5953 100644 --- a/datastore_server/source/java/ch/systemsx/cisd/etlserver/postregistration/NotifyingTask.java +++ b/datastore_server/source/java/ch/systemsx/cisd/etlserver/postregistration/NotifyingTask.java @@ -65,7 +65,7 @@ public class NotifyingTask extends AbstractPostRegistrationTask return false; } - public IPostRegistrationTaskExecutor createExecutor(String dataSetCode) + public IPostRegistrationTaskExecutor createExecutor(String dataSetCode, boolean container) { ExternalData dataSet = service.tryGetDataSet(dataSetCode); if (dataSet == null) diff --git a/datastore_server/source/java/ch/systemsx/cisd/etlserver/postregistration/PostRegistrationMaintenanceTask.java b/datastore_server/source/java/ch/systemsx/cisd/etlserver/postregistration/PostRegistrationMaintenanceTask.java index ea5212eac04fdcd68cfd4a1aa0c586d7dbd039bb..16afd6d7eb335d841deec93022b18878edaca2ee 100644 --- a/datastore_server/source/java/ch/systemsx/cisd/etlserver/postregistration/PostRegistrationMaintenanceTask.java +++ b/datastore_server/source/java/ch/systemsx/cisd/etlserver/postregistration/PostRegistrationMaintenanceTask.java @@ -145,7 +145,7 @@ public class PostRegistrationMaintenanceTask implements IDataStoreLockingMainten { IPostRegistrationTask task = entry.getValue(); String taskName = entry.getKey(); - executor.execute(task, taskName, code); + executor.execute(task, taskName, code, dataSet.isContainer()); } saveLastSeenDataSetId(dataSet.getId()); } catch (Throwable ex) diff --git a/datastore_server/source/java/ch/systemsx/cisd/etlserver/postregistration/TaskExecutor.java b/datastore_server/source/java/ch/systemsx/cisd/etlserver/postregistration/TaskExecutor.java index d65c2a1b0846912af88814b4b6bcc04ba7a33a12..303690fa76507ecd64fcacc8b7da2ceb41276ccd 100644 --- a/datastore_server/source/java/ch/systemsx/cisd/etlserver/postregistration/TaskExecutor.java +++ b/datastore_server/source/java/ch/systemsx/cisd/etlserver/postregistration/TaskExecutor.java @@ -74,14 +74,14 @@ public class TaskExecutor cleanupTasksFolder.mkdirs(); } - public void execute(IPostRegistrationTask task, String taskName, String dataSetCode) - throws Throwable + public void execute(IPostRegistrationTask task, String taskName, String dataSetCode, + boolean container) throws Throwable { ICleanupTask cleanupTask = null; File savedCleanupTask = null; try { - IPostRegistrationTaskExecutor executor = task.createExecutor(dataSetCode); + IPostRegistrationTaskExecutor executor = task.createExecutor(dataSetCode, container); cleanupTask = executor.createCleanupTask(); savedCleanupTask = saveCleanupTask(dataSetCode, taskName, cleanupTask); executor.execute(); diff --git a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/path/PathInfoDatabaseFeedingTaskTest.java b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/path/PathInfoDatabaseFeedingTaskTest.java index 3ed38aa1031940bcd28c1b113db71170d683821c..f86a7b2be2bf46ad0f173bbc6b2a84b791749760 100644 --- a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/path/PathInfoDatabaseFeedingTaskTest.java +++ b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/path/PathInfoDatabaseFeedingTaskTest.java @@ -136,7 +136,7 @@ public class PathInfoDatabaseFeedingTaskTest extends AbstractFileSystemTestCase }); prepareHappyCase(dataSet); - task.createExecutor(DATA_SET_CODE).execute(); + task.createExecutor(DATA_SET_CODE, false).execute(); } @Test @@ -153,7 +153,7 @@ public class PathInfoDatabaseFeedingTaskTest extends AbstractFileSystemTestCase }); prepareFailing(dataSet); - task.createExecutor(DATA_SET_CODE).execute(); + task.createExecutor(DATA_SET_CODE, false).execute(); } @Test @@ -176,7 +176,7 @@ public class PathInfoDatabaseFeedingTaskTest extends AbstractFileSystemTestCase } }); - task.createExecutor(DATA_SET_CODE).execute(); + task.createExecutor(DATA_SET_CODE, false).execute(); } @Test @@ -202,7 +202,7 @@ public class PathInfoDatabaseFeedingTaskTest extends AbstractFileSystemTestCase } }); - task.createExecutor(DATA_SET_CODE).execute(); + task.createExecutor(DATA_SET_CODE, false).execute(); } private void prepareHappyCase(final IDatasetLocation dataSet) diff --git a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/postregistration/ArchivingPostRegistrationTaskTest.java b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/postregistration/ArchivingPostRegistrationTaskTest.java index abc385d136bce77aa5ce719cc82aa738c666bd3a..513aee5b041940783a3f53ce088487852c6a81f7 100644 --- a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/postregistration/ArchivingPostRegistrationTaskTest.java +++ b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/postregistration/ArchivingPostRegistrationTaskTest.java @@ -94,7 +94,7 @@ public class ArchivingPostRegistrationTaskTest extends AssertJUnit LogMonitoringAppender.addAppender(LogCategory.NOTIFY, createEmailMessage(DATASET_CODE)); - task.createExecutor(DATASET_CODE).execute(); + task.createExecutor(DATASET_CODE, false).execute(); appender.verifyLogHasHappened(); context.assertIsSatisfied(); diff --git a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/postregistration/EagerShufflingTaskTest.java b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/postregistration/EagerShufflingTaskTest.java index d242bf4c224f8759a58076bd0d99180c2fadaf16..22e2fb0f3b7251d983205c6a6cc726fbc3454feb 100644 --- a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/postregistration/EagerShufflingTaskTest.java +++ b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/postregistration/EagerShufflingTaskTest.java @@ -129,7 +129,7 @@ public class EagerShufflingTaskTest extends AbstractFileSystemTestCase } }); - IPostRegistrationTaskExecutor executor = task.createExecutor(DATA_SET_CODE1); + IPostRegistrationTaskExecutor executor = task.createExecutor(DATA_SET_CODE1, false); executor.createCleanupTask(); executor.execute(); @@ -157,7 +157,7 @@ public class EagerShufflingTaskTest extends AbstractFileSystemTestCase } }); - IPostRegistrationTaskExecutor executor = task.createExecutor(DATA_SET_CODE1); + IPostRegistrationTaskExecutor executor = task.createExecutor(DATA_SET_CODE1, false); executor.createCleanupTask(); executor.execute(); @@ -180,7 +180,7 @@ public class EagerShufflingTaskTest extends AbstractFileSystemTestCase RecordingMatcher<String> logMessageMatcher = prepareLogging(LogLevel.WARN); - IPostRegistrationTaskExecutor executor = task.createExecutor(DATA_SET_CODE1); + IPostRegistrationTaskExecutor executor = task.createExecutor(DATA_SET_CODE1, false); executor.createCleanupTask(); executor.execute(); diff --git a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/postregistration/NotifyingTaskTest.java b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/postregistration/NotifyingTaskTest.java index e3160ee4702b3c29f2aaef01d0f0a9a3ec32e132..986d5a74340b2db9b6dfd57fc0790ee31bcbfb1c 100644 --- a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/postregistration/NotifyingTaskTest.java +++ b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/postregistration/NotifyingTaskTest.java @@ -85,7 +85,7 @@ public class NotifyingTaskTest extends AbstractFileSystemTestCase } }); NotifyingTask notifyingTask = new NotifyingTask(properties, service); - IPostRegistrationTaskExecutor executor = notifyingTask.createExecutor(DATA_SET_CODE); + IPostRegistrationTaskExecutor executor = notifyingTask.createExecutor(DATA_SET_CODE, false); ICleanupTask cleanupTask = executor.createCleanupTask(); executor.execute(); diff --git a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/postregistration/PostRegistrationMaintenanceTaskTest.java b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/postregistration/PostRegistrationMaintenanceTaskTest.java index caf2edab293e3c5cd79e1258b165a897b774a57c..1126f21a76f1f59072a3ac560b3ce3a188397026 100644 --- a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/postregistration/PostRegistrationMaintenanceTaskTest.java +++ b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/postregistration/PostRegistrationMaintenanceTaskTest.java @@ -103,9 +103,9 @@ public class PostRegistrationMaintenanceTaskTest extends AbstractFileSystemTestC return task.requiresDataStoreLock(); } - public IPostRegistrationTaskExecutor createExecutor(String dataSetCode) + public IPostRegistrationTaskExecutor createExecutor(String dataSetCode, boolean container) { - return task.createExecutor(dataSetCode); + return task.createExecutor(dataSetCode, container); } } @@ -283,7 +283,7 @@ public class PostRegistrationMaintenanceTaskTest extends AbstractFileSystemTestC DataSetBuilder ds2 = new DataSetBuilder(2).code("ds-2").registrationDate(new Date(4711)); will(returnValue(Arrays.asList(ds2.getDataSet(), ds1.getDataSet()))); - one(task1).createExecutor("ds-1"); + one(task1).createExecutor("ds-1", false); will(returnValue(executor1)); inSequence(sequence); one(executor1).createCleanupTask(); @@ -291,7 +291,7 @@ public class PostRegistrationMaintenanceTaskTest extends AbstractFileSystemTestC inSequence(sequence); one(executor1).execute(); inSequence(sequence); - one(task2).createExecutor("ds-1"); + one(task2).createExecutor("ds-1", false); will(returnValue(executor2)); inSequence(sequence); one(executor2).createCleanupTask(); @@ -300,7 +300,7 @@ public class PostRegistrationMaintenanceTaskTest extends AbstractFileSystemTestC one(executor2).execute(); inSequence(sequence); - one(task1).createExecutor("ds-2"); + one(task1).createExecutor("ds-2", false); will(returnValue(executor1)); inSequence(sequence); one(executor1).createCleanupTask(); @@ -308,7 +308,7 @@ public class PostRegistrationMaintenanceTaskTest extends AbstractFileSystemTestC inSequence(sequence); one(executor1).execute(); inSequence(sequence); - one(task2).createExecutor("ds-2"); + one(task2).createExecutor("ds-2", false); will(returnValue(executor2)); inSequence(sequence); one(executor2).createCleanupTask(); @@ -364,7 +364,7 @@ public class PostRegistrationMaintenanceTaskTest extends AbstractFileSystemTestC DataSetBuilder ds2 = new DataSetBuilder(2).code("ds-2").registrationDate(new Date(42)); will(returnValue(Arrays.asList(ds2.getDataSet(), ds1.getDataSet()))); - one(task1).createExecutor("ds-1"); + one(task1).createExecutor("ds-1", false); will(returnValue(executor1)); inSequence(sequence); one(executor1).createCleanupTask(); @@ -372,7 +372,7 @@ public class PostRegistrationMaintenanceTaskTest extends AbstractFileSystemTestC inSequence(sequence); one(executor1).execute(); inSequence(sequence); - one(task2).createExecutor("ds-1"); + one(task2).createExecutor("ds-1", false); will(returnValue(executor2)); inSequence(sequence); one(executor2).createCleanupTask(); @@ -420,7 +420,7 @@ public class PostRegistrationMaintenanceTaskTest extends AbstractFileSystemTestC DataSetBuilder ds3 = new DataSetBuilder(3).code("ds-3").registrationDate(new Date(4711)); will(returnValue(Arrays.asList(ds2.getDataSet(), ds3.getDataSet(), ds1.getDataSet()))); - one(task1).createExecutor("ds-1"); + one(task1).createExecutor("ds-1", false); will(returnValue(executor1)); inSequence(sequence); one(executor1).createCleanupTask(); @@ -428,7 +428,7 @@ public class PostRegistrationMaintenanceTaskTest extends AbstractFileSystemTestC inSequence(sequence); one(executor1).execute(); inSequence(sequence); - one(task2).createExecutor("ds-1"); + one(task2).createExecutor("ds-1", false); will(returnValue(executor2)); inSequence(sequence); one(executor2).createCleanupTask(); @@ -437,7 +437,7 @@ public class PostRegistrationMaintenanceTaskTest extends AbstractFileSystemTestC one(executor2).execute(); inSequence(sequence); - one(task1).createExecutor("ds-2"); + one(task1).createExecutor("ds-2", false); will(returnValue(executor1)); inSequence(sequence); one(executor1).createCleanupTask(); @@ -445,7 +445,7 @@ public class PostRegistrationMaintenanceTaskTest extends AbstractFileSystemTestC inSequence(sequence); one(executor1).execute(); inSequence(sequence); - one(task2).createExecutor("ds-2"); + one(task2).createExecutor("ds-2", false); will(returnValue(executor2)); inSequence(sequence); one(executor2).createCleanupTask();