com.twosigma.beakerx.kernel.Utils类的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(146)

本文整理了Java中com.twosigma.beakerx.kernel.Utils类的一些代码示例,展示了Utils类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils类的具体详情如下:
包路径:com.twosigma.beakerx.kernel.Utils
类名称:Utils

Utils介绍

暂无

代码示例

代码示例来源:origin: twosigma/beakerx

public Header(JupyterMessages type, String session) {
 date = timestamp();
 id = uuid();
 username = "kernel";
 this.type = type;
 this.session = checkNotNull(session);
 this.version = "5.3";
}

代码示例来源:origin: twosigma/beakerx

public String getImportsAsString() {
 return getAsString(IMPORT);
}

代码示例来源:origin: twosigma/beakerx

public Comm(String targetName) {
 this(Utils.commUUID(), targetName);
}

代码示例来源:origin: twosigma/beakerx

public static void main(final String[] args) {
 KernelRunner.run(() -> {
  String id = uuid();
  CommRepository beakerXCommRepository = new BeakerXCommRepository();
  KernelConfigurationFile configurationFile = new KernelConfigurationFile(args);
  KernelSocketsFactoryImpl kernelSocketsFactory = new KernelSocketsFactoryImpl(
      configurationFile);
  NamespaceClient namespaceClient = NamespaceClient.create(id, configurationFile, new ClojureBeakerXJsonSerializer(), beakerXCommRepository);
  MagicCommandConfiguration magicConfiguration = new MagicCommandConfigurationImpl();
  ClojureEvaluator evaluator = new ClojureEvaluator(id, id, getKernelParameters(), namespaceClient, magicConfiguration.patterns());
  return new Clojure(id,
      evaluator,
      kernelSocketsFactory,
      beakerXCommRepository,
      new ClojureBeakerXServer(new GetUrlArgHandler(namespaceClient)),
      magicConfiguration,
      new BeakerXJsonConfig());
 });
}

代码示例来源:origin: twosigma/beakerx

private void addOutputWidget(String outputCommId) throws InterruptedException {
 Utils.setFixedCommUUID(outputCommId);
 String addWidget = "" +
     "import com.twosigma.beakerx.widget.Output\n" +
     "out2 = new Output()\n" +
     "OutputManager.setOutput(out2)\n" +
     "out2";
 Message addWidgetMessage = getExecuteRequestMessage(addWidget);
 kernelSocketsService.handleMsg(addWidgetMessage);
 Optional<Message> idleAddWidget = waitForIdleMessage(kernelSocketsService.getKernelSockets());
 assertThat(idleAddWidget).isPresent();
 kernelSocketsService.clear();
 Utils.setDefaultCommUUID();
}

代码示例来源:origin: twosigma/beakerx

public static String getAsString(Collection<String> input) {
 if (input == null || input.isEmpty()) {
  return EMPTY_STRING;
 }
 return getUsString(input.toArray(new String[input.size()]));
}

代码示例来源:origin: twosigma/beakerx

public static void main(final String[] args) {
 KernelRunner.run(() -> {
  String id = uuid();
  CommRepository commRepository = new BeakerXCommRepository();
  KernelConfigurationFile configurationFile = new KernelConfigurationFile(args);
  KernelSocketsFactoryImpl kernelSocketsFactory = new KernelSocketsFactoryImpl(
      configurationFile);
  NamespaceClient beakerxClient = NamespaceClient.create(id, configurationFile, commRepository);
  MagicCommandConfiguration magicConfiguration = new MagicCommandConfigurationImpl();
  KotlinEvaluator e = new KotlinEvaluator(id,
      id,
      getKernelParameters(),
      beakerxClient,
      magicConfiguration.patterns());
  return new Kotlin(id,
      e,
      kernelSocketsFactory,
      commRepository,
      new KotlinBeakerXServer(new GetUrlArgHandler(beakerxClient)),
      magicConfiguration,
      new BeakerXJsonConfig());
 });
}

代码示例来源:origin: twosigma/beakerx

public static void main(final String[] args) {
 KernelRunner.run(() -> {
  String id = uuid();
  CommRepository commRepository = new BeakerXCommRepository();
  KernelConfigurationFile configurationFile = new KernelConfigurationFile(args);
  KernelSocketsFactoryImpl kernelSocketsFactory = new KernelSocketsFactoryImpl(
      configurationFile);
  EvaluatorParameters params = getKernelParameters(BeakerXSystemImpl.getINSTANCE());
  NamespaceClient beakerxClient = NamespaceClient.create(id, configurationFile, commRepository);
  MagicCommandConfiguration magicConfiguration = new MagicCommandConfigurationImpl();
  SQLEvaluator evaluator = new SQLEvaluator(id, id, params, beakerxClient, magicConfiguration.patterns());
  return new SQL(id,
      evaluator,
      kernelSocketsFactory,
      commRepository,
      new SQLBeakerXServer(new GetUrlArgHandler(beakerxClient)),
      magicConfiguration,
      new BeakerXJsonConfig());
 });
}

