本文整理了Java中org.elasticsearch.indices.IndicesService.canDeleteIndexContents()
方法的一些代码示例,展示了IndicesService.canDeleteIndexContents()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IndicesService.canDeleteIndexContents()
方法的具体详情如下:
包路径:org.elasticsearch.indices.IndicesService
类名称:IndicesService
方法名:canDeleteIndexContents
[英]This method returns true if the current node is allowed to delete the given index. If the index uses a shared filesystem this method always returns false.
[中]如果允许当前节点删除给定索引,则此方法返回true。如果索引使用共享文件系统,则此方法始终返回false。
代码示例来源:origin: org.elasticsearch/elasticsearch
canDeleteIndexContents(shardId.getIndex(), indexSettings)) {
if (nodeEnv.findAllShardIds(shardId.getIndex()).isEmpty()) {
try {
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
canDeleteIndexContents(shardId.getIndex(), indexSettings)) {
if (nodeEnv.findAllShardIds(shardId.getIndex()).isEmpty()) {
try {
代码示例来源:origin: harbby/presto-connectors
private void deleteIndexStore(String reason, Index index, Settings indexSettings, boolean closed) throws IOException {
boolean success = false;
try {
// we are trying to delete the index store here - not a big deal if the lock can't be obtained
// the store metadata gets wiped anyway even without the lock this is just best effort since
// every shards deletes its content under the shard lock it owns.
logger.debug("{} deleting index store reason [{}]", index, reason);
if (canDeleteIndexContents(index, indexSettings, closed)) {
nodeEnv.deleteIndexDirectorySafe(index, 0, indexSettings);
}
success = true;
} catch (LockObtainFailedException ex) {
logger.debug("{} failed to delete index store - at least one shards is still locked", ex, index);
} catch (Exception ex) {
logger.warn("{} failed to delete index", ex, index);
} finally {
if (success == false) {
addPendingDelete(index, indexSettings);
}
// this is a pure protection to make sure this index doesn't get re-imported as a dangeling index.
// we should in the future rather write a tombstone rather than wiping the metadata.
MetaDataStateFormat.deleteMetaState(nodeEnv.indexPaths(index));
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch
canDeleteIndexContents(shardId.getIndex(), indexSettings)) {
if (nodeEnv.findAllShardIds(shardId.getIndex()).isEmpty()) {
try {
代码示例来源:origin: harbby/presto-connectors
canDeleteIndexContents(shardId.index(), indexSettings, false)) {
if (nodeEnv.findAllShardIds(shardId.index()).isEmpty()) {
try {
内容来源于网络,如有侵权,请联系作者删除!