Examples of ILockKey


Examples of org.apache.aurora.scheduler.storage.entities.ILockKey

  @Test
  public void testValidateLockNotStoredHeld() throws Exception {
    IJobKey jobKey = JobKeys.from("r", "e", "n");
    expectLockException(jobKey);
    ILock lock = lockManager.acquireLock(LOCK_KEY, USER);
    ILockKey key = ILockKey.build(LockKey.job(jobKey.newBuilder()));
    lockManager.validateIfLocked(key, Optional.of(lock));
  }
View Full Code Here

Examples of org.apache.aurora.scheduler.storage.entities.ILockKey

    }.run();
  }

  @Test
  public void testRemoveLock() throws Exception {
    final ILockKey lockKey =
        ILockKey.build(LockKey.job(JobKeys.from("testRole", "testEnv", "testJob").newBuilder()));
    new MutationFixture() {
      @Override
      protected void setupExpectations() throws Exception {
        storageUtil.expectWriteOperation();
        storageUtil.lockStore.removeLock(lockKey);
        streamMatcher.expectTransaction(Op.removeLock(new RemoveLock(lockKey.newBuilder())))
            .andReturn(position);
      }

      @Override
      protected void performMutations(MutableStoreProvider storeProvider) {
View Full Code Here

Examples of org.apache.aurora.scheduler.storage.entities.ILockKey

  @Test
  public void testKillTasksLockCheckFailed() throws Exception {
    Query.Builder query = Query.unscoped().byJob(JOB_KEY).active();
    IScheduledTask task2 = buildScheduledTask("job_bar", TASK_ID);
    ILockKey key2 = ILockKey.build(LockKey.job(
        JobKeys.from(ROLE, DEFAULT_ENVIRONMENT, "job_bar").newBuilder()));
    expectAuth(ROOT, false);
    expectAuth(ROLE, true);
    storageUtil.expectTaskFetch(query, buildScheduledTask(), task2);
    lockManager.validateIfLocked(LOCK_KEY, Optional.of(LOCK));
View Full Code Here

Examples of org.apache.aurora.scheduler.storage.entities.ILockKey

  @Override
  public Response acquireLock(LockKey mutableLockKey, SessionKey session) {
    requireNonNull(mutableLockKey);
    requireNonNull(session);

    ILockKey lockKey = ILockKey.build(mutableLockKey);
    Response response = Util.emptyResponse();

    try {
      SessionContext context = sessionValidator.checkAuthenticated(
          session,
View Full Code Here

Examples of org.apache.aurora.scheduler.storage.entities.ILockKey

  @Override
  public Response acquireLock(LockKey mutableLockKey, SessionKey session) {
    requireNonNull(mutableLockKey);
    requireNonNull(session);

    ILockKey lockKey = ILockKey.build(mutableLockKey);

    try {
      SessionContext context = sessionValidator.checkAuthenticated(
          session,
          ImmutableSet.of(getRoleFromLockKey(lockKey)));
View Full Code Here

Examples of org.apache.aurora.scheduler.storage.entities.ILockKey

  @Test
  public void testKillTasksLockCheckFailed() throws Exception {
    Query.Builder query = Query.unscoped().byJob(JOB_KEY).active();
    IScheduledTask task2 = buildScheduledTask("job_bar", TASK_ID);
    ILockKey key2 = ILockKey.build(LockKey.job(
        JobKeys.from(ROLE, "devel", "job_bar").newBuilder()));
    expectAuth(ROOT, false);
    expectAuth(ROLE, true);
    storageUtil.expectTaskFetch(query, buildScheduledTask(), task2);
    lockManager.validateIfLocked(LOCK_KEY, Optional.of(LOCK));
View Full Code Here

Examples of org.apache.aurora.scheduler.storage.entities.ILockKey

    }.run();
  }

  @Test
  public void testRemoveLock() throws Exception {
    final ILockKey lockKey =
        ILockKey.build(LockKey.job(JOB_KEY.newBuilder()));
    new MutationFixture() {
      @Override
      protected void setupExpectations() throws Exception {
        storageUtil.expectWriteOperation();
        storageUtil.lockStore.removeLock(lockKey);
        streamMatcher.expectTransaction(Op.removeLock(new RemoveLock(lockKey.newBuilder())))
            .andReturn(position);
      }

      @Override
      protected void performMutations(MutableStoreProvider storeProvider) {
View Full Code Here

Examples of org.apache.aurora.scheduler.storage.entities.ILockKey

    control.replay();

    IJobKey jobKey = JobKeys.from("r", "e", "n");
    expectLockException(jobKey);
    ILock lock = lockManager.acquireLock(LOCK_KEY, USER);
    ILockKey key = ILockKey.build(LockKey.job(jobKey.newBuilder()));
    lockManager.validateIfLocked(key, Optional.of(lock));
  }
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.