当前位置: 首页>>代码示例>>Java>>正文


Java SchedulerFactory.singleton方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: ZeppelinServer

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



  InterpreterOutput.limit = conf.getInt(ConfVars.ZEPPELIN_INTERPRETER_OUTPUT_LIMIT);

  HeliumApplicationFactory heliumApplicationFactory = new HeliumApplicationFactory();
  HeliumBundleFactory heliumBundleFactory;

  if (isBinaryPackage(conf)) {
    /* In binary package, zeppelin-web/src/app/visualization and zeppelin-web/src/app/tabledata
     * are copied to lib/node_modules/zeppelin-vis, lib/node_modules/zeppelin-tabledata directory.
     * Check zeppelin/zeppelin-distribution/src/assemble/distribution.xml to see how they're
     * packaged into binary package.
     */
    heliumBundleFactory = new HeliumBundleFactory(
        conf,
        null,
        new File(conf.getRelativeDir(ConfVars.ZEPPELIN_DEP_LOCALREPO)),
        new File(conf.getRelativeDir("lib/node_modules/zeppelin-tabledata")),
        new File(conf.getRelativeDir("lib/node_modules/zeppelin-vis")),
        new File(conf.getRelativeDir("lib/node_modules/zeppelin-spell")));
  } else {
    heliumBundleFactory = new HeliumBundleFactory(
        conf,
        null,
        new File(conf.getRelativeDir(ConfVars.ZEPPELIN_DEP_LOCALREPO)),
        new File(conf.getRelativeDir("zeppelin-web/src/app/tabledata")),
        new File(conf.getRelativeDir("zeppelin-web/src/app/visualization")),
        new File(conf.getRelativeDir("zeppelin-web/src/app/spell")));
  }

  this.schedulerFactory = SchedulerFactory.singleton();
  this.interpreterSettingManager = new InterpreterSettingManager(conf, notebookWsServer,
      notebookWsServer, notebookWsServer);
  this.replFactory = new InterpreterFactory(interpreterSettingManager);
  this.notebookRepo = new NotebookRepoSync(conf);
  this.noteSearchService = new LuceneSearch();
  this.notebookAuthorization = NotebookAuthorization.getInstance();
  this.credentials = new Credentials(
      conf.credentialsPersist(),
      conf.getCredentialsPath(),
      conf.getCredentialsEncryptKey());
  notebook = new Notebook(conf,
      notebookRepo, schedulerFactory, replFactory, interpreterSettingManager, notebookWsServer,
          noteSearchService, notebookAuthorization, credentials);
  this.configStorage = ConfigStorage.getInstance(conf);

  ZeppelinServer.helium = new Helium(
      conf.getHeliumConfPath(),
      conf.getHeliumRegistry(),
      new File(conf.getRelativeDir(ConfVars.ZEPPELIN_DEP_LOCALREPO),
          "helium-registry-cache"),
      heliumBundleFactory,
      heliumApplicationFactory,
      interpreterSettingManager);

  // create bundle
  try {
    heliumBundleFactory.buildAllPackages(helium.getBundlePackagesToBundle());
  } catch (Exception e) {
    LOG.error(e.getMessage(), e);
  }
  
  // to update notebook from application event from remote process.
  heliumApplicationFactory.setNotebook(notebook);
  // to update fire websocket event on application event.
  heliumApplicationFactory.setApplicationEventListener(notebookWsServer);

  notebook.addNotebookEventListener(heliumApplicationFactory);
  notebook.addNotebookEventListener(notebookWsServer.getNotebookInformationListener());
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:74,代码来源:ZeppelinServer.java


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