• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java SchedulerFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.zeppelin.scheduler.SchedulerFactory的典型用法代码示例。如果您正苦于以下问题:Java SchedulerFactory类的具体用法?Java SchedulerFactory怎么用?Java SchedulerFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SchedulerFactory类属于org.apache.zeppelin.scheduler包,在下文中一共展示了SchedulerFactory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setUp

import org.apache.zeppelin.scheduler.SchedulerFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  tmpDir = new File(System.getProperty("java.io.tmpdir")+"/ZeppelinLTest_"+System.currentTimeMillis());
  tmpDir.mkdirs();
  new File(tmpDir, "conf").mkdirs();
  notebookDir = new File(System.getProperty("java.io.tmpdir")+"/ZeppelinLTest_"+System.currentTimeMillis()+"/notebook");
  notebookDir.mkdirs();

  System.setProperty(ConfVars.ZEPPELIN_HOME.getVarName(), tmpDir.getAbsolutePath());
  System.setProperty(ConfVars.ZEPPELIN_NOTEBOOK_DIR.getVarName(), notebookDir.getAbsolutePath());
  System.setProperty(ConfVars.ZEPPELIN_INTERPRETERS.getVarName(), "org.apache.zeppelin.interpreter.mock.MockInterpreter1,org.apache.zeppelin.interpreter.mock.MockInterpreter2");

  conf = ZeppelinConfiguration.create();

  this.schedulerFactory = new SchedulerFactory();

  MockInterpreter1.register("mock1", "org.apache.zeppelin.interpreter.mock.MockInterpreter1");
  MockInterpreter2.register("mock2", "org.apache.zeppelin.interpreter.mock.MockInterpreter2");

  factory = new InterpreterFactory(conf, new InterpreterOption(false), null);

  SearchService search = mock(SearchService.class);
  notebookRepo = new VFSNotebookRepo(conf);
  notebook = new Notebook(conf, notebookRepo, schedulerFactory, factory, this, search);
}
 
开发者ID:lorthos,项目名称:incubator-zeppelin-druid,代码行数:26,代码来源:NotebookTest.java


示例2: getScheduler

import org.apache.zeppelin.scheduler.SchedulerFactory; //导入依赖的package包/类
@Override
public Scheduler getScheduler() {
  if (concurrentSQL()) {
    int maxConcurrency = 10;
    return SchedulerFactory.singleton().createOrGetParallelScheduler(
        SparkSqlInterpreter.class.getName() + this.hashCode(), maxConcurrency);
  } else {
    // getSparkInterpreter() calls open() inside.
    // That means if SparkInterpreter is not opened, it'll wait until SparkInterpreter open.
    // In this moment UI displays 'READY' or 'FINISHED' instead of 'PENDING' or 'RUNNING'.
    // It's because of scheduler is not created yet, and scheduler is created by this function.
    // Therefore, we can still use getSparkInterpreter() here, but it's better and safe
    // to getSparkInterpreter without opening it.
    for (Interpreter intp : getInterpreterGroup()) {
      if (intp.getClassName().equals(SparkInterpreter.class.getName())) {
        Interpreter p = intp;
        return p.getScheduler();
      } else {
        continue;
      }
    }
    throw new InterpreterException("Can't find SparkInterpreter");
  }
}
 
开发者ID:lorthos,项目名称:incubator-zeppelin-druid,代码行数:25,代码来源:SparkSqlInterpreter.java


示例3: getScheduler

