Clarified optional setting for Azure user folder and fixed Azure error handling

This commit is contained in:
Silvio Fiorito 2016-02-08 10:55:46 -05:00
parent 928c8b55ea
commit cbfbe4d476
3 changed files with 26 additions and 20 deletions

View file

@ -88,7 +88,7 @@
<property>
<name>zeppelin.notebook.azure.user</name>
<value>user</value>
<description>user name for Azure folder structure</description>
<description>optional user name for Azure folder structure</description>
</property>
<property>

View file

@ -188,7 +188,7 @@ You can configure Zeppelin with both **environment variables** in `conf/zeppelin
<td>ZEPPELIN_NOTEBOOK_AZURE_USER</td>
<td>zeppelin.notebook.azure.user</td>
<td>user</td>
<td>A user name of Azure file share<br />i.e. <code>share/user/notebook/2A94M5J1Z/note.json</code></td>
<td>An optional user name of Azure file share<br />i.e. <code>share/user/notebook/2A94M5J1Z/note.json</code></td>
</tr>
<tr>
<td>ZEPPELIN_NOTEBOOK_STORAGE</td>

View file

@ -86,10 +86,12 @@ public class AzureNotebookRepo implements NotebookRepo {
infos.add(info);
}
}
} catch (URISyntaxException e) {
LOG.error("Error enumerating notebooks", e);
} catch (StorageException e) {
LOG.error("Error enumerating notebooks", e);
} catch (StorageException | URISyntaxException e) {
String msg = "Error enumerating notebooks from Azure storage";
LOG.error(msg, e);
throw new IOException(msg, e);
}
}
}
@ -105,12 +107,12 @@ public class AzureNotebookRepo implements NotebookRepo {
CloudFile file = dir.getFileReference("note.json");
ins = file.openRead();
} catch (URISyntaxException e) {
LOG.error("Error reading file", e);
return null;
} catch (StorageException e) {
LOG.error("Error reading file", e);
return null;
} catch (URISyntaxException | StorageException e) {
String msg = String.format("Error reading notebook %s from Azure storage", noteId);
LOG.error(msg, e);
throw new IOException(msg, e);
}
String json = IOUtils.toString(ins,
@ -158,10 +160,12 @@ public class AzureNotebookRepo implements NotebookRepo {
CloudFile cloudFile = dir.getFileReference("note.json");
cloudFile.uploadFromByteArray(buffer, 0, buffer.length);
} catch (URISyntaxException e) {
LOG.error("Error saving file", e);
} catch (StorageException e) {
LOG.error("Error saving file", e);
} catch (URISyntaxException | StorageException e) {
String msg = String.format("Error saving notebook %s to Azure storage", note.getId());
LOG.error(msg, e);
throw new IOException(msg, e);
}
}
@ -188,10 +192,12 @@ public class AzureNotebookRepo implements NotebookRepo {
CloudFileDirectory dir = rootDir.getDirectoryReference(noteId);
delete(dir);
} catch (URISyntaxException e) {
LOG.error("Error deleting file", e);
} catch (StorageException e) {
LOG.error("Error deleting file", e);
} catch (URISyntaxException | StorageException e) {
String msg = String.format("Error deleting notebook %s from Azure storage", noteId);
LOG.error(msg, e);
throw new IOException(msg, e);
}
}