Package org.apache.aurora.gen

Examples of org.apache.aurora.gen.Lock


    locks = new Locks(lockManager);
  }

  @Test
  public void testDumpContents() throws Exception {
    ILock lock = ILock.build(new Lock()
        .setKey(LOCK_KEY.newBuilder())
        .setToken("test token")
        .setMessage("test msg")
        .setUser("test usr")
        .setTimestampMs(325));
View Full Code Here


    control.replay();
  }

  @Test
  public void testAcquireLock() throws Exception {
    ILock expected = ILock.build(new Lock()
        .setKey(LOCK_KEY.newBuilder())
        .setToken(TOKEN.toString())
        .setTimestampMs(timestampMs)
        .setUser(USER));
View Full Code Here

    }.run();
  }

  @Test
  public void testSaveLock() throws Exception {
    final ILock lock = ILock.build(new Lock()
        .setKey(LockKey.job(JobKeys.from("testRole", "testEnv", "testJob").newBuilder()))
        .setToken("testLockId")
        .setUser("testUser")
        .setTimestampMs(12345L));
    new MutationFixture() {
View Full Code Here

      }
    });
  }

  private static ILock makeLock(JobKey key) {
    return ILock.build(new Lock()
      .setKey(LockKey.job(key))
      .setToken("lock1")
      .setUser("testUser")
      .setMessage("Test message")
      .setTimestampMs(12345L));
View Full Code Here

        ImmutableSet.of(new Attribute("attr", ImmutableSet.of("value")))));
    StoredJob job = new StoredJob(
        "jobManager",
        new JobConfiguration().setKey(new JobKey("owner", "env", "name")));
    String frameworkId = "framework_id";
    ILock lock = ILock.build(new Lock()
        .setKey(LockKey.job(JobKeys.from("testRole", "testEnv", "testJob").newBuilder()))
        .setToken("lockId")
        .setUser("testUser")
        .setTimestampMs(12345L));
    SchedulerMetadata metadata = new SchedulerMetadata()
View Full Code Here

  public void testReleaseLockInvalidKey() throws Exception {
    control.replay();

    assertResponse(
        ERROR,
        thrift.releaseLock(new Lock().setKey(LockKey.job(new JobKey())), CHECKED, SESSION));
  }
View Full Code Here

              formatLockKey(lockKey),
              new Date(existingLock.get().getTimestampMs()).toString(),
              existingLock.get().getUser()));
        }

        ILock lock = ILock.build(new Lock()
            .setKey(lockKey.newBuilder())
            .setToken(tokenGenerator.createNew().toString())
            .setTimestampMs(clock.nowMillis())
            .setUser(user));
View Full Code Here

              formatLockKey(lockKey),
              new Date(existingLock.get().getTimestampMs()).toString(),
              existingLock.get().getUser()));
        }

        ILock lock = ILock.build(new Lock()
            .setKey(lockKey.newBuilder())
            .setToken(tokenGenerator.createNew().toString())
            .setTimestampMs(clock.nowMillis())
            .setUser(user));
View Full Code Here

              .setTimestampMs(clock.nowMillis())),
          updateId);
    }

    if (UNLOCK_STATES.contains(status) && updateLock.isPresent()) {
      lockManager.releaseLock(ILock.build(new Lock()
          .setKey(LockKey.job(job.newBuilder()))
          .setToken(updateLock.get())));
    }

    MonitorAction action = JobUpdateStateMachine.getActionForStatus(status);
View Full Code Here

        new HostAttributes("host", ImmutableSet.<Attribute>of()));
    StoredJob job = new StoredJob(
        "jobManager",
        new JobConfiguration().setKey(new JobKey("owner", "env", "name")));
    String frameworkId = "framework_id";
    ILock lock = ILock.build(new Lock()
        .setKey(LockKey.job(JobKeys.from("testRole", "testEnv", "testJob").newBuilder()))
        .setToken("lockId")
        .setUser("testUser")
        .setTimestampMs(12345L));
    SchedulerMetadata metadata = new SchedulerMetadata()
View Full Code Here

TOP

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

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.