Package edu.berkeley.sparrow.api

Examples of edu.berkeley.sparrow.api.SparrowFrontendClient


      // Logger configuration: log to the console
      BasicConfigurator.configure();
      LOG.setLevel(Level.DEBUG);

      SparrowFrontendClient client = new SparrowFrontendClient();
      int schedulerPort = SchedulerThrift.DEFAULT_SCHEDULER_THRIFT_PORT;
      client.initialize(new InetSocketAddress("localhost", schedulerPort), APPLICATION_ID, this);

      // Generate list of tasks.
      ByteBuffer message = ByteBuffer.allocate(8);
      message.putInt(DEFAULT_TASK_BENCHMARK);
      // Just one iteration!
      message.putInt(1);
     
      List<TTaskSpec> tasks = new ArrayList<TTaskSpec>();
      int numTasks = Integer.parseInt(args[0]);
      LOG.info("Launching " + numTasks + " tasks");
      for (int taskId = 0; taskId < numTasks; taskId++) {
        TTaskSpec spec = new TTaskSpec();
        spec.setTaskId(Integer.toString(taskId));
        spec.setMessage(message.array());
        tasks.add(spec);
      }
      TUserGroupInfo userInfo = new TUserGroupInfo("User", "*", 0);
     
      while(true) {
        client.submitJob(APPLICATION_ID, tasks, userInfo);
        tasksLaunched.addAndGet(tasks.size());
        LOG.info(tasksLaunched.get() + " tasks launched");
     
        Thread.sleep(1000);
      }
View Full Code Here


      experiments.add(new SubExperiment(user1QuarterDemand, 10, 1.25 * fullyUtilizedArrivalRate));

      // Finally user 1 goes back to 0.
      experiments.add(new SubExperiment(onlyUser0, 20, fullyUtilizedArrivalRate));

      SparrowFrontendClient client = new SparrowFrontendClient();
      int schedulerPort = conf.getInt("scheduler_port",
          SchedulerThrift.DEFAULT_SCHEDULER_THRIFT_PORT);
      client.initialize(new InetSocketAddress("localhost", schedulerPort), APPLICATION_ID, this);

      if (warmup_duration_s > 0) {
        List<SubExperiment> warmupExperiment = new ArrayList<SubExperiment>();
        List<UserInfo> warmupUsers = new ArrayList<UserInfo>();
        warmupUsers.add(new UserInfo("warmupUser", 1, 0));
View Full Code Here

      if (users.size() == 0) {
        // Add a dummy user.
        users.add(new UserInfo("defaultUser", 1, 0));
      }

      SparrowFrontendClient client = new SparrowFrontendClient();
      int schedulerPort = conf.getInt("scheduler_port",
          SchedulerThrift.DEFAULT_SCHEDULER_THRIFT_PORT);
      client.initialize(new InetSocketAddress("localhost", schedulerPort), APPLICATION_ID, this);

      if (warmupDurationS > 0) {
        LOG.debug("Warming up for " + warmupDurationS + " seconds at arrival rate of " +
                  warmupLambda + " jobs per second");
        launchTasks(users, warmupLambda, warmupDurationS, tasksPerJob, numPreferredNodes,
View Full Code Here

      int taskDurationMillis = conf.getInt(TASK_DURATION_MILLIS, DEFAULT_TASK_DURATION_MILLIS);

      int schedulerPort = conf.getInt(SCHEDULER_PORT,
          SchedulerThrift.DEFAULT_SCHEDULER_THRIFT_PORT);
      String schedulerHost = conf.getString(SCHEDULER_HOST, DEFAULT_SCHEDULER_HOST);
      client = new SparrowFrontendClient();
      client.initialize(new InetSocketAddress(schedulerHost, schedulerPort), APPLICATION_ID, this);

      JobLaunchRunnable runnable = new JobLaunchRunnable(tasksPerJob, taskDurationMillis);
      ScheduledThreadPoolExecutor taskLauncher = new ScheduledThreadPoolExecutor(1);
      taskLauncher.scheduleAtFixedRate(runnable, 0, arrivalPeriodMillis, TimeUnit.MILLISECONDS);
View Full Code Here

      if (users.size() == 0) {
        // Add a dummy user.
        users.add(new UserInfo("defaultUser", 1, 0));
      }

      SparrowFrontendClient client = new SparrowFrontendClient();
      int schedulerPort = conf.getInt("scheduler_port",
          SchedulerThrift.DEFAULT_SCHEDULER_THRIFT_PORT);
      client.initialize(new InetSocketAddress("localhost", schedulerPort), APPLICATION_ID, this);

      if (warmupDurationS > 0) {
        LOG.debug("Warming up for " + warmupDurationS + " seconds at arrival rate of " +
                  warmupLambda + " jobs per second");
        launchTasks(users, warmupLambda, warmupDurationS, tasksPerJob, numPreferredNodes,
View Full Code Here

TOP

Related Classes of edu.berkeley.sparrow.api.SparrowFrontendClient

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.