import org.apache.zeppelin.scheduler.SchedulerFactory; //导入依赖的package包/类
@Override
public Scheduler getScheduler() {
  if (concurrentSQL()) {
    int maxConcurrency = 10;
    return SchedulerFactory.singleton().createOrGetParallelScheduler(
        LivySparkInterpreter.class.getName() + this.hashCode(), maxConcurrency);
  } else {
    Interpreter intp =
        getInterpreterInTheSameSessionByClassName(LivySparkInterpreter.class.getName());
    if (intp != null) {
      return intp.getScheduler();
    } else {
      return null;
    }
  }
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:17,代码来源:LivySparkSQLInterpreter.java


示例4: setUp

import org.apache.zeppelin.scheduler.SchedulerFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  System.setProperty(ConfVars.ZEPPELIN_NOTEBOOK_PUBLIC.getVarName(), "true");
  System.setProperty(ConfVars.ZEPPELIN_INTERPRETER_GROUP_ORDER.getVarName(), "mock1,mock2");
  super.setUp();

  schedulerFactory = SchedulerFactory.singleton();

  SearchService search = mock(SearchService.class);
  notebookRepo = new VFSNotebookRepo(conf);
  notebookAuthorization = NotebookAuthorization.init(conf);
  credentials = new Credentials(conf.credentialsPersist(), conf.getCredentialsPath(), null);

  notebook = new Notebook(conf, notebookRepo, schedulerFactory, interpreterFactory, interpreterSettingManager, this, search,
      notebookAuthorization, credentials);
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:17,代码来源:NotebookTest.java


示例5: getScheduler

import org.apache.zeppelin.scheduler.SchedulerFactory; //导入依赖的package包/类
@Override
public Scheduler getScheduler() {
  if (concurrentSQL()) {
    int maxConcurrency = 10;
    return SchedulerFactory.singleton().createOrGetParallelScheduler(
        SparkSqlInterpreter.class.getName() + this.hashCode(), maxConcurrency);
  } else {
    // getSparkInterpreter() calls open() inside.
    // That means if SparkInterpreter is not opened, it'll wait until SparkInterpreter open.
    // In this moment UI displays 'READY' or 'FINISHED' instead of 'PENDING' or 'RUNNING'.
    // It's because of scheduler is not created yet, and scheduler is created by this function.
    // Therefore, we can still use getSparkInterpreter() here, but it's better and safe
    // to getSparkInterpreter without opening it.

    Interpreter intp =
        getInterpreterInTheSameSessionByClassName(SparkInterpreter.class.getName());
    if (intp != null) {
      return intp.getScheduler();
    } else {
      return null;
    }
  }
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:24,代码来源:SparkSqlInterpreter.java


示例6: getScheduler

import org.apache.zeppelin.scheduler.SchedulerFactory; //导入依赖的package包/类
@Override
public Scheduler getScheduler() {
    String schedulerName = ImpalaInterpreter.class.getName() + this.hashCode();
    return isConcurrentExecution() ?
            SchedulerFactory.singleton().createOrGetParallelScheduler(schedulerName,
                    getMaxConcurrentConnection())
            : SchedulerFactory.singleton().createOrGetFIFOScheduler(schedulerName);
}
 
开发者ID:cas-bigdatalab,项目名称:zeppelin-impala-interpreter,代码行数:9,代码来源:ImpalaInterpreter.java


示例7: setUp

import org.apache.zeppelin.scheduler.SchedulerFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  String zpath = System.getProperty("java.io.tmpdir") + "/ZeppelinLTest_" + System.currentTimeMillis();
  mainZepDir = new File(zpath);
  mainZepDir.mkdirs();
  new File(mainZepDir, "conf").mkdirs();
  String mainNotePath = zpath + "/notebook";
  mainNotebookDir = new File(mainNotePath);
  mainNotebookDir.mkdirs();

  System.setProperty(ConfVars.ZEPPELIN_HOME.getVarName(), mainZepDir.getAbsolutePath());
  System.setProperty(ConfVars.ZEPPELIN_NOTEBOOK_DIR.getVarName(), mainNotebookDir.getAbsolutePath());
  System.setProperty(ConfVars.ZEPPELIN_INTERPRETERS.getVarName(), "org.apache.zeppelin.interpreter.mock.MockInterpreter1");
  System.setProperty(ConfVars.ZEPPELIN_NOTEBOOK_STORAGE.getVarName(), "org.apache.zeppelin.notebook.repo.VFSNotebookRepo");
  conf = ZeppelinConfiguration.create();

  this.schedulerFactory = new SchedulerFactory();

  MockInterpreter1.register("mock1", "org.apache.zeppelin.interpreter.mock.MockInterpreter1");

  this.schedulerFactory = new SchedulerFactory();
  factory = new InterpreterFactory(conf, new InterpreterOption(false), null);

  SearchService search = mock(SearchService.class);
  notebookRepo = new VFSNotebookRepo(conf);
  notebook = new Notebook(conf, notebookRepo, schedulerFactory, factory, this, search);
}
 
开发者ID:lorthos,项目名称:incubator-zeppelin-druid,代码行数:28,代码来源:VFSNotebookRepoTest.java


示例8: setUp

import org.apache.zeppelin.scheduler.SchedulerFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  String zpath = System.getProperty("java.io.tmpdir")+"/ZeppelinLTest_"+System.currentTimeMillis();
  mainZepDir = new File(zpath);
  mainZepDir.mkdirs();
  new File(mainZepDir, "conf").mkdirs();
  String mainNotePath = zpath+"/notebook";
  String secNotePath = mainNotePath + "_secondary";
  mainNotebookDir = new File(mainNotePath);
  secNotebookDir = new File(secNotePath);
  mainNotebookDir.mkdirs();
  secNotebookDir.mkdirs();

  System.setProperty(ConfVars.ZEPPELIN_HOME.getVarName(), mainZepDir.getAbsolutePath());
  System.setProperty(ConfVars.ZEPPELIN_NOTEBOOK_DIR.getVarName(), mainNotebookDir.getAbsolutePath());
  System.setProperty(ConfVars.ZEPPELIN_INTERPRETERS.getVarName(), "org.apache.zeppelin.interpreter.mock.MockInterpreter1,org.apache.zeppelin.interpreter.mock.MockInterpreter2");
  System.setProperty(ConfVars.ZEPPELIN_NOTEBOOK_STORAGE.getVarName(), "org.apache.zeppelin.notebook.repo.VFSNotebookRepo,org.apache.zeppelin.notebook.repo.mock.VFSNotebookRepoMock");
  LOG.info("main Note dir : " + mainNotePath);
  LOG.info("secondary note dir : " + secNotePath);
  conf = ZeppelinConfiguration.create();

  this.schedulerFactory = new SchedulerFactory();

  MockInterpreter1.register("mock1", "org.apache.zeppelin.interpreter.mock.MockInterpreter1");
  MockInterpreter2.register("mock2", "org.apache.zeppelin.interpreter.mock.MockInterpreter2");

  factory = new InterpreterFactory(conf, new InterpreterOption(false), null);
  
  SearchService search = mock(SearchService.class);
  notebookRepoSync = new NotebookRepoSync(conf);
  notebookSync = new Notebook(conf, notebookRepoSync, schedulerFactory, factory, this, search);
}
 
