Package org.renjin.eval

Examples of org.renjin.eval.SessionBuilder


  public StudioSession() {
    super();
    threadPool = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());

    this.session = new SessionBuilder()
        .bind(PackageLoader.class, new AetherPackageLoader())
        .bind(VectorPipeliner.class, new MultiThreadedVectorPipeliner(threadPool))
        .withDefaultPackages().build();
  }
View Full Code Here


    }
    try {

      // initialize our master context here; a fresh but shallow copy will
      // be forked on each incoming request
      Session session = new SessionBuilder()
      .withFileSystemManager(fileSystemManager)
      .withDefaultPackages()
      .build();
     
      session.setWorkingDirectory(fileSystemManager.resolveFile("file:///"));
View Full Code Here

  }

  public static Session createSession() throws Exception {
    threadPool = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());

    Session session = new SessionBuilder()
        .bind(PackageLoader.class, new AetherPackageLoader())
        .bind(VectorPipeliner.class, new MultiThreadedVectorPipeliner(threadPool))
        .build();
    Environment replEnv = session.getGlobalEnvironment().insertAbove(new HashFrame());
    loadDefaultPackages(session);
View Full Code Here

  @Test
  public void rootFile() throws IOException {
    DefaultLocalFileProvider localFileProvider = new DefaultLocalFileProvider();
    FileSystemManager fsm = AppEngineContextFactory.createFileSystemManager(localFileProvider);

    Session session = new SessionBuilder()
    .withFileSystemManager(fsm)
    .build();
   
    session.setWorkingDirectory(FileSystemUtils.workingDirectory(fsm));
  
View Full Code Here

    throw new UnsupportedOperationException("nyi");
  }

  @Override
  public RenjinScriptEngine getScriptEngine() {
    return new RenjinScriptEngine(this, new SessionBuilder().withDefaultPackages().build());
  }
View Full Code Here

    if(!(exp instanceof PairList)) {
      throw new UnsupportedOperationException("Expected to find a pairlist in " + dataFile + ", found a " + exp.getTypeName());
    }
   
    String logicalDatasetName = stripExtension(dataFile.getName());
    Session session = new SessionBuilder().withoutBasePackage().build();
    writePairList(logicalDatasetName, session, (PairList)exp);
  }
View Full Code Here

    args.add("sep", StringVector.valueOf(sep));

    FunctionCall readTable = FunctionCall.newCall(Symbol.get("::"), Symbol.get("utils"), Symbol.get("read.table"));
    FunctionCall call = new FunctionCall(readTable, args.build());

    Session session = new SessionBuilder().build();
    SEXP dataFrame = session.getTopLevelContext().evaluate(call);

    PairList.Builder pairList = new PairList.Builder();
    pairList.add(logicalDatasetName, dataFrame);
View Full Code Here

   * namespace are considered part of the dataset.
   *
   */
  private void processRScript(File scriptFile, String logicalDatasetName) throws IOException {

    Session session = new SessionBuilder().build();
    FileReader reader = new FileReader(scriptFile);
    ExpressionVector source = RParser.parseAllSource(reader);
    reader.close();
   
    session.getTopLevelContext().evaluate(source);
View Full Code Here

  public static void main(String[] args) throws IOException {
    // Evaluate the base sources into the base namespace environment
 
    Session session = new SessionBuilder()
    .withoutBasePackage()
    .build();
   
    Context context = session.getTopLevelContext();
    Environment baseNamespaceEnv = context.getNamespaceRegistry().getBase().getNamespaceEnvironment();
View Full Code Here

   
    return false;
  }

  private Context initContext()  {
    SessionBuilder builder = new SessionBuilder();
    Context context = builder.build().getTopLevelContext();
    if(defaultPackages != null) {
      for(String name : defaultPackages) {
        context.evaluate(FunctionCall.newCall(Symbol.get("library"), StringVector.valueOf(name)));
      }
    }
View Full Code Here

TOP

Related Classes of org.renjin.eval.SessionBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.