This commit is contained in:
Shay Banon 2012-03-23 11:45:55 +02:00
parent 19152416a4
commit 7db5b0b4bd
1 changed files with 6 additions and 5 deletions

View File

@ -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;