开发者ID:lorthos,项目名称:incubator-zeppelin-druid,代码行数:33,代码来源:NotebookRepoSyncTest.java


示例9: getScheduler

import org.apache.zeppelin.scheduler.SchedulerFactory; //导入依赖的package包/类
@Override
public Scheduler getScheduler() {
  int maxConcurrency = 10;
  RemoteInterpreterProcess interpreterProcess = getInterpreterProcess();
  if (interpreterProcess == null) {
    return null;
  } else {
    return SchedulerFactory.singleton().createOrGetRemoteScheduler(
        "remoteinterpreter_" + interpreterProcess.hashCode(), interpreterProcess,
        maxConcurrency);
  }
}
 
开发者ID:lorthos,项目名称:incubator-zeppelin-druid,代码行数:13,代码来源:RemoteInterpreter.java


示例10: getScheduler

import org.apache.zeppelin.scheduler.SchedulerFactory; //导入依赖的package包/类
@Override
public Scheduler getScheduler() {
  if (getProperty("parallel") != null && getProperty("parallel").equals("true")) {
    return SchedulerFactory.singleton().createOrGetParallelScheduler("interpreter_" + this.hashCode(), 10);
  } else {
    return SchedulerFactory.singleton().createOrGetFIFOScheduler("interpreter_" + this.hashCode());
  }
}
 
开发者ID:lorthos,项目名称:incubator-zeppelin-druid,代码行数:9,代码来源:MockInterpreterA.java


示例11: ZeppelinServer

import org.apache.zeppelin.scheduler.SchedulerFactory; //导入依赖的package包/类
public ZeppelinServer() throws Exception {
  ZeppelinConfiguration conf = ZeppelinConfiguration.create();

  this.schedulerFactory = new SchedulerFactory();
  this.replFactory = new InterpreterFactory(conf, notebookWsServer);
  this.notebookRepo = new NotebookRepoSync(conf);
  this.notebookIndex = new LuceneSearch();

  notebook = new Notebook(conf, 
      notebookRepo, schedulerFactory, replFactory, notebookWsServer, notebookIndex);
}
 
