Package org.apache.aurora.gen

Examples of org.apache.aurora.gen.HostStatus


  private void expectAnyMaintenanceCalls() {
    expect(maintenance.getMode(isA(String.class))).andReturn(MaintenanceMode.NONE).anyTimes();
  }

  private void changeHostMaintenanceState(String hostName, MaintenanceMode mode) {
    offerQueue.hostChangedState(new HostMaintenanceStateChange(new HostStatus(hostName, mode)));
  }
View Full Code Here


  private void expectMaintenanceModeChange(String hostName, MaintenanceMode mode) {
    expect(storageUtil.attributeStore.setMaintenanceMode(hostName, mode)).andReturn(true);
    eventSink.post(
        new PubsubEvent.HostMaintenanceStateChange(
            new HostStatus().setHost(hostName).setMode(mode)));
  }
View Full Code Here

        new PubsubEvent.HostMaintenanceStateChange(
            new HostStatus().setHost(hostName).setMode(mode)));
  }

  private void assertStatus(String host, MaintenanceMode mode, Set<HostStatus> statuses) {
    assertEquals(ImmutableSet.of(new HostStatus(host, mode)), statuses);
  }
View Full Code Here

  @Test
  public void testHostMaintenance() throws Exception {
    expectAuth(ROOT, true).times(6);
    Set<String> hostnames = ImmutableSet.of("a");
    Set<HostStatus> none = ImmutableSet.of(new HostStatus("a", NONE));
    Set<HostStatus> scheduled = ImmutableSet.of(new HostStatus("a", SCHEDULED));
    Set<HostStatus> draining = ImmutableSet.of(new HostStatus("a", DRAINING));
    Set<HostStatus> drained = ImmutableSet.of(new HostStatus("a", DRAINING));
    expect(maintenance.getStatus(hostnames)).andReturn(none);
    expect(maintenance.startMaintenance(hostnames)).andReturn(scheduled);
    expect(maintenance.drain(hostnames)).andReturn(draining);
    expect(maintenance.getStatus(hostnames)).andReturn(draining);
    expect(maintenance.getStatus(hostnames)).andReturn(drained);
View Full Code Here

      AttributeStore.Mutable store = storeProvider.getAttributeStore();
      ImmutableSet.Builder<HostStatus> statuses = ImmutableSet.builder();
      for (String host : hosts) {
        if (store.setMaintenanceMode(host, mode)) {
          HostStatus status = new HostStatus().setHost(host).setMode(mode);
          eventSink.post(new PubsubEvent.HostMaintenanceStateChange(status.deepCopy()));
          statuses.add(status);
        }
      }
      return statuses.build();
    }
View Full Code Here

      ImmutableSet.Builder<HostStatus> statuses = ImmutableSet.builder();
      for (String host : hosts) {
        Optional<IHostAttributes> toSave = AttributeStore.Util.mergeMode(store, host, mode);
        if (toSave.isPresent()) {
          store.saveHostAttributes(toSave.get());
          HostStatus status = new HostStatus().setHost(host).setMode(mode);
          statuses.add(status);
        }
      }
      return statuses.build();
    }
View Full Code Here

  @Test
  public void testHostMaintenance() throws Exception {
    expectAuth(ROOT, true).times(6);
    Set<String> hostnames = ImmutableSet.of("a");
    Set<HostStatus> none = ImmutableSet.of(new HostStatus("a", NONE));
    Set<HostStatus> scheduled = ImmutableSet.of(new HostStatus("a", SCHEDULED));
    Set<HostStatus> draining = ImmutableSet.of(new HostStatus("a", DRAINING));
    Set<HostStatus> drained = ImmutableSet.of(new HostStatus("a", DRAINING));
    expect(maintenance.getStatus(hostnames)).andReturn(none);
    expect(maintenance.startMaintenance(hostnames)).andReturn(scheduled);
    expect(maintenance.drain(hostnames)).andReturn(draining);
    expect(maintenance.getStatus(hostnames)).andReturn(draining);
    expect(maintenance.getStatus(hostnames)).andReturn(drained);
View Full Code Here

    IHostAttributes updated = IHostAttributes.build(attributes.newBuilder().setMode(mode));
    expect(storageUtil.attributeStore.saveHostAttributes(updated)).andReturn(true);
  }

  private void assertStatus(String host, MaintenanceMode mode, Set<HostStatus> statuses) {
    assertEquals(ImmutableSet.of(new HostStatus(host, mode)), statuses);
  }
View Full Code Here

TOP

Related Classes of org.apache.aurora.gen.HostStatus

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.