use of org.opensearch.indices.breaker.NoneCircuitBreakerService in project OpenSearch by opensearch-project.
the class SimpleMockNioTransportTests method build.
@Override
protected Transport build(Settings settings, final Version version, ClusterSettings clusterSettings, boolean doHandshake) {
NamedWriteableRegistry namedWriteableRegistry = new NamedWriteableRegistry(Collections.emptyList());
NetworkService networkService = new NetworkService(Collections.emptyList());
return new MockNioTransport(settings, version, threadPool, networkService, new MockPageCacheRecycler(settings), namedWriteableRegistry, new NoneCircuitBreakerService()) {
@Override
public void executeHandshake(DiscoveryNode node, TcpChannel channel, ConnectionProfile profile, ActionListener<Version> listener) {
if (doHandshake) {
super.executeHandshake(node, channel, profile, listener);
} else {
listener.onResponse(version.minimumCompatibilityVersion());
}
}
};
}
use of org.opensearch.indices.breaker.NoneCircuitBreakerService in project OpenSearch by opensearch-project.
the class Netty4HttpServerTransportTests method setup.
@Before
public void setup() throws Exception {
networkService = new NetworkService(Collections.emptyList());
threadPool = new TestThreadPool("test");
bigArrays = new MockBigArrays(new MockPageCacheRecycler(Settings.EMPTY), new NoneCircuitBreakerService());
clusterSettings = new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS);
}
use of org.opensearch.indices.breaker.NoneCircuitBreakerService in project OpenSearch by opensearch-project.
the class Netty4BadRequestTests method setup.
@Before
public void setup() throws Exception {
networkService = new NetworkService(Collections.emptyList());
bigArrays = new MockBigArrays(new MockPageCacheRecycler(Settings.EMPTY), new NoneCircuitBreakerService());
threadPool = new TestThreadPool("test");
}
use of org.opensearch.indices.breaker.NoneCircuitBreakerService in project OpenSearch by opensearch-project.
the class PercolateQueryBuilder method wrap.
static QueryShardContext wrap(QueryShardContext shardContext) {
return new QueryShardContext(shardContext) {
@Override
public IndexReader getIndexReader() {
// the reader of the MemoryIndex. We just use `null` for simplicity.
return null;
}
@Override
public BitSetProducer bitsetFilter(Query query) {
return context -> {
final IndexReaderContext topLevelContext = ReaderUtil.getTopLevelContext(context);
final IndexSearcher searcher = new IndexSearcher(topLevelContext);
searcher.setQueryCache(null);
final Weight weight = searcher.createWeight(searcher.rewrite(query), ScoreMode.COMPLETE_NO_SCORES, 1f);
final Scorer s = weight.scorer(context);
if (s != null) {
return new BitDocIdSet(BitSet.of(s.iterator(), context.reader().maxDoc())).bits();
} else {
return null;
}
};
}
@Override
@SuppressWarnings("unchecked")
public <IFD extends IndexFieldData<?>> IFD getForField(MappedFieldType fieldType) {
IndexFieldData.Builder builder = fieldType.fielddataBuilder(shardContext.getFullyQualifiedIndex().getName(), shardContext::lookup);
IndexFieldDataCache cache = new IndexFieldDataCache.None();
CircuitBreakerService circuitBreaker = new NoneCircuitBreakerService();
return (IFD) builder.build(cache, circuitBreaker);
}
};
}
use of org.opensearch.indices.breaker.NoneCircuitBreakerService in project OpenSearch by opensearch-project.
the class NioHttpServerTransportTests method setup.
@Before
public void setup() throws Exception {
networkService = new NetworkService(Collections.emptyList());
threadPool = new TestThreadPool("test");
pageRecycler = new MockPageCacheRecycler(Settings.EMPTY);
bigArrays = new MockBigArrays(pageRecycler, new NoneCircuitBreakerService());
}
Aggregations