开发者ID:lorthos,项目名称:incubator-zeppelin-druid,代码行数:12,代码来源:ZeppelinServer.java


示例12: getScheduler

import org.apache.zeppelin.scheduler.SchedulerFactory; //导入依赖的package包/类
@Override
public Scheduler getScheduler() {
  if (concurrentRequests()) {
    return SchedulerFactory.singleton().createOrGetParallelScheduler(
        LensInterpreter.class.getName() + this.hashCode(), m_maxThreads);
  } else {
    return super.getScheduler();
  }
}
 
开发者ID:lorthos,项目名称:incubator-zeppelin-druid,代码行数:10,代码来源:LensInterpreter.java


示例13: getScheduler

import org.apache.zeppelin.scheduler.SchedulerFactory; //导入依赖的package包/类
@Override
public Scheduler getScheduler() {
  int maxConcurrency = Integer.parseInt(
      getProperty("zeppelin.interpreter.max.poolsize",
          ZeppelinConfiguration.ConfVars.ZEPPELIN_INTERPRETER_MAX_POOL_SIZE.getIntValue() + ""));

  Scheduler s = new RemoteScheduler(
      RemoteInterpreter.class.getName() + "-" + sessionId,
      SchedulerFactory.singleton().getExecutor(),
      sessionId,
      this,
      SchedulerFactory.singleton(),
      maxConcurrency);
  return SchedulerFactory.singleton().createOrGetScheduler(s);
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:16,代码来源:RemoteInterpreter.java


示例14: setUp

import org.apache.zeppelin.scheduler.SchedulerFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  System.setProperty(ZeppelinConfiguration.ConfVars.ZEPPELIN_INTERPRETER_GROUP_ORDER.getVarName(), "mock1,mock2");
  super.setUp();

  this.schedulerFactory = SchedulerFactory.singleton();
  heliumAppFactory = new HeliumApplicationFactory();
  // set AppEventListener properly
  for (InterpreterSetting interpreterSetting : interpreterSettingManager.get()) {
    interpreterSetting.setAppEventListener(heliumAppFactory);
  }

  SearchService search = mock(SearchService.class);
  notebookRepo = new VFSNotebookRepo(conf);
  NotebookAuthorization notebookAuthorization = NotebookAuthorization.init(conf);
  notebook = new Notebook(
      conf,
      notebookRepo,
      schedulerFactory,
      interpreterFactory,
      interpreterSettingManager,
      this,
      search,
      notebookAuthorization,
      new Credentials(false, null, null));

  heliumAppFactory.setNotebook(notebook);

  notebook.addNotebookEventListener(heliumAppFactory);

  anonymous = new AuthenticationInfo("anonymous");
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:33,代码来源:HeliumApplicationFactoryTest.java


示例15: setUp

import org.apache.zeppelin.scheduler.SchedulerFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  System.setProperty(ConfVars.ZEPPELIN_INTERPRETER_GROUP_ORDER.getVarName(), "mock1,mock2");
  System.setProperty(ConfVars.ZEPPELIN_NOTEBOOK_STORAGE.getVarName(), "org.apache.zeppelin.notebook.repo.VFSNotebookRepo");

  super.setUp();

  this.schedulerFactory = SchedulerFactory.singleton();
  SearchService search = mock(SearchService.class);
  notebookRepo = new VFSNotebookRepo(conf);
  notebookAuthorization = NotebookAuthorization.init(conf);
  notebook = new Notebook(conf, notebookRepo, schedulerFactory, interpreterFactory, interpreterSettingManager, this, search,
      notebookAuthorization, null);
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:15,代码来源:VFSNotebookRepoTest.java


示例16: setUp

import org.apache.zeppelin.scheduler.SchedulerFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  String zpath = System.getProperty("java.io.tmpdir")+"/ZeppelinLTest_"+System.currentTimeMillis();
  mainZepDir = new File(zpath);
  mainZepDir.mkdirs();
  new File(mainZepDir, "conf").mkdirs();
  String mainNotePath = zpath+"/notebook";
  String secNotePath = mainNotePath + "_secondary";
  mainNotebookDir = new File(mainNotePath);
  secNotebookDir = new File(secNotePath);
  mainNotebookDir.mkdirs();
  secNotebookDir.mkdirs();

  System.setProperty(ConfVars.ZEPPELIN_HOME.getVarName(), mainZepDir.getAbsolutePath());
  System.setProperty(ConfVars.ZEPPELIN_NOTEBOOK_DIR.getVarName(), mainNotebookDir.getAbsolutePath());
  System.setProperty(ConfVars.ZEPPELIN_NOTEBOOK_STORAGE.getVarName(), "org.apache.zeppelin.notebook.repo.VFSNotebookRepo,org.apache.zeppelin.notebook.repo.mock.VFSNotebookRepoMock");
  System.setProperty(ConfVars.ZEPPELIN_NOTEBOOK_ONE_WAY_SYNC.getVarName(), "false");
  LOG.info("main Note dir : " + mainNotePath);
  LOG.info("secondary note dir : " + secNotePath);
  conf = ZeppelinConfiguration.create();

  this.schedulerFactory = SchedulerFactory.singleton();

  depResolver = new DependencyResolver(mainZepDir.getAbsolutePath() + "/local-repo");
  interpreterSettingManager = new InterpreterSettingManager(conf,
      mock(AngularObjectRegistryListener.class), mock(RemoteInterpreterProcessListener.class), mock(ApplicationEventListener.class));
  factory = new InterpreterFactory(interpreterSettingManager);

  search = mock(SearchService.class);
  notebookRepoSync = new NotebookRepoSync(conf);
  notebookAuthorization = NotebookAuthorization.init(conf);
  credentials = new Credentials(conf.credentialsPersist(), conf.getCredentialsPath(), null);
  notebookSync = new Notebook(conf, notebookRepoSync, schedulerFactory, factory, interpreterSettingManager, this, search,
          notebookAuthorization, credentials);
  anonymous = new AuthenticationInfo("anonymous");
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:37,代码来源:NotebookRepoSyncTest.java


示例17: getScheduler

import org.apache.zeppelin.scheduler.SchedulerFactory; //导入依赖的package包/类
@Override
public Scheduler getScheduler() {
  if (Boolean.parseBoolean(getProperty("zeppelin.SleepInterpreter.parallel", "false"))) {
    return SchedulerFactory.singleton().createOrGetParallelScheduler(
        "Parallel-" + SleepInterpreter.class.getName(), 10);
  }
  return super.getScheduler();
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:9,代码来源:SleepInterpreter.java


示例18: getScheduler

import org.apache.zeppelin.scheduler.SchedulerFactory; //导入依赖的package包/类
@Override
public Scheduler getScheduler() {
  String schedulerName = JDBCInterpreter.class.getName() + this.hashCode();
  return isConcurrentExecution() ?
          SchedulerFactory.singleton().createOrGetParallelScheduler(schedulerName,
              getMaxConcurrentConnection())
          : SchedulerFactory.singleton().createOrGetFIFOScheduler(schedulerName);
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:9,代码来源:JDBCInterpreter.java


示例19: getScheduler

import org.apache.zeppelin.scheduler.SchedulerFactory; //导入依赖的package包/类
@Override
public Scheduler getScheduler() {
  if (iPythonInterpreter != null) {
    return iPythonInterpreter.getScheduler();
  }
  return SchedulerFactory.singleton().createOrGetFIFOScheduler(
      PythonInterpreter.class.getName() + this.hashCode());
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:9,代码来源:PythonInterpreter.java


示例20: getScheduler

import org.apache.zeppelin.scheduler.SchedulerFactory; //导入依赖的package包/类
@Override
public Scheduler getScheduler() {
  return SchedulerFactory.singleton().createOrGetParallelScheduler("mongo", 10);
}
 
开发者ID:bbonnin,项目名称:zeppelin-mongodb-interpreter,代码行数:5,代码来源:MongoDbInterpreter.java



注:本文中的org.apache.zeppelin.scheduler.SchedulerFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ConditionalStackTraceFilter类代码示例发布时间:2022-05-22
下一篇:
Java Default类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap