本文整理汇总了Java中org.elasticsearch.transport.TransportService类的典型用法代码示例。如果您正苦于以下问题:Java TransportService类的具体用法?Java TransportService怎么用?Java TransportService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TransportService类属于org.elasticsearch.transport包,在下文中一共展示了TransportService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: RemoteRecoveryTargetHandler
import org.elasticsearch.transport.TransportService; //导入依赖的package包/类
public RemoteRecoveryTargetHandler(long recoveryId, ShardId shardId, String targetAllocationId, TransportService transportService,
DiscoveryNode targetNode, RecoverySettings recoverySettings, Consumer<Long> onSourceThrottle) {
this.targetAllocationId = targetAllocationId;
this.transportService = transportService;
this.recoveryId = recoveryId;
this.shardId = shardId;
this.targetNode = targetNode;
this.recoverySettings = recoverySettings;
this.onSourceThrottle = onSourceThrottle;
this.translogOpsRequestOptions = TransportRequestOptions.builder()
.withCompress(true)
.withType(TransportRequestOptions.Type.RECOVERY)
.withTimeout(recoverySettings.internalActionLongTimeout())
.build();
this.fileChunkRequestOptions = TransportRequestOptions.builder()
.withCompress(false) // lucene files are already compressed and therefore compressing this won't really help much so
// we are saving the cpu for other things
.withType(TransportRequestOptions.Type.RECOVERY)
.withTimeout(recoverySettings.internalActionTimeout())
.build();
}
示例2: TransportBroadcastByNodeAction
import org.elasticsearch.transport.TransportService; //导入依赖的package包/类
public TransportBroadcastByNodeAction(
Settings settings,
String actionName,
ThreadPool threadPool,
ClusterService clusterService,
TransportService transportService,
ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver,
Class<Request> request,
String executor) {
super(settings, actionName, threadPool, transportService, actionFilters, indexNameExpressionResolver, request);
this.clusterService = clusterService;
this.transportService = transportService;
transportNodeBroadcastAction = actionName + "[n]";
transportService.registerRequestHandler(transportNodeBroadcastAction, new Callable<NodeRequest>() {
@Override
public NodeRequest call() throws Exception {
return new NodeRequest();
}
}, executor, new BroadcastByNodeTransportRequestHandler());
}
示例3: IndicesStore
import org.elasticsearch.transport.TransportService; //导入依赖的package包/类
@Inject
public IndicesStore(Settings settings, IndicesService indicesService,
ClusterService clusterService, TransportService transportService, ThreadPool threadPool) {
super(settings);
this.indicesService = indicesService;
this.clusterService = clusterService;
this.transportService = transportService;
this.threadPool = threadPool;
transportService.registerRequestHandler(ACTION_SHARD_EXISTS, ShardActiveRequest::new, ThreadPool.Names.SAME, new ShardActiveRequestHandler());
this.deleteShardTimeout = INDICES_STORE_DELETE_SHARD_TIMEOUT.get(settings);
// Doesn't make sense to delete shards on non-data nodes
if (DiscoveryNode.isDataNode(settings)) {
// we double check nothing has changed when responses come back from other nodes.
// it's easier to do that check when the current cluster state is visible.
// also it's good in general to let things settle down
clusterService.addListener(this);
}
}
示例4: TransportStartBlobAction
import org.elasticsearch.transport.TransportService; //导入依赖的package包/类
@Inject
public TransportStartBlobAction(Settings settings,
TransportService transportService,
ClusterService clusterService,
IndicesService indicesService,
ThreadPool threadPool,
ShardStateAction shardStateAction,
BlobTransferTarget transferTarget,
MappingUpdatedAction mappingUpdatedAction,
ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver) {
super(settings, StartBlobAction.NAME, transportService, clusterService,
indicesService, threadPool, shardStateAction, mappingUpdatedAction, actionFilters,
indexNameExpressionResolver, StartBlobRequest.class, StartBlobRequest.class, ThreadPool.Names.INDEX);
this.transferTarget = transferTarget;
logger.trace("Constructor");
}
示例5: NodesFailureDetectionService
import org.elasticsearch.transport.TransportService; //导入依赖的package包/类
public NodesFailureDetectionService(Settings settings, ThreadPool threadPool, TransportService transportService, ClusterName clusterName, ClusterService clusterService,
RoutingService routingService, JoinClusterAction joinClusterAction, ClusterStateOpLog clusterStateOpLog) {
super(settings);
this.pingInterval = settings.getAsTime(SETTING_PING_INTERVAL, timeValueSeconds(1));
this.pingTimeout = settings.getAsTime(SETTING_PING_TIMEOUT, timeValueSeconds(5));
this.pingRetryCount = settings.getAsInt(SETTING_PING_RETRIES, 3);
this.threadPool = threadPool;
this.transportService = transportService;
this.clusterName = clusterName;
this.clusterService = clusterService;
this.routingService = routingService;
this.joinClusterAction = joinClusterAction;
this.clusterStateOpLog = clusterStateOpLog;
this.localNode = clusterService.localNode();
logger.debug("[node ] uses ping_interval [{}], ping_timeout [{}], ping_retries [{}]", pingInterval, pingTimeout, pingRetryCount);
transportService.registerRequestHandler(PING_ACTION_NAME, PingRequest.class, ThreadPool.Names.SAME, new PingRequestHandler());
}
示例6: TransportNodesAction
import org.elasticsearch.transport.TransportService; //导入依赖的package包/类
protected TransportNodesAction(Settings settings, String actionName, ThreadPool threadPool,
ClusterService clusterService, TransportService transportService, ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver,
Supplier<NodesRequest> request, Supplier<NodeRequest> nodeRequest,
String nodeExecutor,
Class<NodeResponse> nodeResponseClass) {
super(settings, actionName, threadPool, transportService, actionFilters, indexNameExpressionResolver, request);
this.clusterService = Objects.requireNonNull(clusterService);
this.transportService = Objects.requireNonNull(transportService);
this.nodeResponseClass = Objects.requireNonNull(nodeResponseClass);
this.transportNodeAction = actionName + "[n]";
transportService.registerRequestHandler(
transportNodeAction, nodeRequest, nodeExecutor, new NodeTransportHandler());
}
示例7: setUp
import org.elasticsearch.transport.TransportService; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
super.setUp();
transport = new CapturingTransport();
clusterService = createClusterService(THREAD_POOL);
final TransportService transportService = new TransportService(clusterService.getSettings(), transport, THREAD_POOL,
TransportService.NOOP_TRANSPORT_INTERCEPTOR, x -> clusterService.localNode(), null);
transportService.start();
transportService.acceptIncomingRequests();
setClusterState(clusterService, TEST_INDEX);
action = new TestTransportBroadcastByNodeAction(
Settings.EMPTY,
transportService,
new ActionFilters(new HashSet<>()),
new MyResolver(),
Request::new,
ThreadPool.Names.SAME
);
}
示例8: GceUnicastHostsProvider
import org.elasticsearch.transport.TransportService; //导入依赖的package包/类
public GceUnicastHostsProvider(Settings settings, GceInstancesService gceInstancesService,
TransportService transportService,
NetworkService networkService) {
super(settings);
this.gceInstancesService = gceInstancesService;
this.transportService = transportService;
this.networkService = networkService;
this.refreshInterval = GceInstancesService.REFRESH_SETTING.get(settings);
this.project = GceInstancesService.PROJECT_SETTING.get(settings);
this.zones = GceInstancesService.ZONE_SETTING.get(settings);
this.tags = TAGS_SETTING.get(settings);
if (logger.isDebugEnabled()) {
logger.debug("using tags {}", this.tags);
}
}
示例9: TransportDistributedResultAction
import org.elasticsearch.transport.TransportService; //导入依赖的package包/类
@Inject
public TransportDistributedResultAction(Transports transports,
JobContextService jobContextService,
ThreadPool threadPool,
TransportService transportService,
Settings settings) {
super(settings);
this.transports = transports;
this.jobContextService = jobContextService;
scheduler = threadPool.scheduler();
transportService.registerRequestHandler(DISTRIBUTED_RESULT_ACTION,
DistributedResultRequest.class,
ThreadPool.Names.GENERIC,
new NodeActionRequestHandler<DistributedResultRequest, DistributedResultResponse>(this) { });
}
示例10: TransportClientNodesService
import org.elasticsearch.transport.TransportService; //导入依赖的package包/类
@Inject
public TransportClientNodesService(Settings settings, ClusterName clusterName, TransportService transportService,
ThreadPool threadPool, Headers headers, Version version) {
super(settings);
this.clusterName = clusterName;
this.transportService = transportService;
this.threadPool = threadPool;
this.minCompatibilityVersion = version.minimumCompatibilityVersion();
this.headers = headers;
this.nodesSamplerInterval = this.settings.getAsTime("client.transport.nodes_sampler_interval", timeValueSeconds(5));
this.pingTimeout = this.settings.getAsTime("client.transport.ping_timeout", timeValueSeconds(5)).millis();
this.ignoreClusterName = this.settings.getAsBoolean("client.transport.ignore_cluster_name", false);
if (logger.isDebugEnabled()) {
logger.debug("node_sampler_interval[" + nodesSamplerInterval + "]");
}
if (this.settings.getAsBoolean("client.transport.sniff", false)) {
this.nodesSampler = new SniffNodesSampler();
} else {
this.nodesSampler = new SimpleNodeSampler();
}
this.nodesSamplerFuture = threadPool.schedule(nodesSamplerInterval, ThreadPool.Names.GENERIC, new ScheduledNodeSampler());
}
示例11: TransportSQLAction
import org.elasticsearch.transport.TransportService; //导入依赖的package包/类
@Inject
public TransportSQLAction(
ClusterService clusterService,
Settings settings,
ThreadPool threadPool,
Analyzer analyzer,
Planner planner,
Provider<Executor> executor,
TransportService transportService,
StatsTables statsTables,
ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver,
TransportKillJobsNodeAction transportKillJobsNodeAction) {
super(clusterService, settings, SQLAction.NAME, threadPool,
analyzer, planner, executor, statsTables, actionFilters,
indexNameExpressionResolver, transportKillJobsNodeAction,
transportService.getTaskManager());
transportService.registerRequestHandler(SQLAction.NAME, SQLRequest.class, ThreadPool.Names.SAME, new TransportHandler());
}
示例12: TransportBroadcastByNodeAction
import org.elasticsearch.transport.TransportService; //导入依赖的package包/类
public TransportBroadcastByNodeAction(
Settings settings,
String actionName,
ThreadPool threadPool,
ClusterService clusterService,
TransportService transportService,
ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver,
Supplier<Request> request,
String executor,
boolean canTripCircuitBreaker) {
super(settings, actionName, canTripCircuitBreaker, threadPool, transportService, actionFilters, indexNameExpressionResolver,
request);
this.clusterService = clusterService;
this.transportService = transportService;
transportNodeBroadcastAction = actionName + "[n]";
transportService.registerRequestHandler(transportNodeBroadcastAction, NodeRequest::new, executor, false, canTripCircuitBreaker,
new BroadcastByNodeTransportRequestHandler());
}
示例13: testGet
import org.elasticsearch.transport.TransportService; //导入依赖的package包/类
public void testGet() {
ClusterSettings settings = new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS);
// group setting - complex matcher
Setting setting = settings.get("cluster.routing.allocation.require.value");
assertEquals(setting, FilterAllocationDecider.CLUSTER_ROUTING_REQUIRE_GROUP_SETTING);
setting = settings.get("cluster.routing.allocation.total_shards_per_node");
assertEquals(setting, ShardsLimitAllocationDecider.CLUSTER_TOTAL_SHARDS_PER_NODE_SETTING);
// array settings - complex matcher
assertNotNull(settings.get("transport.tracer.include." + randomIntBetween(1, 100)));
assertSame(TransportService.TRACE_LOG_INCLUDE_SETTING, settings.get("transport.tracer.include." + randomIntBetween(1, 100)));
// array settings - complex matcher - only accepts numbers
assertNull(settings.get("transport.tracer.include.FOO"));
}
示例14: setUp
import org.elasticsearch.transport.TransportService; //导入依赖的package包/类
@Override
@Before
public void setUp() throws Exception {
super.setUp();
transport = new CapturingTransport();
clusterService = createClusterService(THREAD_POOL);
transportService = new TransportService(clusterService.getSettings(), transport, THREAD_POOL,
TransportService.NOOP_TRANSPORT_INTERCEPTOR, x -> clusterService.localNode(), null);
transportService.start();
transportService.acceptIncomingRequests();
action = new TestTransportInstanceSingleOperationAction(
Settings.EMPTY,
"indices:admin/test",
transportService,
new ActionFilters(new HashSet<ActionFilter>()),
new MyResolver(),
Request::new
);
}
示例15: TransportSearchTemplateAction
import org.elasticsearch.transport.TransportService; //导入依赖的package包/类
@Inject
public TransportSearchTemplateAction(Settings settings, ThreadPool threadPool, TransportService transportService,
ActionFilters actionFilters, IndexNameExpressionResolver resolver,
ScriptService scriptService,
TransportSearchAction searchAction,
NamedXContentRegistry xContentRegistry) {
super(settings, SearchTemplateAction.NAME, threadPool, transportService, actionFilters, resolver, SearchTemplateRequest::new);
this.scriptService = scriptService;
this.searchAction = searchAction;
this.xContentRegistry = xContentRegistry;
}