本文整理汇总了Java中org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotAction类的典型用法代码示例。如果您正苦于以下问题:Java CreateSnapshotAction类的具体用法?Java CreateSnapshotAction怎么用?Java CreateSnapshotAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CreateSnapshotAction类属于org.elasticsearch.action.admin.cluster.snapshots.create包,在下文中一共展示了CreateSnapshotAction类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testActions
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotAction; //导入依赖的package包/类
public void testActions() {
// TODO this is a really shitty way to test it, we need to figure out a way to test all the client methods
// without specifying each one (reflection doesn't as each action needs its own special settings, without
// them, request validation will fail before the test is executed. (one option is to enable disabling the
// validation in the settings??? - ugly and conceptually wrong)
// choosing arbitrary top level actions to test
client.prepareGet("idx", "type", "id").execute().addListener(new AssertingActionListener<>(GetAction.NAME, client.threadPool()));
client.prepareSearch().execute().addListener(new AssertingActionListener<>(SearchAction.NAME, client.threadPool()));
client.prepareDelete("idx", "type", "id").execute().addListener(new AssertingActionListener<>(DeleteAction.NAME, client.threadPool()));
client.admin().cluster().prepareDeleteStoredScript("lang", "id").execute().addListener(new AssertingActionListener<>(DeleteStoredScriptAction.NAME, client.threadPool()));
client.prepareIndex("idx", "type", "id").setSource("source", XContentType.JSON).execute().addListener(new AssertingActionListener<>(IndexAction.NAME, client.threadPool()));
// choosing arbitrary cluster admin actions to test
client.admin().cluster().prepareClusterStats().execute().addListener(new AssertingActionListener<>(ClusterStatsAction.NAME, client.threadPool()));
client.admin().cluster().prepareCreateSnapshot("repo", "bck").execute().addListener(new AssertingActionListener<>(CreateSnapshotAction.NAME, client.threadPool()));
client.admin().cluster().prepareReroute().execute().addListener(new AssertingActionListener<>(ClusterRerouteAction.NAME, client.threadPool()));
// choosing arbitrary indices admin actions to test
client.admin().indices().prepareCreate("idx").execute().addListener(new AssertingActionListener<>(CreateIndexAction.NAME, client.threadPool()));
client.admin().indices().prepareStats().execute().addListener(new AssertingActionListener<>(IndicesStatsAction.NAME, client.threadPool()));
client.admin().indices().prepareClearCache("idx1", "idx2").execute().addListener(new AssertingActionListener<>(ClearIndicesCacheAction.NAME, client.threadPool()));
client.admin().indices().prepareFlush().execute().addListener(new AssertingActionListener<>(FlushAction.NAME, client.threadPool()));
}
示例2: apply
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotAction; //导入依赖的package包/类
@Override
public void apply(final String action, final ActionResponse response,
@SuppressWarnings("rawtypes") final ActionListener listener,
final ActionFilterChain chain) {
if (!CreateSnapshotAction.NAME.equals(action) || !clusterService.state().nodes().localNodeMaster()) {
chain.proceed(action, response, listener);
} else {
final CreateSnapshotResponse createSnapshotResponse = (CreateSnapshotResponse) response;
final SnapshotInfo snapshotInfo = createSnapshotResponse
.getSnapshotInfo();
dictionarySnapshotService.createDictionarySnapshot(
((ActionListenerWrapper<?>) listener).getSnapshotId(),
snapshotInfo, new ActionListener<Void>() {
@Override
public void onResponse(final Void resp) {
chain.proceed(action, response, listener);
}
@Override
public void onFailure(final Throwable e) {
listener.onFailure(e);
}
});
}
}
示例3: createSnapshot
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotAction; //导入依赖的package包/类
@Override
public ActionFuture<CreateSnapshotResponse> createSnapshot(CreateSnapshotRequest request) {
return execute(CreateSnapshotAction.INSTANCE, request);
}
示例4: prepareCreateSnapshot
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotAction; //导入依赖的package包/类
@Override
public CreateSnapshotRequestBuilder prepareCreateSnapshot(String repository, String name) {
return new CreateSnapshotRequestBuilder(this, CreateSnapshotAction.INSTANCE, repository, name);
}