Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URISyntaxException;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -175,15 +173,4 @@ public void remove(String folderPath, AuthenticationInfo subject) {
public void close() {
}

@Override
public List<NotebookRepoSettingsInfo> getSettings(AuthenticationInfo subject) {
LOGGER.warn("Method not implemented");
return Collections.emptyList();
}

@Override
public void updateSettings(Map<String, String> settings, AuthenticationInfo subject) {
LOGGER.warn("Method not implemented");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -132,15 +131,4 @@ public void close() {
LOGGER.warn("close is not implemented for FileSystemNotebookRepo");
}

@Override
public List<NotebookRepoSettingsInfo> getSettings(AuthenticationInfo subject) {
LOGGER.warn("getSettings is not implemented for FileSystemNotebookRepo");
return Collections.emptyList();
}

@Override
public void updateSettings(Map<String, String> settings, AuthenticationInfo subject) {
LOGGER.warn("updateSettings is not implemented for FileSystemNotebookRepo");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -304,14 +303,4 @@ public void close() {
//no-op
}

@Override
public List<NotebookRepoSettingsInfo> getSettings(AuthenticationInfo subject) {
LOGGER.warn("getSettings is not implemented for GCSNotebookRepo");
return Collections.emptyList();
}

@Override
public void updateSettings(Map<String, String> settings, AuthenticationInfo subject) {
LOGGER.warn("updateSettings is not implemented for GCSNotebookRepo");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -332,17 +332,6 @@ public void close() {
client.close();
}

@Override
public List<NotebookRepoSettingsInfo> getSettings(AuthenticationInfo subject) {
LOGGER.warn("Method not implemented");
return Collections.emptyList();
}

@Override
public void updateSettings(Map<String, String> settings, AuthenticationInfo subject) {
LOGGER.warn("Method not implemented");
}

/**
* create until parent folder if not exists.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,18 +184,6 @@ public void close() {
ossOperator.shutdown();
}

@Override
public List<NotebookRepoSettingsInfo> getSettings(AuthenticationInfo subject) {
LOGGER.warn("Method not implemented");
return Collections.emptyList();
}

@Override
public void updateSettings(Map<String, String> settings, AuthenticationInfo subject) {
LOGGER.warn("Method not implemented");
}


private static String buildRevisionsDirName(String noteId, String notePath) throws IOException {
if (!notePath.startsWith("/")) {
throw new IOException("Invalid notePath: " + notePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.io.FileUtils;
Expand Down Expand Up @@ -324,15 +322,4 @@ public void close() {
s3client.shutdown();
}
}

@Override
public List<NotebookRepoSettingsInfo> getSettings(AuthenticationInfo subject) {
LOGGER.warn("Method not implemented");
return Collections.emptyList();
}

@Override
public void updateSettings(Map<String, String> settings, AuthenticationInfo subject) {
LOGGER.warn("Method not implemented");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
import org.apache.zeppelin.user.AuthenticationInfo;

import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class InMemoryNotebookRepo extends AbstractNotebookRepo {
Expand Down Expand Up @@ -107,16 +105,6 @@ public void close() {

}

@Override
public List<NotebookRepoSettingsInfo> getSettings(AuthenticationInfo subject) {
return Collections.emptyList();
}

@Override
public void updateSettings(Map<String, String> settings, AuthenticationInfo subject) {

}

public void reset() {
this.notes.clear();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@
import org.apache.zeppelin.notebook.NoteParser;
import org.apache.zeppelin.notebook.NoteInfo;
import org.apache.zeppelin.user.AuthenticationInfo;
import org.slf4j.LoggerFactory;

import java.io.Closeable;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -125,20 +127,33 @@ void move(String folderPath, String newFolderPath,
/**
* Get NotebookRepo settings got the given user.
*
* Implementations that don't expose any configurable setting can rely on this default,
* which reports that the repo has no settings.
*
* @param subject
* @return
*/
@ZeppelinApi
List<NotebookRepoSettingsInfo> getSettings(AuthenticationInfo subject);
default List<NotebookRepoSettingsInfo> getSettings(AuthenticationInfo subject) {
LoggerFactory.getLogger(getClass())
.debug("getSettings is not implemented for {}", getClass().getSimpleName());
return Collections.emptyList();
}

/**
* update notebook repo settings.
*
* Implementations that don't expose any configurable setting can rely on this default,
* which ignores the update and warns about it.
*
* @param settings
* @param subject
*/
@ZeppelinApi
void updateSettings(Map<String, String> settings, AuthenticationInfo subject);
default void updateSettings(Map<String, String> settings, AuthenticationInfo subject) {
LoggerFactory.getLogger(getClass())
.warn("updateSettings is not implemented for {}", getClass().getSimpleName());
}

NoteParser getNoteParser();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import org.apache.zeppelin.interpreter.InterpreterSetting;
import org.apache.zeppelin.interpreter.remote.RemoteInterpreter;
import org.apache.zeppelin.notebook.repo.NotebookRepo;
import org.apache.zeppelin.notebook.repo.NotebookRepoSettingsInfo;
import org.apache.zeppelin.notebook.repo.NotebookRepoWithVersionControl;
import org.apache.zeppelin.notebook.repo.VFSNotebookRepo;
import org.apache.zeppelin.notebook.scheduler.QuartzSchedulerService;
Expand Down Expand Up @@ -61,7 +60,6 @@
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
Expand Down Expand Up @@ -190,16 +188,6 @@ public void close() {

}

@Override
public List<NotebookRepoSettingsInfo> getSettings(AuthenticationInfo subject) {
return Collections.emptyList();
}

@Override
public void updateSettings(Map<String, String> settings, AuthenticationInfo subject) {

}

@Override
public NoteParser getNoteParser() {
return null;
Expand Down Expand Up @@ -276,16 +264,6 @@ public void close() {

}

@Override
public List<NotebookRepoSettingsInfo> getSettings(AuthenticationInfo subject) {
return Collections.emptyList();
}

@Override
public void updateSettings(Map<String, String> settings, AuthenticationInfo subject) {

}

@Override
public NoteParser getNoteParser() {
return null;
Expand Down
Loading