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


Java SchedulerFactory类代码示例

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


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


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