@@ -121,6 +121,8 @@ private static StorageType fromString(String string) {
121
121
private StorageType storageType = StorageType .LOCAL ;
122
122
@ Nullable
123
123
private String sourceRemoteStoreRepository = null ;
124
+ @ Nullable
125
+ private String sourceRemoteTranslogRepository = null ;
124
126
125
127
@ Nullable // if any snapshot UUID will do
126
128
private String snapshotUuid ;
@@ -159,6 +161,9 @@ public RestoreSnapshotRequest(StreamInput in) throws IOException {
159
161
if (in .getVersion ().onOrAfter (Version .V_2_10_0 )) {
160
162
sourceRemoteStoreRepository = in .readOptionalString ();
161
163
}
164
+ if (in .getVersion ().onOrAfter (Version .CURRENT )) {
165
+ sourceRemoteTranslogRepository = in .readOptionalString ();
166
+ }
162
167
}
163
168
164
169
@ Override
@@ -183,6 +188,9 @@ public void writeTo(StreamOutput out) throws IOException {
183
188
if (out .getVersion ().onOrAfter (Version .V_2_10_0 )) {
184
189
out .writeOptionalString (sourceRemoteStoreRepository );
185
190
}
191
+ if (out .getVersion ().onOrAfter (Version .CURRENT )) {
192
+ out .writeOptionalString (sourceRemoteTranslogRepository );
193
+ }
186
194
}
187
195
188
196
@ Override
@@ -545,6 +553,16 @@ public RestoreSnapshotRequest setSourceRemoteStoreRepository(String sourceRemote
545
553
return this ;
546
554
}
547
555
556
+ /**
557
+ * Sets Source Remote Translog Repository for all the restored indices
558
+ *
559
+ * @param sourceRemoteTranslogRepository name of the remote translog repository that should be used for all restored indices.
560
+ */
561
+ public RestoreSnapshotRequest setSourceRemoteTranslogRepository (String sourceRemoteTranslogRepository ) {
562
+ this .sourceRemoteTranslogRepository = sourceRemoteTranslogRepository ;
563
+ return this ;
564
+ }
565
+
548
566
/**
549
567
* Returns Source Remote Store Repository for all the restored indices
550
568
*
@@ -554,6 +572,15 @@ public String getSourceRemoteStoreRepository() {
554
572
return sourceRemoteStoreRepository ;
555
573
}
556
574
575
+ /**
576
+ * Returns Source Remote Translog Repository for all the restored indices
577
+ *
578
+ * @return source Remote Translog Repository
579
+ */
580
+ public String getSourceRemoteTranslogRepository () {
581
+ return sourceRemoteTranslogRepository ;
582
+ }
583
+
557
584
/**
558
585
* Parses restore definition
559
586
*
@@ -673,6 +700,9 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
673
700
if (sourceRemoteStoreRepository != null ) {
674
701
builder .field ("source_remote_store_repository" , sourceRemoteStoreRepository );
675
702
}
703
+ if (sourceRemoteTranslogRepository != null ) {
704
+ builder .field ("source_remote_translog_repository" , sourceRemoteTranslogRepository );
705
+ }
676
706
builder .endObject ();
677
707
return builder ;
678
708
}
@@ -701,7 +731,8 @@ public boolean equals(Object o) {
701
731
&& Arrays .equals (ignoreIndexSettings , that .ignoreIndexSettings )
702
732
&& Objects .equals (snapshotUuid , that .snapshotUuid )
703
733
&& Objects .equals (storageType , that .storageType )
704
- && Objects .equals (sourceRemoteStoreRepository , that .sourceRemoteStoreRepository );
734
+ && Objects .equals (sourceRemoteStoreRepository , that .sourceRemoteStoreRepository )
735
+ && Objects .equals (sourceRemoteTranslogRepository , that .sourceRemoteTranslogRepository );
705
736
return equals ;
706
737
}
707
738
@@ -721,7 +752,8 @@ public int hashCode() {
721
752
indexSettings ,
722
753
snapshotUuid ,
723
754
storageType ,
724
- sourceRemoteStoreRepository
755
+ sourceRemoteStoreRepository ,
756
+ sourceRemoteTranslogRepository
725
757
);
726
758
result = 31 * result + Arrays .hashCode (indices );
727
759
result = 31 * result + Arrays .hashCode (ignoreIndexSettings );
0 commit comments