Skip to content

Commit

Permalink
Style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosdelest committed Jan 9, 2024
1 parent e4a6a67 commit 477b89c
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,16 @@ private void expectTransportShardBulkActionRequest(int requestSize) {
var listener = (ActionListener<BulkShardResponse>) invocation.getArguments()[2];
var bulkShardRequest = (BulkShardRequest) invocation.getArguments()[1];
ShardId shardId = new ShardId(INDEX_NAME, "UUID", 0);
BulkItemResponse[] bulkItemResponses = Arrays.stream(bulkShardRequest.items()).map(item -> BulkItemResponse.success(item.id(), DocWriteRequest.OpType.INDEX, new IndexResponse(
shardId,
"id",
0, 0, 0, true
))).toArray(BulkItemResponse[]::new);
BulkItemResponse[] bulkItemResponses = Arrays.stream(bulkShardRequest.items())
.map(item -> BulkItemResponse.success(
item.id(),
DocWriteRequest.OpType.INDEX,
new IndexResponse(
shardId,
"id",
0, 0, 0, true)
)
).toArray(BulkItemResponse[]::new);

listener.onResponse(new BulkShardResponse(shardId, bulkItemResponses));
return null;
Expand All @@ -301,7 +306,8 @@ private void expectInferenceRequest(String modelId, String... inferenceTexts) {
listener.onResponse(
new InferenceAction.Response(
new SparseEmbeddingResults(
request.getInput().stream()
request.getInput()
.stream()
.map(
text -> new SparseEmbeddingResults.Embedding(
List.of(new SparseEmbeddingResults.WeightedToken(text.toString(), 1.0f)),
Expand Down

0 comments on commit 477b89c

Please sign in to comment.