本文整理汇总了Java中org.elasticsearch.cluster.ClusterService类的典型用法代码示例。如果您正苦于以下问题:Java ClusterService类的具体用法?Java ClusterService怎么用?Java ClusterService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClusterService类属于org.elasticsearch.cluster包,在下文中一共展示了ClusterService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ShadowIndexShard
import org.elasticsearch.cluster.ClusterService; //导入依赖的package包/类
@Inject
public ShadowIndexShard(ShardId shardId, IndexSettingsService indexSettingsService,
IndicesLifecycle indicesLifecycle, Store store, StoreRecoveryService storeRecoveryService,
ThreadPool threadPool, MapperService mapperService,
IndexQueryParserService queryParserService, IndexCache indexCache,
IndexAliasesService indexAliasesService, IndicesQueryCache indicesQueryCache,
ShardPercolateService shardPercolateService, CodecService codecService,
ShardTermVectorsService termVectorsService, IndexFieldDataService indexFieldDataService,
IndexService indexService, @Nullable IndicesWarmer warmer,
SnapshotDeletionPolicy deletionPolicy, SimilarityService similarityService,
EngineFactory factory, ClusterService clusterService,
ShardPath path, BigArrays bigArrays, IndexSearcherWrappingService wrappingService,
IndexingMemoryController indexingMemoryController, SearchService shardSearchService) throws IOException {
super(shardId, indexSettingsService, indicesLifecycle, store, storeRecoveryService,
threadPool, mapperService, queryParserService, indexCache, indexAliasesService,
indicesQueryCache, shardPercolateService, codecService,
termVectorsService, indexFieldDataService, indexService,
warmer, deletionPolicy, similarityService,
factory, clusterService, path, bigArrays, wrappingService, indexingMemoryController, shardSearchService);
}
示例2: NodesFailureDetectionService
import org.elasticsearch.cluster.ClusterService; //导入依赖的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());
}
示例3: TransportReplicationAction
import org.elasticsearch.cluster.ClusterService; //导入依赖的package包/类
protected TransportReplicationAction(Settings settings, String actionName, TransportService transportService,
ClusterService clusterService, IndicesService indicesService,
ThreadPool threadPool, ShardStateAction shardStateAction,
MappingUpdatedAction mappingUpdatedAction, ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver, Class<Request> request,
Class<ReplicaRequest> replicaRequest, String executor) {
super(settings, actionName, threadPool, actionFilters, indexNameExpressionResolver, transportService.getTaskManager());
this.transportService = transportService;
this.clusterService = clusterService;
this.indicesService = indicesService;
this.shardStateAction = shardStateAction;
this.mappingUpdatedAction = mappingUpdatedAction;
this.transportPrimaryAction = actionName + "[p]";
this.transportReplicaAction = actionName + "[r]";
this.executor = executor;
this.checkWriteConsistency = checkWriteConsistency();
transportService.registerRequestHandler(actionName, request, ThreadPool.Names.SAME, new OperationTransportHandler());
transportService.registerRequestHandler(transportPrimaryAction, request, executor, new PrimaryOperationTransportHandler());
// we must never reject on because of thread pool capacity on replicas
transportService.registerRequestHandler(transportReplicaAction, replicaRequest, executor, true, new ReplicaOperationTransportHandler());
this.transportOptions = transportOptions();
this.defaultWriteConsistencyLevel = WriteConsistencyLevel.fromString(settings.get("action.write_consistency", "quorum"));
}
示例4: BlobIndices
import org.elasticsearch.cluster.ClusterService; //导入依赖的package包/类
@Inject
public BlobIndices(Settings settings,
Provider<TransportCreateIndexAction> transportCreateIndexActionProvider,
Provider<TransportDeleteIndexAction> transportDeleteIndexActionProvider,
Provider<TransportUpdateSettingsAction> transportUpdateSettingsActionProvider,
IndicesService indicesService,
IndicesLifecycle indicesLifecycle,
BlobEnvironment blobEnvironment,
ClusterService clusterService) {
super(settings);
this.transportCreateIndexActionProvider = transportCreateIndexActionProvider;
this.transportDeleteIndexActionProvider = transportDeleteIndexActionProvider;
this.transportUpdateSettingsActionProvider = transportUpdateSettingsActionProvider;
this.indicesService = indicesService;
this.indicesLifecycle = indicesLifecycle;
this.blobEnvironment = blobEnvironment;
clusterService.addFirst(this);
logger.setLevel("debug");
}
示例5: TransportSQLAction
import org.elasticsearch.cluster.ClusterService; //导入依赖的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());
}
示例6: RemoteCollectorFactory
import org.elasticsearch.cluster.ClusterService; //导入依赖的package包/类
@Inject
public RemoteCollectorFactory(ClusterService clusterService,
Functions functions,
ThreadPool threadPool,
JobContextService jobContextService,
Settings settings,
TransportActionProvider transportActionProvider,
BulkRetryCoordinatorPool bulkRetryCoordinatorPool,
IndexNameExpressionResolver indexNameExpressionResolver,
NestedReferenceResolver referenceResolver) {
this.clusterService = clusterService;
this.functions = functions;
this.threadPool = threadPool;
this.jobContextService = jobContextService;
this.settings = settings;
this.transportActionProvider = transportActionProvider;
this.bulkRetryCoordinatorPool = bulkRetryCoordinatorPool;
this.indexNameExpressionResolver = indexNameExpressionResolver;
normalizer = new EvaluatingNormalizer(functions, RowGranularity.NODE, referenceResolver);
implementationVisitor = new ImplementationSymbolVisitor(functions);
}
示例7: TransportTasksAction
import org.elasticsearch.cluster.ClusterService; //导入依赖的package包/类
protected TransportTasksAction(Settings settings, String actionName, ClusterName clusterName, ThreadPool threadPool,
ClusterService clusterService, TransportService transportService, ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver, Callable<TasksRequest> requestFactory,
String nodeExecutor) {
super(settings, actionName, threadPool, transportService, actionFilters, indexNameExpressionResolver, requestFactory);
this.clusterName = clusterName;
this.clusterService = clusterService;
this.transportService = transportService;
this.transportNodeAction = actionName + "[n]";
this.requestFactory = requestFactory;
transportService.registerRequestHandler(transportNodeAction, new Callable<NodeTaskRequest>() {
@Override
public NodeTaskRequest call() throws Exception {
return new NodeTaskRequest();
}
}, nodeExecutor, new NodeTransportHandler());
}
示例8: UpdateProjector
import org.elasticsearch.cluster.ClusterService; //导入依赖的package包/类
public UpdateProjector(ClusterService clusterService,
IndexNameExpressionResolver indexNameExpressionResolver,
Settings settings,
ShardId shardId,
TransportActionProvider transportActionProvider,
BulkRetryCoordinatorPool bulkRetryCoordinatorPool,
CollectExpression<Row, ?> collectUidExpression,
String[] assignmentsColumns,
Symbol[] assignments,
@Nullable Long requiredVersion,
UUID jobId) {
super(clusterService, settings, shardId, transportActionProvider, bulkRetryCoordinatorPool,
collectUidExpression, jobId);
this.indexNameExpressionResolver = indexNameExpressionResolver;
this.assignmentsColumns = assignmentsColumns;
this.assignments = assignments;
this.requiredVersion = requiredVersion;
}
示例9: createTableInfo
import org.elasticsearch.cluster.ClusterService; //导入依赖的package包/类
@Override
public TableInfo createTableInfo(ClusterService clusterService, List<? extends DataType> argumentTypes) {
validateTypes(argumentTypes);
final TableIdent tableIdent = new TableIdent(null, NAME);
ColumnRegistrar columnRegistrar = new ColumnRegistrar(tableIdent, RowGranularity.DOC);
for (int i = 0; i < argumentTypes.size(); i++) {
columnRegistrar.register(new ColumnIdent("col" + (i + 1)), ((CollectionType) argumentTypes.get(i)).innerType());
}
final String localNodeId = clusterService.localNode().id();
return new StaticTableInfo(tableIdent, columnRegistrar, Collections.<ColumnIdent>emptyList()) {
@Override
public RowGranularity rowGranularity() {
return RowGranularity.DOC;
}
@Override
public Routing getRouting(WhereClause whereClause, @Nullable String preference) {
return Routing.forTableOnSingleNode(tableIdent, localNodeId);
}
};
}
示例10: TransportSQLBulkAction
import org.elasticsearch.cluster.ClusterService; //导入依赖的package包/类
@Inject
public TransportSQLBulkAction(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, SQLBulkAction.NAME, threadPool, analyzer,
planner, executor, statsTables, actionFilters, indexNameExpressionResolver, transportKillJobsNodeAction,
transportService.getTaskManager());
transportService.registerRequestHandler(SQLBulkAction.NAME, SQLBulkRequest.class, ThreadPool.Names.SAME, new TransportHandler());
}
示例11: setReallocation
import org.elasticsearch.cluster.ClusterService; //导入依赖的package包/类
public void setReallocation(final ClusterService clusterService, final RoutingService routingService) {
this.routingService = routingService;
clusterService.add(new ClusterStateListener() {
@Override
public void clusterChanged(ClusterChangedEvent event) {
boolean cleanCache = false;
DiscoveryNode localNode = event.state().nodes().localNode();
if (localNode != null) {
if (localNode.masterNode() == true && event.localNodeMaster() == false) {
cleanCache = true;
}
} else {
cleanCache = true;
}
if (cleanCache) {
Releasables.close(asyncFetchStarted.values());
asyncFetchStarted.clear();
Releasables.close(asyncFetchStore.values());
asyncFetchStore.clear();
}
}
});
}
示例12: SysSchemaInfo
import org.elasticsearch.cluster.ClusterService; //导入依赖的package包/类
@Inject
public SysSchemaInfo(ClusterService clusterService) {
SysNodesTableInfo sysNodesTableInfo = new SysNodesTableInfo(clusterService);
tableInfos = ImmutableMap.<String, TableInfo>builder()
.put(SysClusterTableInfo.IDENT.name(), new SysClusterTableInfo(clusterService))
.put(SysNodesTableInfo.IDENT.name(), sysNodesTableInfo)
.put(SysShardsTableInfo.IDENT.name(), new SysShardsTableInfo(clusterService, sysNodesTableInfo))
.put(SysJobsTableInfo.IDENT.name(), new SysJobsTableInfo(clusterService))
.put(SysJobsLogTableInfo.IDENT.name(), new SysJobsLogTableInfo(clusterService))
.put(SysOperationsTableInfo.IDENT.name(), new SysOperationsTableInfo(clusterService, sysNodesTableInfo))
.put(SysOperationsLogTableInfo.IDENT.name(), new SysOperationsLogTableInfo(clusterService))
.put(SysChecksTableInfo.IDENT.name(), new SysChecksTableInfo(clusterService))
.put(SysRepositoriesTableInfo.IDENT.name(), new SysRepositoriesTableInfo(clusterService))
.put(SysSnapshotsTableInfo.IDENT.name(), new SysSnapshotsTableInfo(clusterService))
.build();
}
示例13: TransportPutChunkAction
import org.elasticsearch.cluster.ClusterService; //导入依赖的package包/类
@Inject
public TransportPutChunkAction(Settings settings,
TransportService transportService,
ClusterService clusterService,
IndicesService indicesService,
ThreadPool threadPool,
ShardStateAction shardStateAction,
BlobTransferTarget transferTarget,
MappingUpdatedAction mappingUpdatedAction,
ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver) {
super(settings, PutChunkAction.NAME, transportService, clusterService,
indicesService, threadPool, shardStateAction, mappingUpdatedAction, actionFilters,
indexNameExpressionResolver, PutChunkRequest.class, PutChunkReplicaRequest.class, ThreadPool.Names.INDEX);
this.transferTarget = transferTarget;
}
示例14: TransportCancelTasksAction
import org.elasticsearch.cluster.ClusterService; //导入依赖的package包/类
@Inject
public TransportCancelTasksAction(Settings settings, ClusterName clusterName, ThreadPool threadPool, ClusterService clusterService,
TransportService transportService, ActionFilters actionFilters, IndexNameExpressionResolver
indexNameExpressionResolver) {
super(settings, CancelTasksAction.NAME, clusterName, threadPool, clusterService, transportService, actionFilters,
indexNameExpressionResolver, new Callable<CancelTasksRequest>() {
@Override
public CancelTasksRequest call() throws Exception {
return new CancelTasksRequest();
}
}, ThreadPool.Names.MANAGEMENT);
transportService.registerRequestHandler(BAN_PARENT_ACTION_NAME, new Callable<BanParentTaskRequest>() {
@Override
public BanParentTaskRequest call() throws Exception {
return new BanParentTaskRequest();
}
}, ThreadPool.Names.SAME, new
BanParentRequestHandler());
}
示例15: JoinClusterAction
import org.elasticsearch.cluster.ClusterService; //导入依赖的package包/类
public JoinClusterAction(Settings settings, TransportService transportService, ClusterService clusterService,
ThreadPool threadPool, RoutingService routingService) {
super(settings);
this.pingTimeout = this.settings.getAsTime(SETTING_PING_TIMEOUT, timeValueSeconds(3));
this.joinTimeout = settings.getAsTime(SETTING_JOIN_TIMEOUT, TimeValue.timeValueMillis(this.pingTimeout.millis() * 20));
this.joinRetryAttempts = settings.getAsInt(SETTING_JOIN_RETRY_ATTEMPTS, 3);
this.joinRetryDelay = settings.getAsTime(SETTING_JOIN_RETRY_DELAY, TimeValue.timeValueMillis(100));
this.transportService = transportService;
this.clusterService = clusterService;
this.threadPool = threadPool;
this.routingService = routingService;
transportService.registerRequestHandler(JOIN_ACTION_NAME, JoinRequest.class, ThreadPool.Names.GENERIC, new JoinRequestRequestHandler());
}