File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
server/src/main/java/org/elasticsearch/cluster/metadata Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -517,11 +517,37 @@ public IndexMode getIndexMode() {
517517 return indexMode ;
518518 }
519519
520+ /**
521+ * Retrieves the lifecycle configuration meant for the backing indices.
522+ */
520523 @ Nullable
521524 public DataStreamLifecycle getDataLifecycle () {
522525 return lifecycle ;
523526 }
524527
528+ /**
529+ * Retrieves the lifecycle configuration meant for the failure store. Currently, it's the same with {@link #getDataLifecycle()}
530+ * but it will change.
531+ */
532+ @ Nullable
533+ public DataStreamLifecycle getFailuresLifecycle () {
534+ return lifecycle ;
535+ }
536+
537+ /**
538+ * Retrieves the correct lifecycle for the provided index. Returns null if the index does not belong to this data stream
539+ */
540+ @ Nullable
541+ public DataStreamLifecycle getDataLifecycleForIndex (Index index ) {
542+ if (backingIndices .containsIndex (index .getName ())) {
543+ return getDataLifecycle ();
544+ }
545+ if (failureIndices .containsIndex (index .getName ())) {
546+ return getFailuresLifecycle ();
547+ }
548+ return null ;
549+ }
550+
525551 /**
526552 * Returns the latest auto sharding event that happened for this data stream
527553 */
You can’t perform that action at this time.
0 commit comments