Skip to content

Commit d0ada04

Browse files
author
elasticsearchmachine
committed
[CI] Auto commit changes from spotless
1 parent 9458112 commit d0ada04

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/inference/results/StreamingUnifiedChatCompletionResults.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@
3535
/**
3636
* Chat Completion results that only contain a Flow.Publisher.
3737
*/
38-
public record StreamingUnifiedChatCompletionResults(Flow.Publisher<Results> publisher)
39-
implements
40-
InferenceServiceResults {
38+
public record StreamingUnifiedChatCompletionResults(Flow.Publisher<Results> publisher) implements InferenceServiceResults {
4139

4240
public static final String NAME = "chat_completion_chunk";
4341
public static final String MODEL_FIELD = "model";

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/inference/results/StreamingUnifiedChatCompletionResultsTests.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,10 @@ public void testBufferedPublishing() {
213213
downstream.onSubscribe(new Flow.Subscription() {
214214
@Override
215215
public void request(long n) {
216-
if(completed.compareAndSet(false, true)) {
216+
if (completed.compareAndSet(false, true)) {
217217
downstream.onNext(new StreamingUnifiedChatCompletionResults.Results(results));
218218
} else {
219-
downstream.onComplete();
219+
downstream.onComplete();
220220
}
221221
}
222222

@@ -232,7 +232,7 @@ public void cancel() {
232232
streamingResults.publisher().subscribe(new Flow.Subscriber<>() {
233233
@Override
234234
public void onSubscribe(Flow.Subscription subscription) {
235-
if(upstream.compareAndSet(null, subscription) == false) {
235+
if (upstream.compareAndSet(null, subscription) == false) {
236236
fail("Upstream already set?!");
237237
}
238238
subscription.request(1);
@@ -243,7 +243,7 @@ public void onNext(StreamingUnifiedChatCompletionResults.Results item) {
243243
assertNotNull(item);
244244
counter.incrementAndGet();
245245
var sub = upstream.get();
246-
if(sub != null) {
246+
if (sub != null) {
247247
sub.request(1);
248248
} else {
249249
fail("Upstream not yet set?!");
@@ -256,8 +256,7 @@ public void onError(Throwable throwable) {
256256
}
257257

258258
@Override
259-
public void onComplete() {
260-
}
259+
public void onComplete() {}
261260
});
262261
assertThat(counter.get(), equalTo(2));
263262
}

0 commit comments

Comments
 (0)