Package edu.berkeley.sparrow.thrift

Examples of edu.berkeley.sparrow.thrift.TTaskSpec


     
      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) {
View Full Code Here


    message.putInt(benchmarkId);
    message.putInt(benchmarkIterations);

    List<TTaskSpec> out = new ArrayList<TTaskSpec>();
    for (int taskId = 0; taskId < numTasks; taskId++) {
      TTaskSpec spec = new TTaskSpec();
      spec.setTaskId(Integer.toString(taskId));
      spec.setMessage(message.array());
      out.add(spec);
    }
    return out;
  }
View Full Code Here

    message.putInt(benchmarkId);
    message.putInt(benchmarkIterations);

    List<TTaskSpec> out = new ArrayList<TTaskSpec>();
    for (int taskId = 0; taskId < numTasks; taskId++) {
      TTaskSpec spec = new TTaskSpec();
      spec.setTaskId(Integer.toString((new Random().nextInt())));
      spec.setMessage(message.array());
      if (numPreferredNodes > 0) {
        Collections.shuffle(backends);
        TPlacementPreference preference = new TPlacementPreference();
        for (int i = 0; i < numPreferredNodes; i++) {
          preference.addToNodes(backends.get(i));
        }
        spec.setPreference(preference);
      }
      out.add(spec);
    }
    return out;
  }
View Full Code Here

    message.putInt(benchmarkId);
    message.putInt(benchmarkIterations);

    List<TTaskSpec> out = new ArrayList<TTaskSpec>();
    for (int taskId = 0; taskId < numTasks; taskId++) {
      TTaskSpec spec = new TTaskSpec();
      spec.setTaskId(Integer.toString((new Random().nextInt())));
      spec.setMessage(message.array());
      if (numPreferredNodes > 0) {
        Collections.shuffle(backends);
        TPlacementPreference preference = new TPlacementPreference();
        for (int i = 0; i < numPreferredNodes; i++) {
          preference.addToNodes(backends.get(i));
        }
        spec.setPreference(preference);
      }
      out.add(spec);
    }
    return out;
  }
View Full Code Here

      LOG.error("Special case expects at least three times as many machines as tasks.");
      return null;
    }
    LOG.info(backends);
    for (int i = 0; i < req.getTasksSize(); i++) {
      TTaskSpec task = req.getTasks().get(i);
      TTaskSpec newTask = new TTaskSpec();
      newTask.message = task.message;
      newTask.taskId = task.taskId;
      newTask.preference = new TPlacementPreference();
      newTask.preference.addToNodes(backends.get(i).getHostName());
      newReq.addToTasks(newTask);
View Full Code Here

    ByteBuffer message = ByteBuffer.allocate(1);
    TPlacementPreference placementPreference = new TPlacementPreference();
    for (int i = 0; i < NUM_TASKS; ++i) {
      String id = "test task " + i;
      taskIds.add(id);
      tasks.add(new TTaskSpec(id, placementPreference, message));
    }

    backendNodes = Lists.newArrayList();
    backendNodes.add(new InetSocketAddress("3.4.5.6", 174));
    backendNodes.add(new InetSocketAddress("127.124.0.1", 22));
View Full Code Here

    ByteBuffer message = ByteBuffer.allocate(1);
    TPlacementPreference placementPreference = new TPlacementPreference();
    while (tasks.size() < NUM_TASKS) {
      String id = "test task " + tasks.size();
      taskIds.add(id);
      tasks.add(new TTaskSpec(id, placementPreference, message));
    }

    TSchedulingRequest schedulingRequest = new TSchedulingRequest(APP_ID, tasks, user);
   
    final int NUM_ITERATIONS = 100;
View Full Code Here

      TPlacementPreference placementPreference = new TPlacementPreference();
      for (int j = i; j < i + 3; ++j) {
        placementPreference.addToNodes(preferredNodesList.get(j).getAddress().getHostAddress());
      }
      String id = "test task " + i;
      tasks.add(new TTaskSpec(id, placementPreference, message));
    }

    TSchedulingRequest schedulingRequest = new TSchedulingRequest(APP_ID, tasks, user);

    // Create list of available backend nodes, with some additional nodes in addition to the
View Full Code Here

    ByteBuffer message = ByteBuffer.allocate(1);
    TPlacementPreference placementPreference = new TPlacementPreference();
    for (InetSocketAddress address : preferredNodes) {
      placementPreference.addToNodes(address.getAddress().getHostAddress());
    }
    TTaskSpec task = new TTaskSpec("test task", placementPreference, message);

    // Create the scheduling request.
    List<TTaskSpec> tasks = new ArrayList<TTaskSpec>();
    tasks.add(task);
    TSchedulingRequest schedulingRequest = new TSchedulingRequest(APP_ID, tasks, user);
View Full Code Here

      for (int j = i; j < i + 3; ++j) {
        placementPreference.addToNodes(preferredNodes.get(j).getAddress().getHostAddress());
      }
      String id = "constrained test task " + i;
      constrainedTaskIds.add(id);
      tasks.add(new TTaskSpec(id, placementPreference, message));
    }

    String unconstrainedTaskId = "unconstrained test task";
    tasks.add(new TTaskSpec(unconstrainedTaskId, null, message));

    TUserGroupInfo user = new TUserGroupInfo(USER, GROUP, PRIORITY);
    TSchedulingRequest schedulingRequest = new TSchedulingRequest(APP_ID, tasks, user);

    // Create list of available backend nodes, with some additional nodes in additional to the
View Full Code Here

TOP

Related Classes of edu.berkeley.sparrow.thrift.TTaskSpec

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.