本文整理汇总了Java中org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotAction类的典型用法代码示例。如果您正苦于以下问题:Java RestoreSnapshotAction类的具体用法?Java RestoreSnapshotAction怎么用?Java RestoreSnapshotAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RestoreSnapshotAction类属于org.elasticsearch.action.admin.cluster.snapshots.restore包,在下文中一共展示了RestoreSnapshotAction类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotAction; //导入依赖的package包/类
@Override
public void apply(final Task task, final String action,
@SuppressWarnings("rawtypes") final ActionRequest request,
@SuppressWarnings("rawtypes") final ActionListener listener,
final ActionFilterChain chain) {
if (!RestoreSnapshotAction.NAME.equals(action) || !clusterService.state().nodes().localNodeMaster()) {
chain.proceed(task, action, request, listener);
} else {
final RestoreSnapshotRequest restoreSnapshotRequest = (RestoreSnapshotRequest) request;
dictionaryRestoreService.restoreDictionarySnapshot(
restoreSnapshotRequest.repository(), restoreSnapshotRequest.snapshot(),
restoreSnapshotRequest.indices(), new ActionListener<Void>() {
@Override
public void onResponse(final Void response) {
chain.proceed(task, action, request, listener);
}
@Override
public void onFailure(final Throwable e) {
if (logger.isDebugEnabled()) {
logger.debug(
"Failed to restore dictionaries for {} snapshot in {} repository.",
e, restoreSnapshotRequest.repository(),
restoreSnapshotRequest.snapshot());
}
listener.onFailure(e);
}
});
}
}
示例2: restoreSnapshot
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotAction; //导入依赖的package包/类
@Override
public ActionFuture<RestoreSnapshotResponse> restoreSnapshot(RestoreSnapshotRequest request) {
return execute(RestoreSnapshotAction.INSTANCE, request);
}
示例3: prepareRestoreSnapshot
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotAction; //导入依赖的package包/类
@Override
public RestoreSnapshotRequestBuilder prepareRestoreSnapshot(String repository, String snapshot) {
return new RestoreSnapshotRequestBuilder(this, RestoreSnapshotAction.INSTANCE, repository, snapshot);
}