Commit 2bb95a3e authored by toaster's avatar toaster
Browse files

patch getinputstream, wait for group

git-svn-id: https://subversion.umiacs.umd.edu/ace/trunk@32 f1b3a171-7291-4a19-a512-95ad0ad9394a
parent 601c94b0
......@@ -248,7 +248,7 @@ public class SwapFileAccess extends StorageDriver {
LOG.trace("Path parses to uuid, testing " + id);
return client.getFileGroupList().get(id);
} catch ( IllegalArgumentException e ) {
LOG.trace("Path does not parse to a uuid, checking namespaces for '" + name +"'");
LOG.trace("Path does not parse to a uuid, checking namespaces for '" + name + "'");
for ( FileGroup fg : client.getFileGroupList() ) {
if ( fg.getCombinedNameSpace().equals(name) ) {
return fg;
......@@ -286,8 +286,7 @@ public class SwapFileAccess extends StorageDriver {
throw new RuntimeException("Could not open " + settings.getPrefix());
}
if (rootFile == null)
{
if ( rootFile == null ) {
LOG.error("Could not lookup swap file '" + settings.getPrefix() + "' ");
throw new RuntimeException("Could not open " + settings.getPrefix());
}
......@@ -328,11 +327,19 @@ public class SwapFileAccess extends StorageDriver {
public InputStream getItemInputStream( String itemPath ) throws IOException {
SwapClient client = createClient();
FileGroup group = groupByName(client, settings.getCollection().getDirectory());
FileGroup group;
SwapFile file;
try {
Thread.sleep(2000);
group = groupByName(client, settings.getCollection().getDirectory());
if ( group == null ) {
throw new IOException("Could not file swap file group");
throw new IOException("Could not open swap file group");
}
SwapFile file = null;
} catch ( InterruptedException e ) {
throw new IOException("Interrupted opening filegroup");
}
try {
file = group.getFileDetails(settings.getPrefix() + itemPath);
} catch ( InterruptedException e ) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment