parent
431a7988fb
commit
de9dbdabe1
|
@ -39,7 +39,7 @@ public enum IgnoreDowntime implements Writeable {
|
||||||
public static IgnoreDowntime fromStream(StreamInput in) throws IOException {
|
public static IgnoreDowntime fromStream(StreamInput in) throws IOException {
|
||||||
int ordinal = in.readVInt();
|
int ordinal = in.readVInt();
|
||||||
if (ordinal < 0 || ordinal >= values().length) {
|
if (ordinal < 0 || ordinal >= values().length) {
|
||||||
throw new IOException("Unknown public enum SchedulerStatus {\n ordinal [" + ordinal + "]");
|
throw new IOException("Unknown public enum IgnoreDowntime {\n ordinal [" + ordinal + "]");
|
||||||
}
|
}
|
||||||
return values()[ordinal];
|
return values()[ordinal];
|
||||||
}
|
}
|
||||||
|
|
|
@ -201,7 +201,7 @@ public class JobManager extends AbstractComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
ClusterState innerPutJob(Job job, boolean overwrite, ClusterState currentState) {
|
ClusterState innerPutJob(Job job, boolean overwrite, ClusterState currentState) {
|
||||||
PrelertMetadata.Builder builder = createPrelertMetadatBuilder(currentState);
|
PrelertMetadata.Builder builder = createPrelertMetadataBuilder(currentState);
|
||||||
builder.putJob(job, overwrite);
|
builder.putJob(job, overwrite);
|
||||||
return buildNewClusterState(currentState, builder);
|
return buildNewClusterState(currentState, builder);
|
||||||
}
|
}
|
||||||
|
@ -249,7 +249,7 @@ public class JobManager extends AbstractComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
ClusterState removeJobFromClusterState(String jobId, ClusterState currentState) {
|
ClusterState removeJobFromClusterState(String jobId, ClusterState currentState) {
|
||||||
PrelertMetadata.Builder builder = createPrelertMetadatBuilder(currentState);
|
PrelertMetadata.Builder builder = createPrelertMetadataBuilder(currentState);
|
||||||
builder.removeJob(jobId);
|
builder.removeJob(jobId);
|
||||||
|
|
||||||
return buildNewClusterState(currentState, builder);
|
return buildNewClusterState(currentState, builder);
|
||||||
|
@ -269,7 +269,7 @@ public class JobManager extends AbstractComponent {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ClusterState execute(ClusterState currentState) throws Exception {
|
public ClusterState execute(ClusterState currentState) throws Exception {
|
||||||
PrelertMetadata.Builder builder = createPrelertMetadatBuilder(currentState);
|
PrelertMetadata.Builder builder = createPrelertMetadataBuilder(currentState);
|
||||||
builder.updateSchedulerStatus(jobId, newStatus);
|
builder.updateSchedulerStatus(jobId, newStatus);
|
||||||
return buildNewClusterState(currentState, builder);
|
return buildNewClusterState(currentState, builder);
|
||||||
}
|
}
|
||||||
|
@ -399,7 +399,7 @@ public class JobManager extends AbstractComponent {
|
||||||
jobResultsPersister.commitWrites(jobId);
|
jobResultsPersister.commitWrites(jobId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static PrelertMetadata.Builder createPrelertMetadatBuilder(ClusterState currentState) {
|
private static PrelertMetadata.Builder createPrelertMetadataBuilder(ClusterState currentState) {
|
||||||
PrelertMetadata currentPrelertMetadata = currentState.metaData().custom(PrelertMetadata.TYPE);
|
PrelertMetadata currentPrelertMetadata = currentState.metaData().custom(PrelertMetadata.TYPE);
|
||||||
return new PrelertMetadata.Builder(currentPrelertMetadata);
|
return new PrelertMetadata.Builder(currentPrelertMetadata);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue