@@ -131,6 +131,10 @@ protected Integer getOrCreateOutputFile(Object dataFileUrl, Object folderName, S
131131
132132 File subDir = getLocalSubdir (folderName );
133133 File localCopy = doFileCopy (f , subDir , name );
134+ if (localCopy == null )
135+ {
136+ // TODO
137+ }
134138
135139 //first create the ExpData
136140 ExpData d = ExperimentService .get ().getExpDataByURL (localCopy , getContainerUser ().getContainer ());
@@ -203,7 +207,11 @@ protected File getLocalSubdir(Object folderName) throws PipelineJobException
203207
204208 protected File doFileCopy (File f , File subdir , @ Nullable String name ) throws PipelineJobException
205209 {
206- getStatusLogger ().info ("preparing to copy file: " + f .getPath ());
210+ getStatusLogger ().info ("preparing to copy file: " + f .getPath () + ", with name: " + name );
211+ if (f .getName ().equals ("write.lock" ))
212+ {
213+ return LuceneIndexTransform .doLuceneCopy (f , subdir , name , getStatusLogger (), getContainerUser ().getContainer ());
214+ }
207215
208216 //Copy file locally, plus index if exists:
209217 File localCopy = new File (subdir , name == null || f .getName ().startsWith ("mGap.v" ) ? f .getName () : FileUtil .makeLegalName (name ).replaceAll (" " , "_" ) + ".vcf.gz" );
@@ -227,6 +235,10 @@ protected File doFileCopy(File f, File subdir, @Nullable String name) throws Pip
227235 try
228236 {
229237 Files .delete (localCopy .toPath ());
238+ if (localCopy .exists ())
239+ {
240+ throw new PipelineJobException ("Unable to delete file: " + localCopy .getPath ());
241+ }
230242 }
231243 catch (IOException e )
232244 {
@@ -241,20 +253,24 @@ protected File doFileCopy(File f, File subdir, @Nullable String name) throws Pip
241253
242254 if (doCopy )
243255 {
244- getStatusLogger ().info ("queueing file copy: " + localCopy .getPath ());
256+ getStatusLogger ().info ("Creating symlink: " + f . getPath () + " / " + localCopy .getPath ());
245257 try
246258 {
247259 if (!Files .isReadable (f .toPath ()))
248260 {
249261 throw new PipelineJobException ("Unable to read file: " + f .getPath ());
250262 }
251263
264+ if (localCopy .exists ())
265+ {
266+ throw new PipelineJobException ("File should have been deleted: " + localCopy .getPath ());
267+ }
268+
252269 Files .createSymbolicLink (f .toPath (), localCopy .toPath ());
253270 }
254271 catch (IOException e )
255272 {
256- getStatusLogger ().error ("Failed to create symlink: " + localCopy .getPath (), e );
257- return null ;
273+ throw new PipelineJobException ("Failed to create symlink: " + localCopy .getPath (), e );
258274 }
259275 }
260276
@@ -270,16 +286,20 @@ protected File doFileCopy(File f, File subdir, @Nullable String name) throws Pip
270286
271287 if (!indexLocal .exists ())
272288 {
273- getStatusLogger ().info ("queueing copy of index: " + indexLocal .getPath ());
289+ getStatusLogger ().info ("Creating symlink copy of VCF index: " + index . getPath () + " / " + indexLocal .getPath ());
274290 try
275291 {
276- Files .createSymbolicLink (f .toPath (), localCopy .toPath ());
292+ Files .createSymbolicLink (index .toPath (), indexLocal .toPath ());
277293 }
278294 catch (IOException e )
279295 {
280- getStatusLogger ().error ("Failed to create symlink: " + localCopy .getPath (), e );
296+ getStatusLogger ().error ("Failed to create symlink: " + indexLocal .getPath (), e );
281297 }
282298 }
299+ else
300+ {
301+ getStatusLogger ().info ("Local index already exists: " + indexLocal .getPath ());
302+ }
283303 }
284304
285305 return localCopy ;
0 commit comments