本文整理汇总了Java中org.apache.zeppelin.dep.Dependency类的典型用法代码示例。如果您正苦于以下问题:Java Dependency类的具体用法?Java Dependency怎么用?Java Dependency使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Dependency类属于org.apache.zeppelin.dep包,在下文中一共展示了Dependency类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createNewSetting
import org.apache.zeppelin.dep.Dependency; //导入依赖的package包/类
public InterpreterSetting createNewSetting(String name, String group,
List<Dependency> dependencies, InterpreterOption option, Map<String, InterpreterProperty> p)
throws IOException {
if (name.indexOf(".") >= 0) {
throw new IOException("'.' is invalid for InterpreterSetting name.");
}
// check if name is existed
for (InterpreterSetting interpreterSetting : interpreterSettings.values()) {
if (interpreterSetting.getName().equals(name)) {
throw new IOException("Interpreter " + name + " already existed");
}
}
InterpreterSetting setting = new InterpreterSetting(interpreterSettingTemplates.get(group));
setting.setName(name);
setting.setGroup(group);
//TODO(zjffdu) Should use setDependencies
setting.appendDependencies(dependencies);
setting.setInterpreterOption(option);
setting.setProperties(p);
initInterpreterSetting(setting);
interpreterSettings.put(setting.getId(), setting);
saveToFile();
return setting;
}
示例2: setPropertyAndRestart
import org.apache.zeppelin.dep.Dependency; //导入依赖的package包/类
/**
* Change interpreter properties and restart
*/
public void setPropertyAndRestart(String id, InterpreterOption option,
Map<String, InterpreterProperty> properties,
List<Dependency> dependencies)
throws InterpreterException, IOException {
synchronized (interpreterSettings) {
InterpreterSetting intpSetting = interpreterSettings.get(id);
if (intpSetting != null) {
try {
intpSetting.close();
intpSetting.setOption(option);
intpSetting.setProperties(properties);
intpSetting.setDependencies(dependencies);
intpSetting.postProcessing();
saveToFile();
} catch (Exception e) {
loadFromFile();
throw new IOException(e);
}
} else {
throw new InterpreterException("Interpreter setting id " + id + " not found");
}
}
}
示例3: fetch
import org.apache.zeppelin.dep.Dependency; //导入依赖的package包/类
/**
* fetch all artifacts
* @return
* @throws MalformedURLException
* @throws ArtifactResolutionException
* @throws DependencyResolutionException
*/
public List<File> fetch() throws MalformedURLException,
DependencyResolutionException, ArtifactResolutionException {
for (Dependency dep : dependencies) {
if (!dep.isLocalFsArtifact()) {
List<ArtifactResult> artifacts = fetchArtifactWithDep(dep);
for (ArtifactResult artifact : artifacts) {
if (dep.isDist()) {
filesDist.add(artifact.getArtifact().getFile());
}
files.add(artifact.getArtifact().getFile());
}
} else {
if (dep.isDist()) {
filesDist.add(new File(dep.getGroupArtifactVersion()));
}
files.add(new File(dep.getGroupArtifactVersion()));
}
}
return files;
}
示例4: appendDependencies
import org.apache.zeppelin.dep.Dependency; //导入依赖的package包/类
void appendDependencies(List<Dependency> dependencies) {
for (Dependency dependency : dependencies) {
if (!this.dependencies.contains(dependency)) {
this.dependencies.add(dependency);
}
}
loadInterpreterDependencies();
}
示例5: copyDependenciesFromLocalPath
import org.apache.zeppelin.dep.Dependency; //导入依赖的package包/类
/**
* Overwrite dependency jar under local-repo/{interpreterId}
* if jar file in original path is changed
*/
private void copyDependenciesFromLocalPath(final InterpreterSetting setting) {
setting.setStatus(InterpreterSetting.Status.DOWNLOADING_DEPENDENCIES);
synchronized (interpreterSettings) {
final Thread t = new Thread() {
public void run() {
try {
List<Dependency> deps = setting.getDependencies();
if (deps != null) {
for (Dependency d : deps) {
File destDir = new File(
conf.getRelativeDir(ConfVars.ZEPPELIN_DEP_LOCALREPO));
int numSplits = d.getGroupArtifactVersion().split(":").length;
if (!(numSplits >= 3 && numSplits <= 6)) {
dependencyResolver.copyLocalDependency(d.getGroupArtifactVersion(),
new File(destDir, setting.getId()));
}
}
}
setting.setStatus(InterpreterSetting.Status.READY);
} catch (Exception e) {
LOGGER.error(String.format("Error while copying deps for interpreter group : %s," +
" go to interpreter setting page click on edit and save it again to make " +
"this interpreter work properly.",
setting.getGroup()), e);
setting.setErrorReason(e.getLocalizedMessage());
setting.setStatus(InterpreterSetting.Status.ERROR);
} finally {
}
}
};
t.start();
}
}
示例6: load
import org.apache.zeppelin.dep.Dependency; //导入依赖的package包/类
public Dependency load(String lib) {
Dependency dep = new Dependency(lib);
if (dependencies.contains(dep)) {
dependencies.remove(dep);
}
dependencies.add(dep);
return dep;
}
示例7: setDependencies
import org.apache.zeppelin.dep.Dependency; //导入依赖的package包/类
public Builder setDependencies(List<Dependency> dependencies) {
interpreterSetting.dependencies = dependencies;
return this;
}
示例8: getDependencies
import org.apache.zeppelin.dep.Dependency; //导入依赖的package包/类
public List<Dependency> getDependencies() {
return dependencies;
}
示例9: registerInterpreterSetting
import org.apache.zeppelin.dep.Dependency; //导入依赖的package包/类
private void registerInterpreterSetting(List<RegisteredInterpreter> registeredInterpreters,
String interpreterDir) throws IOException {
Map<String, DefaultInterpreterProperty> properties = new HashMap<>();
List<InterpreterInfo> interpreterInfos = new ArrayList<>();
InterpreterOption option = defaultOption;
String group = null;
InterpreterRunner runner = null;
for (RegisteredInterpreter registeredInterpreter : registeredInterpreters) {
//TODO(zjffdu) merge RegisteredInterpreter & InterpreterInfo
InterpreterInfo interpreterInfo =
new InterpreterInfo(registeredInterpreter.getClassName(), registeredInterpreter.getName(),
registeredInterpreter.isDefaultInterpreter(), registeredInterpreter.getEditor());
group = registeredInterpreter.getGroup();
runner = registeredInterpreter.getRunner();
// use defaultOption if it is not specified in interpreter-setting.json
if (registeredInterpreter.getOption() != null) {
option = registeredInterpreter.getOption();
}
properties.putAll(registeredInterpreter.getProperties());
interpreterInfos.add(interpreterInfo);
}
InterpreterSetting interpreterSettingTemplate = new InterpreterSetting.Builder()
.setGroup(group)
.setName(group)
.setInterpreterInfos(interpreterInfos)
.setProperties(properties)
.setDependencies(new ArrayList<Dependency>())
.setOption(option)
.setRunner(runner)
.setInterpreterDir(interpreterDir)
.setRunner(runner)
.setConf(conf)
.setIntepreterSettingManager(this)
.create();
LOGGER.info("Register InterpreterSettingTemplate & InterpreterSetting: {}",
interpreterSettingTemplate.getName());
interpreterSettingTemplates.put(interpreterSettingTemplate.getName(),
interpreterSettingTemplate);
InterpreterSetting interpreterSetting = new InterpreterSetting(interpreterSettingTemplate);
initInterpreterSetting(interpreterSetting);
}
示例10: UpdateInterpreterSettingRequest
import org.apache.zeppelin.dep.Dependency; //导入依赖的package包/类
public UpdateInterpreterSettingRequest(Map<String, InterpreterProperty> properties,
List<Dependency> dependencies, InterpreterOption option) {
this.properties = properties;
this.dependencies = dependencies;
this.option = option;
}
示例11: UpdateInterpreterSettingRequest
import org.apache.zeppelin.dep.Dependency; //导入依赖的package包/类
public UpdateInterpreterSettingRequest(Map<String, InterpreterProperty> properties,
List<Dependency> dependencies, InterpreterOption option) {
this.properties = properties;
this.dependencies = dependencies;
this.option = option;
}