Package edu.berkeley.sparrow.thrift

Examples of edu.berkeley.sparrow.thrift.TEnqueueTaskReservationsRequest$TEnqueueTaskReservationsRequestStandardSchemeFactory


  private TEnqueueTaskReservationsRequest createTaskReservationRequest(
      int numTasks, TaskScheduler scheduler, String userId, int priority) {
    String idStr = Integer.toString(requestId++);
    TUserGroupInfo user = new TUserGroupInfo(userId, "group", priority);
    THostPort schedulerAddress = new THostPort("1.2.3.4", 52);
    return new TEnqueueTaskReservationsRequest(
        "appId", user, idStr, schedulerAddress, numTasks);
  }
View Full Code Here


      debugString.append(";");
      // TODO: this needs to be a count!
      outstandingReservations.put(
          new THostPort(node.getAddress().getHostAddress(), node.getPort()),
          numReservations);
      TEnqueueTaskReservationsRequest request = new TEnqueueTaskReservationsRequest(
          schedulingRequest.getApp(), schedulingRequest.getUser(), requestId,
          schedulerAddress, numReservations);
      requests.put(node, request);
    }
    LOG.debug("Request " + requestId + ": Launching enqueueReservation on " +
View Full Code Here

        }

        if (numEnqueuedNodes < probeRatio) {
          // TODO: Try to select nodes that haven't already been used by another task.
          if (!requests.containsKey(addr)) {
            TEnqueueTaskReservationsRequest request = new TEnqueueTaskReservationsRequest(
                schedulingRequest.getApp(), schedulingRequest.getUser(), requestId,
                schedulerAddress, 1);
            requests.put(addr, request);
          } else {
            // IsSetNumTasks should already be true, because it was set when the request was
View Full Code Here

      if (requests.containsKey(nodeMonitor)) {
        LOG.error("Adding enqueueTaskReservations requests for unused node monitors, so they " +
                  "should not already have any enqueueTaskReservation requests.");
      }

      TEnqueueTaskReservationsRequest request = new TEnqueueTaskReservationsRequest(
          appId, user, requestId, schedulerAddress, 1);
      requests.put(nodeMonitor, request);
      reservationsCreated++;

      if (reservationsCreated >= reservationsToLaunch) {
View Full Code Here

      int reservationsCount = 0;
      for (Entry<InetSocketAddress, TEnqueueTaskReservationsRequest> entry : requests.entrySet()) {
        // The node monitor the request is being sent to should be among the list of backend nodes.
        assertTrue("Expect " + entry.getKey() + " to be among the set of backend nodes",
                   backendNodes.contains(entry.getKey()));
        TEnqueueTaskReservationsRequest request = entry.getValue();
        assertEquals(request.getAppId(), APP_ID);
        assertEquals(request.getUser(), user);
        assertEquals(request.getRequestId(), REQUEST_ID);
        assertEquals(request.getSchedulerAddress(), SCHEDULER_ADDRESS);
        // Expect the reservations to be evenly balanced over the machines.
        assertTrue(request.getNumTasks() == 4 || request.getNumTasks() == 5);
        reservationsCount += request.getNumTasks();
      }
      assertEquals(reservationsCount, EXPECTED_RESERVATIONS);
    }
  }
View Full Code Here

      assertEquals(EXPECTED_REQUESTS, requests.size());
      for (Entry<InetSocketAddress, TEnqueueTaskReservationsRequest> entry : requests.entrySet()) {
        // The node monitor the request is being sent to should be among the list of backend nodes.
        assertTrue("Expect " + entry.getKey() + " to be among the set of backend nodes",
                   backendNodes.contains(entry.getKey()));
        TEnqueueTaskReservationsRequest request = entry.getValue();
        assertEquals(request.getAppId(), APP_ID);
        assertEquals(request.getUser(), user);
        assertEquals(request.getRequestId(), REQUEST_ID);
        assertEquals(request.getSchedulerAddress(), SCHEDULER_ADDRESS);
        assertEquals(1, request.getNumTasks());
      }
    }
  }
View Full Code Here

    for (Entry<InetSocketAddress, TEnqueueTaskReservationsRequest> entry : requests.entrySet()) {
      // The node monitor the request is being sent to should be among the list of preferred
      // nodes.
      assertTrue("Expect " + entry.getKey() + " to be among the set of preferred nodes",
                 preferredNodes.contains(entry.getKey()));
      TEnqueueTaskReservationsRequest request = entry.getValue();
      assertEquals(request.getAppId(), APP_ID);
      assertEquals(request.getUser(), user);
      assertEquals(request.getRequestId(), REQUEST_ID);
      assertEquals(request.getSchedulerAddress(), SCHEDULER_ADDRESS);
      assertTrue(request.getNumTasks() > 0);
      totalEnqueuedTasks += request.getNumTasks();
    }
    assertEquals(expectedTotalReservations, totalEnqueuedTasks);
  }
View Full Code Here

        if (!preferredNodes.contains(entry.getKey())) {
          nonPreferredNodes++;
          assertTrue("Expect at most two entrys to be outside the set of preferred nodes",
              nonPreferredNodes <= 2);
        }
        TEnqueueTaskReservationsRequest request = entry.getValue();
        assertEquals(request.getAppId(), APP_ID);
        assertEquals(request.getUser(), user);
        assertEquals(request.getRequestId(), REQUEST_ID);
        assertEquals(request.getSchedulerAddress(), SCHEDULER_ADDRESS);
        assertTrue(request.getNumTasks() > 0);
        totalEnqueuedTasks += request.getNumTasks();
      }
      // Expect two choices for each of the 4 tasks.
      assertEquals(totalEnqueuedTasks, 8);

      sanityCheckGetTasksAndCancellation(schedulingRequest, taskPlacer, requests);
View Full Code Here

TOP

Related Classes of edu.berkeley.sparrow.thrift.TEnqueueTaskReservationsRequest$TEnqueueTaskReservationsRequestStandardSchemeFactory

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.