33
33
import lombok .NoArgsConstructor ;
34
34
import lombok .extern .log4j .Log4j2 ;
35
35
36
+ import org .apache .xtable .annotations .Stable ;
36
37
import org .apache .xtable .model .IncrementalTableChanges ;
37
38
import org .apache .xtable .model .InternalSnapshot ;
38
39
import org .apache .xtable .model .InternalTable ;
39
40
import org .apache .xtable .model .TableChange ;
40
41
import org .apache .xtable .model .metadata .TableSyncMetadata ;
42
+ import org .apache .xtable .model .sync .ErrorDetails ;
41
43
import org .apache .xtable .model .sync .SyncMode ;
42
44
import org .apache .xtable .model .sync .SyncResult ;
45
+ import org .apache .xtable .model .sync .SyncStatusCode ;
43
46
44
47
/** Provides the functionality to sync from the InternalTable format to the target format. */
45
48
@ Log4j2
@@ -58,6 +61,7 @@ public static TableFormatSync getInstance() {
58
61
* @param snapshot the snapshot to sync
59
62
* @return the result of the sync process
60
63
*/
64
+ @ Stable
61
65
public Map <String , SyncResult > syncSnapshot (
62
66
Collection <ConversionTarget > conversionTargets , InternalSnapshot snapshot ) {
63
67
Instant startTime = Instant .now ();
@@ -91,6 +95,7 @@ public Map<String, SyncResult> syncSnapshot(
91
95
* @param changes the changes from the source table format that need to be applied
92
96
* @return the results of trying to sync each change
93
97
*/
98
+ @ Stable
94
99
public Map <String , List <SyncResult >> syncChanges (
95
100
Map <ConversionTarget , TableSyncMetadata > conversionTargetWithMetadata ,
96
101
IncrementalTableChanges changes ) {
@@ -192,9 +197,9 @@ private SyncResult buildResultForError(SyncMode mode, Instant startTime, Excepti
192
197
.mode (mode )
193
198
.tableFormatSyncStatus (
194
199
SyncResult .SyncStatus .builder ()
195
- .statusCode (SyncResult . SyncStatusCode .ERROR )
200
+ .statusCode (SyncStatusCode .ERROR )
196
201
.errorDetails (
197
- SyncResult . ErrorDetails .builder ()
202
+ ErrorDetails .builder ()
198
203
.errorMessage (e .getMessage ())
199
204
.errorDescription ("Failed to sync " + mode .name ())
200
205
.canRetryOnFailure (true )
0 commit comments