cleanups
This commit is contained in:
parent
19152416a4
commit
7db5b0b4bd
|
@ -65,10 +65,7 @@ public class IndicesTTLService extends AbstractLifecycleComponent<IndicesTTLServ
|
||||||
|
|
||||||
static {
|
static {
|
||||||
MetaData.addDynamicSettings(
|
MetaData.addDynamicSettings(
|
||||||
"indices.ttl.interval"
|
"indices.ttl.interval",
|
||||||
);
|
|
||||||
|
|
||||||
IndexMetaData.addDynamicSettings(
|
|
||||||
"index.ttl.disable_purge"
|
"index.ttl.disable_purge"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -145,9 +142,13 @@ public class IndicesTTLService extends AbstractLifecycleComponent<IndicesTTLServ
|
||||||
*/
|
*/
|
||||||
private List<IndexShard> getShardsToPurge() {
|
private List<IndexShard> getShardsToPurge() {
|
||||||
List<IndexShard> shardsToPurge = new ArrayList<IndexShard>();
|
List<IndexShard> shardsToPurge = new ArrayList<IndexShard>();
|
||||||
|
MetaData metaData = clusterService.state().metaData();
|
||||||
for (IndexService indexService : indicesService) {
|
for (IndexService indexService : indicesService) {
|
||||||
// check the value of disable_purge for this index
|
// check the value of disable_purge for this index
|
||||||
IndexMetaData indexMetaData = clusterService.state().metaData().index(indexService.index().name());
|
IndexMetaData indexMetaData = metaData.index(indexService.index().name());
|
||||||
|
if (indexMetaData == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
boolean disablePurge = indexMetaData.settings().getAsBoolean("index.ttl.disable_purge", false);
|
boolean disablePurge = indexMetaData.settings().getAsBoolean("index.ttl.disable_purge", false);
|
||||||
if (disablePurge) {
|
if (disablePurge) {
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue