Skip to content

Commit b99ec87

Browse files
Rename persistJob() to persistState() and remove impl details from doc
1 parent 3b1a634 commit b99ec87

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/AutodetectCommunicator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ public void forecastJob(ForecastParams params, BiConsumer<Void, Exception> handl
264264

265265
public void persistJob(BiConsumer<Void, Exception> handler) {
266266
submitOperation(() -> {
267-
autodetectProcess.persistJob();
267+
autodetectProcess.persistState();
268268
return null;
269269
}, handler);
270270
}

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/BlackHoleAutodetectProcess.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public String flushJob(FlushJobParams params) throws IOException {
9696
}
9797

9898
@Override
99-
public void persistJob() {
99+
public void persistState() {
100100
}
101101

102102
@Override

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/NativeAutodetectProcess.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public void forecastJob(ForecastParams params) throws IOException {
105105
}
106106

107107
@Override
108-
public void persistJob() throws IOException {
108+
public void persistState() throws IOException {
109109
newMessageWriter().writeStartBackgroundPersistMessage();
110110
}
111111

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/MultiplyingNormalizerProcess.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public void writeRecord(String[] record) throws IOException {
8181
}
8282

8383
@Override
84-
public void persistJob() {
84+
public void persistState() {
8585
// Nothing to do
8686
}
8787

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/NativeNormalizerProcess.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public boolean isReady() {
3434
}
3535

3636
@Override
37-
public void persistJob() {
37+
public void persistState() {
3838
// nothing to persist
3939
}
4040

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/NativeProcess.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public interface NativeProcess extends Closeable {
3434
* Ask the process to persist its state in the background
3535
* @throws IOException If writing the request fails
3636
*/
37-
void persistJob() throws IOException;
37+
void persistState() throws IOException;
3838

3939
/**
4040
* Flush the output data stream
@@ -64,14 +64,14 @@ public interface NativeProcess extends Closeable {
6464
boolean isProcessAlive();
6565

6666
/**
67-
* Check whether the process terminated given maximum 45ms for termination
67+
* Check whether the process terminated given a grace period.
6868
*
6969
* Processing errors are highly likely caused by the process being unexpectedly
7070
* terminated.
7171
*
7272
* Workaround: As we can not easily check if the process is alive, we rely on
7373
* the logPipe being ended. As the loghandler runs in another thread which
74-
* might fall behind this one, we give it a grace period of 45ms.
74+
* might fall behind this one, we give it a grace period.
7575
*
7676
* @return false if process has ended for sure, true if it probably still runs
7777
*/

x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/NativeAutodetectProcessTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public void testWriteUpdateConfigMessage() throws IOException {
128128
}
129129

130130
public void testPersistJob() throws IOException {
131-
testWriteMessage(p -> p.persistJob(), ControlMsgToProcessWriter.BACKGROUND_PERSIST_MESSAGE_CODE);
131+
testWriteMessage(p -> p.persistState(), ControlMsgToProcessWriter.BACKGROUND_PERSIST_MESSAGE_CODE);
132132
}
133133

134134
public void testWriteMessage(CheckedConsumer<NativeAutodetectProcess> writeFunction, String expectedMessageCode) throws IOException {

0 commit comments

Comments
 (0)