mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
Rename NotebookRepoSettings to NotebookRepoSettingsInfo
This commit is contained in:
parent
42fd3b5faa
commit
23ad18e11a
8 changed files with 46 additions and 37 deletions
|
|
@ -17,11 +17,19 @@
|
|||
|
||||
package org.apache.zeppelin.notebook.repo;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.microsoft.azure.storage.CloudStorageAccount;
|
||||
import com.microsoft.azure.storage.StorageException;
|
||||
import com.microsoft.azure.storage.file.*;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.Writer;
|
||||
import java.net.URISyntaxException;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.zeppelin.conf.ZeppelinConfiguration;
|
||||
|
|
@ -33,14 +41,16 @@ import org.apache.zeppelin.scheduler.Job;
|
|||
import org.apache.zeppelin.user.AuthenticationInfo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import java.io.*;
|
||||
import java.net.URISyntaxException;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.microsoft.azure.storage.CloudStorageAccount;
|
||||
import com.microsoft.azure.storage.StorageException;
|
||||
import com.microsoft.azure.storage.file.CloudFile;
|
||||
import com.microsoft.azure.storage.file.CloudFileClient;
|
||||
import com.microsoft.azure.storage.file.CloudFileDirectory;
|
||||
import com.microsoft.azure.storage.file.CloudFileShare;
|
||||
import com.microsoft.azure.storage.file.ListFileItem;
|
||||
|
||||
/**
|
||||
* Azure storage backend for notebooks
|
||||
|
|
@ -231,7 +241,7 @@ public class AzureNotebookRepo implements NotebookRepo {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<NotebookRepoSettings> getSettings(AuthenticationInfo subject) {
|
||||
public List<NotebookRepoSettingsInfo> getSettings(AuthenticationInfo subject) {
|
||||
LOG.warn("Method not implemented");
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ public interface NotebookRepo {
|
|||
* @param subject
|
||||
* @return
|
||||
*/
|
||||
@ZeppelinApi public List<NotebookRepoSettings> getSettings(AuthenticationInfo subject);
|
||||
@ZeppelinApi public List<NotebookRepoSettingsInfo> getSettings(AuthenticationInfo subject);
|
||||
|
||||
/**
|
||||
* update notebook repo settings.
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import java.util.Map;
|
|||
* used in the frontend.
|
||||
*
|
||||
*/
|
||||
public class NotebookRepoSettings {
|
||||
public class NotebookRepoSettingsInfo {
|
||||
|
||||
/**
|
||||
* Type of value, It can be text or list.
|
||||
|
|
@ -33,8 +33,8 @@ public class NotebookRepoSettings {
|
|||
INPUT, DROPDOWN
|
||||
}
|
||||
|
||||
public static NotebookRepoSettings newInstance() {
|
||||
return new NotebookRepoSettings();
|
||||
public static NotebookRepoSettingsInfo newInstance() {
|
||||
return new NotebookRepoSettingsInfo();
|
||||
}
|
||||
|
||||
public Type type;
|
||||
|
|
@ -17,8 +17,6 @@
|
|||
|
||||
package org.apache.zeppelin.notebook.repo;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
|
@ -26,7 +24,6 @@ import java.util.ArrayList;
|
|||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
|
@ -41,6 +38,8 @@ import org.apache.zeppelin.user.AuthenticationInfo;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
/**
|
||||
* Notebook repository sync with remote storage
|
||||
*/
|
||||
|
|
@ -481,8 +480,8 @@ public class NotebookRepoSync implements NotebookRepo {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<NotebookRepoSettings> getSettings(AuthenticationInfo subject) {
|
||||
List<NotebookRepoSettings> repoSettings = Collections.emptyList();
|
||||
public List<NotebookRepoSettingsInfo> getSettings(AuthenticationInfo subject) {
|
||||
List<NotebookRepoSettingsInfo> repoSettings = Collections.emptyList();
|
||||
try {
|
||||
repoSettings = getRepo(0).getSettings(subject);
|
||||
} catch (IOException e) {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public class NotebookRepoWithSettings {
|
|||
|
||||
public String name;
|
||||
public String className;
|
||||
public List<NotebookRepoSettings> settings;
|
||||
public List<NotebookRepoSettingsInfo> settings;
|
||||
|
||||
private NotebookRepoWithSettings() {}
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ public class NotebookRepoWithSettings {
|
|||
public static class Builder {
|
||||
private final String name;
|
||||
private String className = StringUtils.EMPTY;
|
||||
private List<NotebookRepoSettings> settings = Collections.emptyList();
|
||||
private List<NotebookRepoSettingsInfo> settings = Collections.emptyList();
|
||||
|
||||
public Builder(String name) {
|
||||
this.name = name;
|
||||
|
|
@ -71,7 +71,7 @@ public class NotebookRepoWithSettings {
|
|||
return this;
|
||||
}
|
||||
|
||||
public Builder settings(List<NotebookRepoSettings> settings) {
|
||||
public Builder settings(List<NotebookRepoSettingsInfo> settings) {
|
||||
this.settings = settings;
|
||||
return this;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,10 +29,6 @@ import java.util.LinkedList;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.amazonaws.auth.AWSCredentialsProvider;
|
||||
import com.amazonaws.services.s3.AmazonS3EncryptionClient;
|
||||
import com.amazonaws.services.s3.model.EncryptionMaterialsProvider;
|
||||
import com.amazonaws.services.s3.model.KMSEncryptionMaterialsProvider;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.zeppelin.conf.ZeppelinConfiguration;
|
||||
|
|
@ -47,10 +43,14 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.amazonaws.AmazonClientException;
|
||||
import com.amazonaws.auth.AWSCredentialsProvider;
|
||||
import com.amazonaws.auth.DefaultAWSCredentialsProviderChain;
|
||||
import com.amazonaws.services.s3.AmazonS3;
|
||||
import com.amazonaws.services.s3.AmazonS3Client;
|
||||
import com.amazonaws.services.s3.AmazonS3EncryptionClient;
|
||||
import com.amazonaws.services.s3.model.EncryptionMaterialsProvider;
|
||||
import com.amazonaws.services.s3.model.GetObjectRequest;
|
||||
import com.amazonaws.services.s3.model.KMSEncryptionMaterialsProvider;
|
||||
import com.amazonaws.services.s3.model.ListObjectsRequest;
|
||||
import com.amazonaws.services.s3.model.ObjectListing;
|
||||
import com.amazonaws.services.s3.model.PutObjectRequest;
|
||||
|
|
@ -274,7 +274,7 @@ public class S3NotebookRepo implements NotebookRepo {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<NotebookRepoSettings> getSettings(AuthenticationInfo subject) {
|
||||
public List<NotebookRepoSettingsInfo> getSettings(AuthenticationInfo subject) {
|
||||
LOG.warn("Method not implemented");
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -297,12 +297,12 @@ public class VFSNotebookRepo implements NotebookRepo {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<NotebookRepoSettings> getSettings(AuthenticationInfo subject) {
|
||||
NotebookRepoSettings repoSetting = NotebookRepoSettings.newInstance();
|
||||
List<NotebookRepoSettings> settings = Lists.newArrayList();
|
||||
public List<NotebookRepoSettingsInfo> getSettings(AuthenticationInfo subject) {
|
||||
NotebookRepoSettingsInfo repoSetting = NotebookRepoSettingsInfo.newInstance();
|
||||
List<NotebookRepoSettingsInfo> settings = Lists.newArrayList();
|
||||
|
||||
repoSetting.name = "Notebook Path";
|
||||
repoSetting.type = NotebookRepoSettings.Type.INPUT;
|
||||
repoSetting.type = NotebookRepoSettingsInfo.Type.INPUT;
|
||||
repoSetting.value = Collections.emptyList();
|
||||
repoSetting.selected = getNotebookDirPath();
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import org.apache.zeppelin.conf.ZeppelinConfiguration;
|
|||
import org.apache.zeppelin.notebook.Note;
|
||||
import org.apache.zeppelin.notebook.NoteInfo;
|
||||
import org.apache.zeppelin.notebook.repo.NotebookRepo;
|
||||
import org.apache.zeppelin.notebook.repo.NotebookRepoSettings;
|
||||
import org.apache.zeppelin.notebook.repo.NotebookRepoSettingsInfo;
|
||||
import org.apache.zeppelin.notebook.repo.zeppelinhub.rest.ZeppelinhubRestApiHandler;
|
||||
import org.apache.zeppelin.notebook.repo.zeppelinhub.websocket.Client;
|
||||
import org.apache.zeppelin.user.AuthenticationInfo;
|
||||
|
|
@ -237,7 +237,7 @@ public class ZeppelinHubRepo implements NotebookRepo {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<NotebookRepoSettings> getSettings(AuthenticationInfo subject) {
|
||||
public List<NotebookRepoSettingsInfo> getSettings(AuthenticationInfo subject) {
|
||||
LOG.warn("Method not implemented");
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue