Package org.apache.aurora.gen

Examples of org.apache.aurora.gen.Identity


      JobKeys.assertValid(jobKey);
      requireNonNull(instanceIds);

      return new Builder(
          query.deepCopy()
              .setOwner(new Identity().setRole(jobKey.getRole()))
              .setEnvironment(jobKey.getEnvironment())
              .setJobName(jobKey.getName())
              .setInstanceIds(ImmutableSet.copyOf(instanceIds)));
    }
View Full Code Here


      boolean production,
      ScheduleStatus status,
      Optional<String> dedicated) {

    TaskConfig task = new TaskConfig()
        .setOwner(new Identity().setRole(role))
        .setEnvironment("test")
        .setJobName(job)
        .setNumCpus(numCpus)
        .setRamMb(ramMb)
        .setDiskMb(diskMb)
View Full Code Here

            .setTaskId(TASK_ID)
            .setTask(new TaskConfig()
                .setJob(new JobKey(ROLE_A, ENV, job))
                .setJobName(job)
                .setEnvironment(ENV)
                .setOwner(new Identity(ROLE_A, ROLE_A + "-user"))));
    if (Tasks.SLAVE_ASSIGNED_STATES.contains(status) || Tasks.isTerminated(status)) {
      task.getAssignedTask().setSlaveHost(host);
    }

    return IScheduledTask.build(task);
View Full Code Here

            .setTask(new TaskConfig()
                .setJob(new JobKey("role-" + id, "test", "job-" + id))
                .setJobName("job-" + id)
                .setEnvironment("test")
                .setExecutorConfig(new org.apache.aurora.gen.ExecutorConfig("AuroraExecutor", ""))
                .setOwner(new Identity("role-" + id, "user-" + id))));
    // Apply defaults here so that we can expect the same task that will be written to the stream.
    ConfigurationManager.applyDefaultsIfUnset(scheduledTask.getAssignedTask().getTask());
    return scheduledTask;
  }
View Full Code Here

                .setJob(new JobKey("role", "env", "job"))
                .setJobName("job")
                .setIsService(true)
                .setProduction(isProd)
                .setEnvironment("env")
                .setOwner(new Identity("role", "role-user")))));
  }
View Full Code Here

        new AssignedTask()
            .setTaskId(taskId)
            .setTask(new TaskConfig()
                .setJobName("job-" + taskId)
                .setEnvironment("test")
                .setOwner(new Identity().setRole("role-" + taskId).setUser("user-" + taskId))));
  }
View Full Code Here

public class ThriftBinaryCodecTest {

  @Test
  public void testRoundTrip() throws CodingException {
    Identity original = new Identity("mesos", "jack");
    assertEquals(original,
        ThriftBinaryCodec.decode(Identity.class, ThriftBinaryCodec.encode(original)));
  }
View Full Code Here

    assertNull(ThriftBinaryCodec.decode(Identity.class, ThriftBinaryCodec.encode(null)));
  }

  @Test
  public void testRoundTripNonNull() throws CodingException {
    Identity original = new Identity("mesos", "jill");
    assertEquals(original,
        ThriftBinaryCodec.decodeNonNull(Identity.class, ThriftBinaryCodec.encodeNonNull(original)));
  }
View Full Code Here

    ThriftBinaryCodec.decodeNonNull(Identity.class, null);
  }

  @Test
  public void testInflateDeflateRoundTrip() throws CodingException {
    Identity original = new Identity("aurora", "jsmith");

    byte[] deflated = ThriftBinaryCodec.deflateNonNull(original);

    Identity inflated = ThriftBinaryCodec.inflateNonNull(Identity.class, deflated);

    assertEquals(original, inflated);
  }
View Full Code Here

            .setInstanceId(0)
            .setTaskId(taskId)
            .setTask(new TaskConfig()
                .setJob(new JobKey("role-" + taskId, "env-" + taskId, "job-" + taskId))
                .setJobName("job-" + taskId)
                .setOwner(new Identity().setRole("role-" + taskId).setUser("user-" + taskId))
                .setEnvironment("env-" + taskId))));
  }
View Full Code Here

TOP

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

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.