本文整理汇总了Java中org.elasticsearch.repositories.RepositoryMissingException类的典型用法代码示例。如果您正苦于以下问题:Java RepositoryMissingException类的具体用法?Java RepositoryMissingException怎么用?Java RepositoryMissingException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RepositoryMissingException类属于org.elasticsearch.repositories包,在下文中一共展示了RepositoryMissingException类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: wipeRepositories
import org.elasticsearch.repositories.RepositoryMissingException; //导入依赖的package包/类
/**
* Deletes repositories, supports wildcard notation.
*/
public void wipeRepositories(String... repositories) {
if (size() > 0) {
// if nothing is provided, delete all
if (repositories.length == 0) {
repositories = new String[]{"*"};
}
for (String repository : repositories) {
try {
client().admin().cluster().prepareDeleteRepository(repository).execute().actionGet();
} catch (RepositoryMissingException ex) {
// ignore
}
}
}
}
开发者ID:justor,项目名称:elasticsearch_my,代码行数:19,代码来源:TestCluster.java
示例2: deleteMissingRepositories
import org.elasticsearch.repositories.RepositoryMissingException; //导入依赖的package包/类
public void deleteMissingRepositories() {
Utils.info("[SpaceDog] deleting missing repositories ...");
List<RepositoryMetaData> repositories = elastic().cluster()//
.prepareGetRepositories().get().repositories();
for (RepositoryMetaData repository : repositories) {
try {
elastic().cluster()//
.prepareVerifyRepository(repository.name()).get();
Utils.info("[SpaceDog] repository [%s] OK", repository.name());
} catch (RepositoryMissingException e) {
elastic().cluster()//
.prepareDeleteRepository(repository.name()).get();
Utils.info("[SpaceDog] repository [%s] deleted because missing", repository.name());
}
}
}
开发者ID:spacedog-io,项目名称:spacedog-server,代码行数:24,代码来源:SnapshotResource.java
示例3: deleteObsoleteRepositories
import org.elasticsearch.repositories.RepositoryMissingException; //导入依赖的package包/类
/**
* TODO does not delete very obsolete repo if one is missing in between
*/
public void deleteObsoleteRepositories() {
Utils.info("[SpaceDog] deleting obsolete repositories ...");
String currentRepositoryId = ElasticRepository.getCurrentRepositoryId();
String obsoleteRepositoryId = ElasticRepository.getPreviousRepositoryId(currentRepositoryId, 4);
while (true) {
try {
elastic().cluster()//
.prepareDeleteRepository(obsoleteRepositoryId)//
.get();
Utils.info("[SpaceDog] repository [%s] deleted because obsolete", obsoleteRepositoryId);
obsoleteRepositoryId = ElasticRepository.getPreviousRepositoryId(//
obsoleteRepositoryId, 1);
} catch (RepositoryMissingException e) {
break;
}
}
}
开发者ID:spacedog-io,项目名称:spacedog-server,代码行数:28,代码来源:SnapshotResource.java
示例4: validate
import org.elasticsearch.repositories.RepositoryMissingException; //导入依赖的package包/类
/**
* Validates snapshot request
*
* @param request snapshot request
* @param state current cluster state
*/
private void validate(SnapshotRequest request, ClusterState state) {
RepositoriesMetaData repositoriesMetaData = state.getMetaData().custom(RepositoriesMetaData.TYPE);
final String repository = request.repositoryName;
if (repositoriesMetaData == null || repositoriesMetaData.repository(repository) == null) {
throw new RepositoryMissingException(repository);
}
validate(repository, request.snapshotName);
}
开发者ID:justor,项目名称:elasticsearch_my,代码行数:15,代码来源:SnapshotsService.java
示例5: wipeRepositories
import org.elasticsearch.repositories.RepositoryMissingException; //导入依赖的package包/类
/**
* Deletes repositories, supports wildcard notation.
*/
public static void wipeRepositories(String... repositories) {
// if nothing is provided, delete all
if (repositories.length == 0) {
repositories = new String[]{"*"};
}
for (String repository : repositories) {
try {
client().admin().cluster().prepareDeleteRepository(repository).get();
} catch (RepositoryMissingException ex) {
// ignore
}
}
}
开发者ID:justor,项目名称:elasticsearch_my,代码行数:17,代码来源:AzureSnapshotRestoreTests.java
示例6: wipeRepositories
import org.elasticsearch.repositories.RepositoryMissingException; //导入依赖的package包/类
/**
* Deletes repositories, supports wildcard notation.
*/
public static void wipeRepositories(String... repositories) {
// if nothing is provided, delete all
if (repositories.length == 0) {
repositories = new String[]{"*"};
}
for (String repository : repositories) {
try {
client().admin().cluster().prepareDeleteRepository(repository).execute().actionGet();
} catch (RepositoryMissingException ex) {
// ignore
}
}
}
开发者ID:justor,项目名称:elasticsearch_my,代码行数:17,代码来源:AbstractS3SnapshotRestoreTest.java
示例7: esToCrateException
import org.elasticsearch.repositories.RepositoryMissingException; //导入依赖的package包/类
/**
* Returns the cause throwable of a {@link org.elasticsearch.transport.RemoteTransportException}
* and {@link org.elasticsearch.action.search.ReduceSearchPhaseException}.
* Also transform throwable to {@link io.crate.exceptions.CrateException}.
*/
private Throwable esToCrateException(Throwable e) {
e = Exceptions.unwrap(e);
if (e instanceof IllegalArgumentException || e instanceof ParsingException) {
return new SQLParseException(e.getMessage(), (Exception) e);
} else if (e instanceof UnsupportedOperationException) {
return new UnsupportedFeatureException(e.getMessage(), (Exception) e);
} else if (e instanceof DocumentAlreadyExistsException) {
return new DuplicateKeyException(
"A document with the same primary key exists already", e);
} else if (e instanceof IndexAlreadyExistsException) {
return new TableAlreadyExistsException(((IndexAlreadyExistsException) e).getIndex(), e);
} else if ((e instanceof InvalidIndexNameException)) {
if (e.getMessage().contains("already exists as alias")) {
// treat an alias like a table as aliases are not officially supported
return new TableAlreadyExistsException(((InvalidIndexNameException) e).getIndex(),
e);
}
return new InvalidTableNameException(((InvalidIndexNameException) e).getIndex(), e);
} else if (e instanceof InvalidIndexTemplateException) {
PartitionName partitionName = PartitionName.fromIndexOrTemplate(((InvalidIndexTemplateException) e).name());
return new InvalidTableNameException(partitionName.tableIdent().fqn(), e);
} else if (e instanceof IndexNotFoundException) {
return new TableUnknownException(((IndexNotFoundException) e).getIndex(), e);
} else if (e instanceof org.elasticsearch.common.breaker.CircuitBreakingException) {
return new CircuitBreakingException(e.getMessage());
} else if (e instanceof InterruptedException) {
return new JobKilledException();
} else if (e instanceof RepositoryMissingException) {
return new RepositoryUnknownException(((RepositoryMissingException) e).repository());
} else if (e instanceof SnapshotMissingException) {
return new SnapshotUnknownException(((SnapshotMissingException) e).snapshot(), e);
} else if (e instanceof InvalidSnapshotNameException) {
if (((InvalidSnapshotNameException) e).getDetailedMessage().contains("snapshot with such name already exists")) {
return new SnapShotAlreadyExistsExeption(((InvalidSnapshotNameException) e).snapshot());
}
}
return e;
}
开发者ID:baidu,项目名称:Elasticsearch,代码行数:45,代码来源:TransportBaseSQLAction.java
示例8: validate
import org.elasticsearch.repositories.RepositoryMissingException; //导入依赖的package包/类
/**
* Validates snapshot request
*
* @param request snapshot request
* @param state current cluster state
*/
private void validate(SnapshotRequest request, ClusterState state) {
RepositoriesMetaData repositoriesMetaData = state.getMetaData().custom(RepositoriesMetaData.TYPE);
if (repositoriesMetaData == null || repositoriesMetaData.repository(request.repository()) == null) {
throw new RepositoryMissingException(request.repository());
}
validate(new SnapshotId(request.repository(), request.name()));
}
开发者ID:baidu,项目名称:Elasticsearch,代码行数:14,代码来源:SnapshotsService.java
示例9: getOrCreateRepositoryFor
import org.elasticsearch.repositories.RepositoryMissingException; //导入依赖的package包/类
static String getOrCreateRepositoryFor(DateTime date) {
String repoId = ElasticRepository.toRepositoryId(date);
try {
SnapshotResource.elastic().cluster()//
.prepareGetRepositories(repoId)//
.get();
} catch (RepositoryMissingException e) {
ElasticRepository repo = new ElasticRepository(repoId);
PutRepositoryResponse putRepositoryResponse = SnapshotResource.elastic().cluster()//
.preparePutRepository(repo.id())//
.setType(repo.type())//
.setSettings(repo.settings())//
.get();
if (!putRepositoryResponse.isAcknowledged())
throw Exceptions.runtime(//
"error creating snapshot repository with id [%s]: no details available", //
repoId);
}
return repoId;
}
开发者ID:spacedog-io,项目名称:spacedog-server,代码行数:28,代码来源:ElasticRepository.java
示例10: wipeRepositories
import org.elasticsearch.repositories.RepositoryMissingException; //导入依赖的package包/类
public static void wipeRepositories(String... repositories) {
// if nothing is provided, delete all
if (repositories.length == 0) {
repositories = new String[]{"*"};
}
for (String repository : repositories) {
try {
client().admin().cluster().prepareDeleteRepository(repository).execute().actionGet();
} catch (RepositoryMissingException ex) {
// ignore
}
}
}
开发者ID:mitallast,项目名称:elasticsearch-webdav-plugin,代码行数:14,代码来源:WebdavRepositoryTest.java
注:本文中的org.elasticsearch.repositories.RepositoryMissingException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论