Examples of HostAttributes


Examples of org.apache.aurora.gen.HostAttributes

    assertEquals(0, getValue(rackStatName("rackA")));
    assertEquals(0, getValue(rackStatName("rackB")));
  }

  private IExpectationSetters<?> expectGetHostRack(String host, String rackToReturn) {
    IHostAttributes attributes = IHostAttributes.build(new HostAttributes()
        .setHost(host)
        .setAttributes(ImmutableSet.of(
            new Attribute().setName("rack").setValues(ImmutableSet.of(rackToReturn)))));
    return expect(storageUtil.attributeStore.getHostAttributes(host))
        .andReturn(Optional.of(attributes));
View Full Code Here

Examples of org.apache.aurora.gen.HostAttributes

  private IExpectationSetters<Optional<IHostAttributes>> expectGetHostAttributes(
      String host,
      Attribute... attributes) {

    IHostAttributes hostAttributes = IHostAttributes.build(new HostAttributes()
        .setHost(host)
        .setAttributes(ImmutableSet.<Attribute>builder().add(attributes).build()));
    return expect(attributeStore.getHostAttributes(host)).andReturn(Optional.of(hostAttributes));
  }
View Full Code Here

Examples of org.apache.aurora.gen.HostAttributes

        .andReturn(ImmutableSet.<IScheduledTask>builder().add(activeTasks).build());
  }

  private IExpectationSetters<?> expectGetAttributes(String host, Attribute... attributes) {
    return expect(attributeStore.getHostAttributes(host)).andReturn(Optional.of(
        IHostAttributes.build(new HostAttributes()
            .setHost(host)
            .setAttributes(ImmutableSet.<Attribute>builder().add(attributes).build()))));
  }
View Full Code Here

Examples of org.apache.aurora.gen.HostAttributes

        ScheduleStatus.DRAINING,
        MaintenanceControllerImpl.DRAINING_MESSAGE))
        .andReturn(true);
    expectMaintenanceModeChange(HOST_A, DRAINING);
    expect(storageUtil.attributeStore.getHostAttributes(HOST_A)).andReturn(Optional.of(
        IHostAttributes.build(new HostAttributes().setHost(HOST_A).setMode(DRAINING))));
    // TaskA is FINISHED and therefore no longer active
    expectFetchTasksByHost(HOST_A, ImmutableSet.<ScheduledTask>of());
    expectMaintenanceModeChange(HOST_A, DRAINED);
    expectMaintenanceModeChange(HOST_A, NONE);
View Full Code Here

Examples of org.apache.aurora.gen.HostAttributes

  @Test
  public void testEndEarly() {
    expectMaintenanceModeChange(HOST_A, SCHEDULED);
    expectMaintenanceModeChange(HOST_A, NONE);
    expect(storageUtil.attributeStore.getHostAttributes(HOST_A)).andReturn(Optional.of(
        IHostAttributes.build(new HostAttributes().setHost(HOST_A).setMode(NONE))));

    control.replay();

    assertStatus(HOST_A, SCHEDULED, maintenance.startMaintenance(A));
View Full Code Here

Examples of org.apache.aurora.gen.HostAttributes

  }

  @Test
  public void testGetMode() {
    expect(storageUtil.attributeStore.getHostAttributes(HOST_A)).andReturn(Optional.of(
        IHostAttributes.build(new HostAttributes().setHost(HOST_A).setMode(DRAINING))));
    expect(storageUtil.attributeStore.getHostAttributes("unknown"))
        .andReturn(Optional.<IHostAttributes>absent());

    control.replay();
View Full Code Here

Examples of org.apache.aurora.gen.HostAttributes

  }

  // Sets up a normal host, no dedicated hosts and no maintenance.
  private void setUpHost(String host, String rack) {
    IHostAttributes hostAttrs = IHostAttributes.build(
        new HostAttributes().setHost(host).setSlaveId(host + "_id")
            .setMode(NONE).setAttributes(ImmutableSet.of(rack(rack), host(host))));

    expect(this.storageUtil.attributeStore.getHostAttributes(host))
        .andReturn(Optional.of(hostAttrs)).anyTimes();
    expect(this.maintenance.getMode(host)).andReturn(NONE).anyTimes();
View Full Code Here

Examples of org.apache.aurora.gen.HostAttributes

  public void testSaveHostAttributes() throws Exception {
    final String host = "hostname";
    final Set<Attribute> attributes =
        ImmutableSet.of(new Attribute().setName("attr").setValues(ImmutableSet.of("value")));
    final Optional<IHostAttributes> hostAttributes = Optional.of(
        IHostAttributes.build(new HostAttributes()
            .setHost(host)
            .setAttributes(attributes)));

    new MutationFixture() {
      @Override
View Full Code Here

Examples of org.apache.aurora.gen.HostAttributes

  }

  private Snapshot createSnapshot() {
    return new Snapshot()
        .setTimestamp(1L)
        .setHostAttributes(ImmutableSet.of(new HostAttributes("host",
            ImmutableSet.of(new Attribute("hostname", ImmutableSet.of("abc"))))))
        .setTasks(ImmutableSet.of(
            new ScheduledTask().setStatus(ScheduleStatus.RUNNING)
                .setAssignedTask(new AssignedTask().setTaskId("task_id")
                    .setTask(new TaskConfig().setJobName("job_name")))));
View Full Code Here

Examples of org.apache.aurora.gen.HostAttributes

  private Snapshot makeSnapshot() {
    Snapshot snapshot = new Snapshot();
    snapshot.setTimestamp(clock.nowMillis());
    snapshot.setHostAttributes(ImmutableSet.of(
        new HostAttributes(
            "hostA",
            ImmutableSet.of(new Attribute("attr", ImmutableSet.of("value"))))));
    snapshot.setJobs(ImmutableSet.of(
        new StoredJob(
            "jobManager",
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.