io.mantisrx.master.jobcluster.job.IMantisJobMetadata Maven / Gradle / Ivy
/*
* Copyright 2019 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.mantisrx.master.jobcluster.job;
import io.mantisrx.common.Label;
import io.mantisrx.master.jobcluster.job.worker.JobWorker;
import io.mantisrx.runtime.JobSla;
import io.mantisrx.runtime.descriptor.SchedulingInfo;
import io.mantisrx.runtime.parameter.Parameter;
import io.mantisrx.server.master.domain.Costs;
import io.mantisrx.server.master.domain.JobDefinition;
import io.mantisrx.server.master.domain.JobId;
import io.mantisrx.server.master.persistence.exceptions.InvalidJobException;
import java.net.URL;
import java.time.Instant;
import java.util.List;
import java.util.Map;
import java.util.Optional;
/**
* The Metadata associated with a Mantis Job.
*/
public interface IMantisJobMetadata {
long DEFAULT_STARTED_AT_EPOCH = 0;
/**
* Returns the {@link JobId}.
* @return
*/
JobId getJobId();
/**
* Returns the Job Cluster Name for this job.
* @return
*/
String getClusterName();
/**
* Returns the submitter of this job.
* @return
*/
String getUser();
/**
* Returns the {@link Instant} this job was submitted.
* @return
*/
Instant getSubmittedAtInstant();
/**
* Returns an optional Instant this job went into started state.
* @return
*/
Optional getStartedAtInstant();
/**
* Returns an optional Instant this job completed.
* @return
*/
Optional getEndedAtInstant();
/**
* Returns the artifact associated with this job.
* @return
*/
String getArtifactName();
/**
* Returns an optional {@link JobSla} for this job if it exists.
* @return
*/
Optional getSla();
/**
* Returns the subscription timeout in seconds associated with this job.
* @return
*/
long getSubscriptionTimeoutSecs();
/**
* Returns the current state of this job.
* @return
*/
JobState getState();
/**
* Returns the list of {@link Parameter} associated with this job.
* @return
*/
List getParameters();
/**
* Returns the list of {@link Label} associated with this job.
* @return
*/
List