本文整理汇总了Java中org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotRequestBuilder类的典型用法代码示例。如果您正苦于以下问题:Java CreateSnapshotRequestBuilder类的具体用法?Java CreateSnapshotRequestBuilder怎么用?Java CreateSnapshotRequestBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CreateSnapshotRequestBuilder类属于org.elasticsearch.action.admin.cluster.snapshots.create包,在下文中一共展示了CreateSnapshotRequestBuilder类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createNewSnapshot
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotRequestBuilder; //导入依赖的package包/类
private void createNewSnapshot() {
logger.info("Started snapshot for index(es): {} ", this.snapshotSettings.getIndices());
String snapshotName = DATE_FORMAT.format(new Date());
CreateSnapshotRequestBuilder createBuilder = getCreateSnapshotBuilder(snapshotName);
CreateSnapshotResponse createResp = createBuilder.get();
if (createResp.getSnapshotInfo() != null && (createResp.getSnapshotInfo().state() == SnapshotState.SUCCESS)) {
logger.info("Snapshot [{}] created.", snapshotName);
} else {
// TODO: Is this the right way to do this?
throw ExceptionsHelper.convertToElastic(new Exception("Unable to create snapshot " + snapshotName));
}
}
示例2: getCreateSnapshotBuilder
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotRequestBuilder; //导入依赖的package包/类
private CreateSnapshotRequestBuilder getCreateSnapshotBuilder(String snapshotName) {
CreateSnapshotRequestBuilder snapshotBuilder = new CreateSnapshotRequestBuilder(this.client.admin().cluster(), this.snapshotSettings.getRepository(), snapshotName);
String[] indices = this.snapshotSettings.getIndices().split(",");
snapshotBuilder.setIndices(indices);
snapshotBuilder.setWaitForCompletion(true);
snapshotBuilder.setIncludeGlobalState(this.snapshotSettings.isIncludeGlobalState());
snapshotBuilder.setPartial(false);
return snapshotBuilder;
}
示例3: assertSuccessfulSnapshot
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotRequestBuilder; //导入依赖的package包/类
public static CreateSnapshotResponse assertSuccessfulSnapshot(CreateSnapshotRequestBuilder requestBuilder) {
CreateSnapshotResponse response = requestBuilder.get();
assertSuccessfulSnapshot(response);
return response;
}
示例4: prepareCreateSnapshot
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotRequestBuilder; //导入依赖的package包/类
@Override
public CreateSnapshotRequestBuilder prepareCreateSnapshot(String repository, String name) {
return new CreateSnapshotRequestBuilder(this, CreateSnapshotAction.INSTANCE, repository, name);
}
示例5: snapshot
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotRequestBuilder; //导入依赖的package包/类
private static CreateSnapshotRequestBuilder snapshot(String name, String... indices) {
return client().admin().cluster().prepareCreateSnapshot("dummy-repo", name).setWaitForCompletion(true).setIndices(indices);
}
示例6: prepareCreateSnapshot
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotRequestBuilder; //导入依赖的package包/类
/**
* Creates a new snapshot.
*/
CreateSnapshotRequestBuilder prepareCreateSnapshot(String repository, String name);