Examples of SaveHostAttributes


Examples of org.apache.aurora.gen.storage.SaveHostAttributes

        // Each logStorage save invokes get, save, get to the underlying attribute store.
        storageUtil.attributeStore.saveHostAttributes(hostAttributes.get());
        expect(storageUtil.attributeStore.getHostAttributes(host)).andReturn(hostAttributes);
        streamMatcher.expectTransaction(
            Op.saveHostAttributes(new SaveHostAttributes(hostAttributes.get().newBuilder())))
            .andReturn(position);
        expect(storageUtil.attributeStore.getHostAttributes(host)).andReturn(hostAttributes);

        expect(storageUtil.attributeStore.getHostAttributes(host)).andReturn(hostAttributes);
        storageUtil.attributeStore.saveHostAttributes(hostAttributes.get());
View Full Code Here

Examples of org.apache.aurora.gen.storage.SaveHostAttributes

    //                       saveAttributes(String host, Iterable<Attributes>) to simplify this.
    Optional<IHostAttributes> saved = getHostAttributes(attrs.getHost());
    attributeStore.saveHostAttributes(attrs);
    Optional<IHostAttributes> updated = getHostAttributes(attrs.getHost());
    if (!saved.equals(updated)) {
      write(Op.saveHostAttributes(new SaveHostAttributes(updated.get().newBuilder())));
    }
  }
View Full Code Here

Examples of org.apache.aurora.gen.storage.SaveHostAttributes

    requireNonNull(mode);

    boolean saved = attributeStore.setMaintenanceMode(host, mode);
    if (saved) {
      write(Op.saveHostAttributes(
          new SaveHostAttributes(attributeStore.getHostAttributes(host).get().newBuilder())));
    }
    return saved;
  }
View Full Code Here

Examples of org.apache.aurora.gen.storage.SaveHostAttributes

            .setAttributes(ImmutableSet.of(
                new Attribute().setName("b").setValues(ImmutableSet.of("1", "2")))));

    expect(attributeStore.saveHostAttributes(attributes)).andReturn(true);
    expectOp(Op.saveHostAttributes(
        new SaveHostAttributes().setHostAttributes(attributes.newBuilder())));
    eventSink.post(new PubsubEvent.HostAttributesChanged(attributes));

    expect(attributeStore.saveHostAttributes(attributes)).andReturn(false);

    control.replay();
View Full Code Here

Examples of org.apache.aurora.gen.storage.SaveHostAttributes

    builder.add(createTransaction(Op.removeQuota(new RemoveQuota(JOB_KEY.getRole()))));
    storageUtil.quotaStore.removeQuota(JOB_KEY.getRole());

    // This entry lacks a slave ID, and should therefore be discarded.
    SaveHostAttributes hostAttributes1 = new SaveHostAttributes(new HostAttributes()
        .setHost("host1")
        .setMode(MaintenanceMode.DRAINED));
    builder.add(createTransaction(Op.saveHostAttributes(hostAttributes1)));

    SaveHostAttributes hostAttributes2 = new SaveHostAttributes(new HostAttributes()
        .setHost("host2")
        .setSlaveId("slave2")
        .setMode(MaintenanceMode.DRAINED));
    builder.add(createTransaction(Op.saveHostAttributes(hostAttributes2)));
    expect(storageUtil.attributeStore.saveHostAttributes(
        IHostAttributes.build(hostAttributes2.getHostAttributes()))).andReturn(true);

    SaveLock saveLock = new SaveLock(new Lock().setKey(LockKey.job(JOB_KEY.newBuilder())));
    builder.add(createTransaction(Op.saveLock(saveLock)));
    storageUtil.lockStore.saveLock(ILock.build(saveLock.getLock()));
View Full Code Here

Examples of org.apache.aurora.gen.storage.SaveHostAttributes

        expect(storageUtil.attributeStore.getHostAttributes(host)).andReturn(hostAttributes);

        expect(storageUtil.attributeStore.saveHostAttributes(hostAttributes.get())).andReturn(true);
        eventSink.post(new PubsubEvent.HostAttributesChanged(hostAttributes.get()));
        streamMatcher.expectTransaction(
            Op.saveHostAttributes(new SaveHostAttributes(hostAttributes.get().newBuilder())))
            .andReturn(position);

        expect(storageUtil.attributeStore.saveHostAttributes(hostAttributes.get()))
            .andReturn(false);
View Full Code Here

Examples of org.apache.aurora.gen.storage.SaveHostAttributes

  public boolean saveHostAttributes(final IHostAttributes attrs) {
    requireNonNull(attrs);

    boolean changed = attributeStore.saveHostAttributes(attrs);
    if (changed) {
      write(Op.saveHostAttributes(new SaveHostAttributes(attrs.newBuilder())));
      eventSink.post(new PubsubEvent.HostAttributesChanged(attrs));
    }
    return changed;
  }
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.