@@ -54,7 +54,12 @@ public CompactionMetadata(Set<StoredTabletFile> jobFiles, ReferencedTabletFile c
54
54
this .priority = priority ;
55
55
this .cgid = Objects .requireNonNull (ceid );
56
56
this .propagateDeletes = propagateDeletes ;
57
- this .fateId = fateId ;
57
+ if (kind == CompactionKind .SYSTEM ) {
58
+ // its ok if this is null for system compactions because its not used.
59
+ this .fateId = fateId ;
60
+ } else {
61
+ this .fateId = Objects .requireNonNull (fateId );
62
+ }
58
63
}
59
64
60
65
public Set <StoredTabletFile > getJobFiles () {
@@ -112,7 +117,7 @@ public String toJson() {
112
117
jData .groupId = cgid .toString ();
113
118
jData .priority = priority ;
114
119
jData .propDels = propagateDeletes ;
115
- jData .fateId = fateId .canonical ();
120
+ jData .fateId = fateId == null ? null : fateId .canonical ();
116
121
return GSON .get ().toJson (jData );
117
122
}
118
123
@@ -122,7 +127,8 @@ public static CompactionMetadata fromJson(String json) {
122
127
return new CompactionMetadata (jData .inputs .stream ().map (StoredTabletFile ::new ).collect (toSet ()),
123
128
StoredTabletFile .of (jData .tmp ).getTabletFile (), jData .compactor ,
124
129
CompactionKind .valueOf (jData .kind ), jData .priority ,
125
- CompactorGroupIdImpl .groupId (jData .groupId ), jData .propDels , FateId .from (jData .fateId ));
130
+ CompactorGroupIdImpl .groupId (jData .groupId ), jData .propDels ,
131
+ jData .fateId == null ? null : FateId .from (jData .fateId ));
126
132
}
127
133
128
134
@ Override
0 commit comments