本文整理汇总了Java中org.elasticsearch.cluster.service.ClusterService.assertClusterStateThread方法的典型用法代码示例。如果您正苦于以下问题:Java ClusterService.assertClusterStateThread方法的具体用法?Java ClusterService.assertClusterStateThread怎么用?Java ClusterService.assertClusterStateThread使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.elasticsearch.cluster.service.ClusterService
的用法示例。
在下文中一共展示了ClusterService.assertClusterStateThread方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onFailure
import org.elasticsearch.cluster.service.ClusterService; //导入方法依赖的package包/类
private void onFailure(Throwable t) {
ClusterService.assertClusterStateThread();
ElectionCallback callback = getCallback(); // get under lock
if (callback != null) {
callback.onFailure(t);
}
}
示例2: markThreadAsDoneAndStartNew
import org.elasticsearch.cluster.service.ClusterService; //导入方法依赖的package包/类
/**
* marks the given joinThread as completed and makes sure another thread is running (starting one if needed)
* If the given thread is not the currently running join thread, the command is ignored.
*/
public void markThreadAsDoneAndStartNew(Thread joinThread) {
ClusterService.assertClusterStateThread();
if (!markThreadAsDone(joinThread)) {
return;
}
startNewThreadIfNotRunning();
}
示例3: stopRunningThreadAndRejoin
import org.elasticsearch.cluster.service.ClusterService; //导入方法依赖的package包/类
/** cleans any running joining thread and calls {@link #rejoin} */
public ClusterStateTaskExecutor.ClusterTasksResult<LocalClusterUpdateTask> stopRunningThreadAndRejoin(ClusterState clusterState, String reason) {
ClusterService.assertClusterStateThread();
currentJoinThread.set(null);
return rejoin(clusterState, reason);
}
示例4: markThreadAsDone
import org.elasticsearch.cluster.service.ClusterService; //导入方法依赖的package包/类
/** marks the given joinThread as completed. Returns false if the supplied thread is not the currently active join thread */
public boolean markThreadAsDone(Thread joinThread) {
ClusterService.assertClusterStateThread();
return currentJoinThread.compareAndSet(joinThread, null);
}
示例5: assertClusterStateThread
import org.elasticsearch.cluster.service.ClusterService; //导入方法依赖的package包/类
protected void assertClusterStateThread() {
ClusterService.assertClusterStateThread();
}