Reenabling code that was commented out after it was confirmed to work by many participating in this thread:
http://getsatisfaction.com/gsa/topics/error_thrown_when_reading_reference_file git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3981 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
48e311a5ea
commit
6b4a1e3b9f
|
|
@ -143,39 +143,39 @@ public class ReferenceDataSource implements ReferenceDataSourceProgressListener
|
|||
* but is incomplete). To avoid this, obtain shared locks on both files before creating IndexedFastaSequenceFile.
|
||||
*/
|
||||
|
||||
// FSLockWithShared dictLock = new FSLockWithShared(dictFile,true);
|
||||
// FSLockWithShared indexLock = new FSLockWithShared(indexFile,true);
|
||||
// try {
|
||||
// try {
|
||||
// if (!dictLock.sharedLock()) {
|
||||
// throw new StingException("Could not open dictionary file because a lock could not be obtained.");
|
||||
// }
|
||||
// }
|
||||
// catch(FileSystemInabilityToLockException ex) {
|
||||
// logger.info(String.format("Unable to create a lock on dictionary file: %s",ex.getMessage()));
|
||||
// logger.info("Treating existing dictionary file as complete.");
|
||||
// }
|
||||
//
|
||||
// try {
|
||||
// if (!indexLock.sharedLock()) {
|
||||
// throw new StingException("Could not open index file because a lock could not be obtained.");
|
||||
// }
|
||||
// }
|
||||
// catch(FileSystemInabilityToLockException ex) {
|
||||
// logger.info(String.format("Unable to create a lock on index file: %s",ex.getMessage()));
|
||||
// logger.info("Treating existing index file as complete.");
|
||||
// }
|
||||
FSLockWithShared dictLock = new FSLockWithShared(dictFile,true);
|
||||
FSLockWithShared indexLock = new FSLockWithShared(indexFile,true);
|
||||
try {
|
||||
try {
|
||||
if (!dictLock.sharedLock()) {
|
||||
throw new StingException("Could not open dictionary file because a lock could not be obtained.");
|
||||
}
|
||||
}
|
||||
catch(FileSystemInabilityToLockException ex) {
|
||||
logger.info(String.format("Unable to create a lock on dictionary file: %s",ex.getMessage()));
|
||||
logger.info("Treating existing dictionary file as complete.");
|
||||
}
|
||||
|
||||
index = new IndexedFastaSequenceFile(fastaFile);
|
||||
//
|
||||
// }
|
||||
// catch (Exception e) {
|
||||
// throw new StingException(String.format("Error reading fasta file %s.", fastaFile.getAbsolutePath()), e);
|
||||
// }
|
||||
// finally {
|
||||
// dictLock.unlock();
|
||||
// indexLock.unlock();
|
||||
// }
|
||||
try {
|
||||
if (!indexLock.sharedLock()) {
|
||||
throw new StingException("Could not open index file because a lock could not be obtained.");
|
||||
}
|
||||
}
|
||||
catch(FileSystemInabilityToLockException ex) {
|
||||
logger.info(String.format("Unable to create a lock on index file: %s",ex.getMessage()));
|
||||
logger.info("Treating existing index file as complete.");
|
||||
}
|
||||
|
||||
index = new IndexedFastaSequenceFile(fastaFile);
|
||||
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new StingException(String.format("Error reading fasta file %s.", fastaFile.getAbsolutePath()), e);
|
||||
}
|
||||
finally {
|
||||
dictLock.unlock();
|
||||
indexLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue