@@ -67,6 +67,7 @@ public abstract class ShardFollowNodeTask extends AllocatedPersistentTask {
67
67
68
68
private static final Logger LOGGER = Loggers .getLogger (ShardFollowNodeTask .class );
69
69
70
+ private final String leaderIndex ;
70
71
private final ShardFollowTask params ;
71
72
private final TimeValue retryTimeout ;
72
73
private final TimeValue idleShardChangesRequestDelay ;
@@ -113,6 +114,12 @@ protected boolean removeEldestEntry(final Map.Entry<Long, ElasticsearchException
113
114
return size () > params .getMaxConcurrentReadBatches ();
114
115
}
115
116
};
117
+
118
+ if (params .getLeaderClusterAlias () != null ) {
119
+ leaderIndex = params .getLeaderClusterAlias () + ":" + params .getLeaderShardId ().getIndexName ();
120
+ } else {
121
+ leaderIndex = params .getLeaderShardId ().getIndexName ();
122
+ }
116
123
}
117
124
118
125
void start (
@@ -416,12 +423,6 @@ public ShardId getFollowShardId() {
416
423
417
424
@ Override
418
425
public synchronized Status getStatus () {
419
- final String leaderIndex ;
420
- if (params .getLeaderClusterAlias () != null ) {
421
- leaderIndex = params .getLeaderClusterAlias () + ":" + params .getLeaderShardId ().getIndexName ();
422
- } else {
423
- leaderIndex = params .getLeaderShardId ().getIndexName ();
424
- }
425
426
final long timeSinceLastFetchMillis ;
426
427
if (lastFetchTime != -1 ) {
427
428
timeSinceLastFetchMillis = TimeUnit .NANOSECONDS .toMillis (relativeTimeProvider .getAsLong () - lastFetchTime );
@@ -681,12 +682,12 @@ public NavigableMap<Long, ElasticsearchException> fetchExceptions() {
681
682
682
683
private final long timeSinceLastFetchMillis ;
683
684
684
- public long timeSinceLastFetch () {
685
+ public long timeSinceLastFetchMillis () {
685
686
return timeSinceLastFetchMillis ;
686
687
}
687
688
688
689
Status (
689
- String leaderIndex ,
690
+ final String leaderIndex ,
690
691
final int shardId ,
691
692
final long leaderGlobalCheckpoint ,
692
693
final long leaderMaxSeqNo ,
0 commit comments