代码示例来源:origin: twosigma/beakerx

public String getClassPathAsString() {
 return getAsString(CLASS_PATH);
}

代码示例来源:origin: twosigma/beakerx

public Comm(TargetNamesEnum targetName) {
 this(Utils.commUUID(), targetName.getTargetName());
}

代码示例来源:origin: twosigma/beakerx

public static void main(final String[] args) {
 KernelRunner.run(() -> {
  String id = uuid();
  CommRepository commRepository = new BeakerXCommRepository();
  KernelConfigurationFile configurationFile = new KernelConfigurationFile(args);
  KernelSocketsFactoryImpl kernelSocketsFactory = new KernelSocketsFactoryImpl(
      configurationFile);
  NamespaceClient beakerxClient = NamespaceClient.create(id, configurationFile, commRepository);
  MagicCommandConfiguration magicConfiguration = new MagicCommandConfigurationImpl();
  JavaEvaluator e = new JavaEvaluator(id,
      id,
      getKernelParameters(),
      beakerxClient,
      magicConfiguration.patterns());
  return new Java(id,
      e,
      kernelSocketsFactory,
      commRepository,
      new JavaBeakerXServer(new GetUrlArgHandler(beakerxClient)),
      magicConfiguration,
      new BeakerXJsonConfig());
 });
}

代码示例来源:origin: twosigma/beakerx

public String getClassPathAsString() {
 Collection<String> listOfClassPath = (Collection<String>) kernelParameters.getParams().get(CLASSPATH);
 return getAsString(listOfClassPath);
}

代码示例来源:origin: twosigma/beakerx

public static void main(final String[] args) {
 KernelRunner.run(() -> {
  String id = uuid();
  KernelConfigurationFile configurationFile = new KernelConfigurationFile(args);
  KernelSocketsFactoryImpl kernelSocketsFactory = new KernelSocketsFactoryImpl(
      configurationFile);
  BeakerXCommRepository beakerXCommRepository = new BeakerXCommRepository();
  NamespaceClient namespaceClient = NamespaceClient.create(id, configurationFile, beakerXCommRepository);
  MagicCommandConfiguration magicCommandTypesFactory = new MagicCommandConfigurationImpl();
  GroovyEvaluator evaluator = new GroovyEvaluator(id,
      id,
      getEvaluatorParameters(),
      namespaceClient,
      magicCommandTypesFactory.patterns());
  return new Groovy(id,
      evaluator,
      kernelSocketsFactory,
      beakerXCommRepository,
      new GroovyBeakerXServer(new GetUrlArgHandler(namespaceClient)),
      magicCommandTypesFactory,
      new BeakerXJsonConfig());
 });
}

代码示例来源:origin: twosigma/beakerx

public static void main(final String[] args) {
 KernelRunner.run(() -> {
  String id = uuid();
  CommRepository commRepository = new BeakerXCommRepository();
  KernelConfigurationFile configurationFile = new KernelConfigurationFile(args);
  KernelSocketsFactoryImpl kernelSocketsFactory = new KernelSocketsFactoryImpl(configurationFile);
  NamespaceClient namespaceClient = NamespaceClient.create(id, configurationFile, new ScalaBeakerXJsonSerializer(), commRepository);
  MagicCommandConfiguration magicConfiguration = new MagicCommandConfigurationImpl();
  ScalaEvaluator se = new ScalaEvaluator(
      id,
      id,
      new BeakerCellExecutor("scala"),
      new BeakerxObjectFactoryImpl(),
      new TempFolderFactoryImpl(),
      getKernelParameters(),
      namespaceClient,
      magicConfiguration.patterns());
  return new Scala(id,
      se,
      kernelSocketsFactory,
      commRepository,
      new ScalaBeakerXServer(new GetUrlArgHandler(namespaceClient)),
      magicConfiguration,
      new BeakerXJsonConfig());
 });
}

代码示例来源:origin: scijava/scijava-jupyter-kernel

@Override
public void runKernel(String logLevel, Path connectionFile) {
  KernelRunner.run(() -> {
    String id = uuid();
    // Setup configuration
    ScijavaKernelConfigurationFile config = new ScijavaKernelConfigurationFile(this.context,
        logLevel,
        connectionFile);
    // Setup the socket
    KernelSocketsFactoryImpl kernelSocketsFactory = new KernelSocketsFactoryImpl(config);
    // Setup the evaluator
    ScijavaEvaluator evaluator = new ScijavaEvaluator(context, id, id);
    // Launch the kernel
    return new ScijavaKernel(context, id, evaluator, config, kernelSocketsFactory);
  });
}

相关文章