forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
42774a5
commit 199617e
Showing
4 changed files
with
68 additions
and
30 deletions.
There are no files selected for viewing
25 changes: 0 additions & 25 deletions
25
...ugin/esql/compute/src/test/java/org/elasticsearch/compute/TestBlockFactoryParamaters.java
This file was deleted.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
...ugin/esql/compute/src/test/java/org/elasticsearch/compute/TestBlockFactoryParameters.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
package org.elasticsearch.compute; | ||
|
||
import org.elasticsearch.common.breaker.CircuitBreaker; | ||
import org.elasticsearch.common.util.BigArrays; | ||
import org.elasticsearch.common.util.MockBigArrays; | ||
import org.elasticsearch.common.util.PageCacheRecycler; | ||
import org.elasticsearch.compute.data.BlockFactoryParameters; | ||
import org.elasticsearch.indices.breaker.CircuitBreakerService; | ||
|
||
import static org.mockito.Mockito.mock; | ||
import static org.mockito.Mockito.when; | ||
|
||
public class TestBlockFactoryParameters implements BlockFactoryParameters { | ||
|
||
final CircuitBreaker breaker; | ||
final BigArrays bigArrays; | ||
|
||
public TestBlockFactoryParameters() { | ||
breaker = new CountingCircuitBreaker("ESQL-test-breaker"); | ||
|
||
var breakerService = mock(CircuitBreakerService.class); | ||
when(breakerService.getBreaker(CircuitBreaker.REQUEST)).thenReturn(breaker); | ||
bigArrays = new MockBigArrays(PageCacheRecycler.NON_RECYCLING_INSTANCE, breakerService); | ||
} | ||
|
||
@Override | ||
public CircuitBreaker breaker() { | ||
return breaker; | ||
} | ||
|
||
@Override | ||
public BigArrays bigArrays() { | ||
return bigArrays; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters