if (expires != null) { builder.setExpires(new DateTime(expires).toDate());
.setGracePeriod(null) .setVolumes(emptyMap()) .setExpires(null) .setRolloutOptions(RolloutOptions.newBuilder().build()) .build(); .setGracePeriod(null) .setVolumes(emptyMap()) .setExpires(null) .setRolloutOptions(RolloutOptions.newBuilder().build()) .build();
if (expires != null) { builder.setExpires(new DateTime(expires).toDate());
builder.setExpires(new DateTime().plusMinutes(DEFAULT_EXPIRES_MINUTES).toDate());
/** * The Helios master will undeploy and delete the job at the specified date, if it has not * already been removed. If not set, jobs will be removed after 30 minutes. This is for the * case when a TemporaryJob is not cleaned up properly, perhaps because the process terminated * prematurely. * @param expires the Date when the job should be removed * @return the TemporaryJobBuilder */ public TemporaryJobBuilder expires(final Date expires) { this.builder.setExpires(expires); return this; }
.setGracePeriod(gracePeriod) .setVolumes(volumes) .setExpires(expires) .setRegistrationDomain(registrationDomain) .setCreatingUser(creatingUser)
protected JobId createJob(final String name, final String version, final String image, final String hostname, final List<String> command, final Map<String, String> env, final Map<String, PortMapping> ports, final Map<ServiceEndpoint, ServicePorts> registration, final Integer gracePeriod, final Map<String, String> volumes, final Date expires) throws Exception { return createJob(Job.newBuilder() .setName(name) .setVersion(version) .setImage(image) .setHostname(hostname) .setCommand(command) .setEnv(env) .setPorts(ports) .setRegistration(registration) .setGracePeriod(gracePeriod) .setVolumes(volumes) .setExpires(expires) .build()); }