File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
x-pack/plugin/migrate/src/main/java/org/elasticsearch/xpack/migrate/task Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -72,18 +72,26 @@ public ReindexDataStreamStatus getStatus() {
7272 clusterService .state (),
7373 getPersistentTaskId ()
7474 );
75+ boolean isComplete ;
7576 if (persistentTask != null ) {
7677 ReindexDataStreamPersistentTaskState state = (ReindexDataStreamPersistentTaskState ) persistentTask .getState ();
77- if (state != null && state .totalIndices () != null && state .totalIndicesToBeUpgraded () != null ) {
78- totalIndices = Math .toIntExact (state .totalIndices ());
79- totalIndicesToBeUpgraded = Math .toIntExact (state .totalIndicesToBeUpgraded ());
78+ if (state != null ) {
79+ isComplete = state .isComplete ();
80+ if (state .totalIndices () != null && state .totalIndicesToBeUpgraded () != null ) {
81+ totalIndices = Math .toIntExact (state .totalIndices ());
82+ totalIndicesToBeUpgraded = Math .toIntExact (state .totalIndicesToBeUpgraded ());
83+ }
84+ } else {
85+ isComplete = false ;
8086 }
87+ } else {
88+ isComplete = false ;
8189 }
8290 return new ReindexDataStreamStatus (
8391 persistentTaskStartTime ,
8492 totalIndices ,
8593 totalIndicesToBeUpgraded ,
86- isComplete () ,
94+ isComplete ,
8795 exception ,
8896 inProgress ,
8997 pending .get (),
@@ -127,14 +135,13 @@ private boolean isComplete() {
127135 if (persistentTask != null ) {
128136 ReindexDataStreamPersistentTaskState state = (ReindexDataStreamPersistentTaskState ) persistentTask .getState ();
129137 if (state != null ) {
130- return (( ReindexDataStreamPersistentTaskState ) persistentTask . getState ()) .isComplete ();
138+ return state .isComplete ();
131139 } else {
132140 return false ;
133141 }
134142 } else {
135143 return false ;
136144 }
137-
138145 }
139146
140147 public void setPendingIndicesCount (int size ) {
You can’t perform that action at this time.
0 commit comments