3333import org .elasticsearch .xpack .ml .job .persistence .StateStreamer ;
3434import org .elasticsearch .xpack .ml .job .process .CountingInputStream ;
3535import org .elasticsearch .xpack .ml .job .process .DataCountsReporter ;
36- import org .elasticsearch .xpack .ml .job .process .autodetect .output .AutoDetectResultProcessor ;
36+ import org .elasticsearch .xpack .ml .job .process .autodetect .output .AutodetectResultProcessor ;
3737import org .elasticsearch .xpack .ml .job .process .autodetect .params .DataLoadParams ;
3838import org .elasticsearch .xpack .ml .job .process .autodetect .params .FlushJobParams ;
3939import org .elasticsearch .xpack .ml .job .process .autodetect .params .ForecastParams ;
@@ -66,7 +66,7 @@ public class AutodetectCommunicator implements Closeable {
6666 private final AutodetectProcess autodetectProcess ;
6767 private final StateStreamer stateStreamer ;
6868 private final DataCountsReporter dataCountsReporter ;
69- private final AutoDetectResultProcessor autoDetectResultProcessor ;
69+ private final AutodetectResultProcessor autodetectResultProcessor ;
7070 private final BiConsumer <Exception , Boolean > onFinishHandler ;
7171 private final ExecutorService autodetectWorkerExecutor ;
7272 private final NamedXContentRegistry xContentRegistry ;
@@ -75,15 +75,15 @@ public class AutodetectCommunicator implements Closeable {
7575 private volatile boolean processKilled ;
7676
7777 AutodetectCommunicator (Job job , Environment environment , AutodetectProcess process , StateStreamer stateStreamer ,
78- DataCountsReporter dataCountsReporter , AutoDetectResultProcessor autoDetectResultProcessor ,
78+ DataCountsReporter dataCountsReporter , AutodetectResultProcessor autodetectResultProcessor ,
7979 BiConsumer <Exception , Boolean > onFinishHandler , NamedXContentRegistry xContentRegistry ,
8080 ExecutorService autodetectWorkerExecutor ) {
8181 this .job = job ;
8282 this .environment = environment ;
8383 this .autodetectProcess = process ;
8484 this .stateStreamer = stateStreamer ;
8585 this .dataCountsReporter = dataCountsReporter ;
86- this .autoDetectResultProcessor = autoDetectResultProcessor ;
86+ this .autodetectResultProcessor = autodetectResultProcessor ;
8787 this .onFinishHandler = onFinishHandler ;
8888 this .xContentRegistry = xContentRegistry ;
8989 this .autodetectWorkerExecutor = autodetectWorkerExecutor ;
@@ -120,7 +120,7 @@ public void writeToJob(InputStream inputStream, AnalysisRegistry analysisRegistr
120120 }
121121
122122 CountingInputStream countingStream = new CountingInputStream (inputStream , dataCountsReporter );
123- DataToProcessWriter autoDetectWriter = createProcessWriter (params .getDataDescription ());
123+ DataToProcessWriter autodetectWriter = createProcessWriter (params .getDataDescription ());
124124
125125 if (includeTokensField && categorizationAnalyzer == null ) {
126126 createCategorizationAnalyzer (analysisRegistry );
@@ -129,14 +129,14 @@ public void writeToJob(InputStream inputStream, AnalysisRegistry analysisRegistr
129129 CountDownLatch latch = new CountDownLatch (1 );
130130 AtomicReference <DataCounts > dataCountsAtomicReference = new AtomicReference <>();
131131 AtomicReference <Exception > exceptionAtomicReference = new AtomicReference <>();
132- autoDetectWriter .write (countingStream , categorizationAnalyzer , xContentType , (dataCounts , e ) -> {
132+ autodetectWriter .write (countingStream , categorizationAnalyzer , xContentType , (dataCounts , e ) -> {
133133 dataCountsAtomicReference .set (dataCounts );
134134 exceptionAtomicReference .set (e );
135135 latch .countDown ();
136136 });
137137
138138 latch .await ();
139- autoDetectWriter .flushStream ();
139+ autodetectWriter .flushStream ();
140140
141141 if (exceptionAtomicReference .get () != null ) {
142142 throw exceptionAtomicReference .get ();
@@ -168,7 +168,7 @@ public void close(boolean restart, String reason) {
168168 killProcess (false , false );
169169 stateStreamer .cancel ();
170170 }
171- autoDetectResultProcessor .awaitCompletion ();
171+ autodetectResultProcessor .awaitCompletion ();
172172 } finally {
173173 onFinishHandler .accept (restart ? new ElasticsearchException (reason ) : null , true );
174174 }
@@ -199,13 +199,13 @@ public void killProcess(boolean awaitCompletion, boolean finish) throws IOExcept
199199 public void killProcess (boolean awaitCompletion , boolean finish , boolean finalizeJob ) throws IOException {
200200 try {
201201 processKilled = true ;
202- autoDetectResultProcessor .setProcessKilled ();
202+ autodetectResultProcessor .setProcessKilled ();
203203 autodetectWorkerExecutor .shutdown ();
204204 autodetectProcess .kill ();
205205
206206 if (awaitCompletion ) {
207207 try {
208- autoDetectResultProcessor .awaitCompletion ();
208+ autodetectResultProcessor .awaitCompletion ();
209209 } catch (TimeoutException e ) {
210210 LOGGER .warn (new ParameterizedMessage ("[{}] Timed out waiting for killed job" , job .getId ()), e );
211211 }
@@ -289,20 +289,20 @@ FlushAcknowledgement waitFlushToCompletion(String flushId) throws InterruptedExc
289289
290290 FlushAcknowledgement flushAcknowledgement ;
291291 try {
292- flushAcknowledgement = autoDetectResultProcessor .waitForFlushAcknowledgement (flushId , FLUSH_PROCESS_CHECK_FREQUENCY );
292+ flushAcknowledgement = autodetectResultProcessor .waitForFlushAcknowledgement (flushId , FLUSH_PROCESS_CHECK_FREQUENCY );
293293 while (flushAcknowledgement == null ) {
294294 checkProcessIsAlive ();
295295 checkResultsProcessorIsAlive ();
296- flushAcknowledgement = autoDetectResultProcessor .waitForFlushAcknowledgement (flushId , FLUSH_PROCESS_CHECK_FREQUENCY );
296+ flushAcknowledgement = autodetectResultProcessor .waitForFlushAcknowledgement (flushId , FLUSH_PROCESS_CHECK_FREQUENCY );
297297 }
298298 } finally {
299- autoDetectResultProcessor .clearAwaitingFlush (flushId );
299+ autodetectResultProcessor .clearAwaitingFlush (flushId );
300300 }
301301
302302 if (processKilled == false ) {
303303 // We also have to wait for the normalizer to become idle so that we block
304304 // clients from querying results in the middle of normalization.
305- autoDetectResultProcessor .waitUntilRenormalizerIsIdle ();
305+ autodetectResultProcessor .waitUntilRenormalizerIsIdle ();
306306
307307 LOGGER .debug ("[{}] Flush completed" , job .getId ());
308308 }
@@ -321,7 +321,7 @@ private void checkProcessIsAlive() {
321321 }
322322
323323 private void checkResultsProcessorIsAlive () {
324- if (autoDetectResultProcessor .isFailed ()) {
324+ if (autodetectResultProcessor .isFailed ()) {
325325 // Don't log here - it just causes double logging when the exception gets logged
326326 throw new ElasticsearchException ("[{}] Unexpected death of the result processor" , job .getId ());
327327 }
@@ -332,11 +332,11 @@ public ZonedDateTime getProcessStartTime() {
332332 }
333333
334334 public ModelSizeStats getModelSizeStats () {
335- return autoDetectResultProcessor .modelSizeStats ();
335+ return autodetectResultProcessor .modelSizeStats ();
336336 }
337337
338338 public TimingStats getTimingStats () {
339- return autoDetectResultProcessor .timingStats ();
339+ return autodetectResultProcessor .timingStats ();
340340 }
341341
342342 public DataCounts getDataCounts () {
0 commit comments