66public class GetAnalysisRequest {
77 private GetAnalysisKey key ;
88 private Integer severity ;
9- private boolean prioritized = false ;
10- private boolean legacy = true ;
9+ private boolean prioritized ;
10+ private boolean legacy ;
1111
1212 /**
1313 * @param bundleHash
1414 * @param limitToFiles list of filePath
1515 * @param severity
16+ * @param shard uniq String (hash) per Project to optimize jobs on backend (run on the same worker to reuse caches)
1617 * @param prioritized
1718 * @param legacy
1819 */
1920 public GetAnalysisRequest (
20- String bundleHash ,
21- List <String > limitToFiles ,
22- Integer severity ,
23- boolean prioritized ,
24- boolean legacy ) {
25- this .key = new GetAnalysisKey (bundleHash , limitToFiles );
21+ String bundleHash ,
22+ List <String > limitToFiles ,
23+ Integer severity ,
24+ String shard ,
25+ boolean prioritized ,
26+ boolean legacy
27+ ) {
28+ this .key = new GetAnalysisKey (bundleHash , limitToFiles , shard );
2629 this .severity = severity ;
2730 this .prioritized = prioritized ;
2831 this .legacy = legacy ;
2932 }
3033
31- public GetAnalysisRequest (String bundleHash , List <String > limitToFiles , Integer severity ) {
32- this (bundleHash , limitToFiles , severity , false , true );
34+ public GetAnalysisRequest (String bundleHash , List <String > limitToFiles , Integer severity , String shard ) {
35+ this (bundleHash , limitToFiles , severity , shard , false , true );
3336 }
3437
35- private class GetAnalysisKey {
36- private String type = "file" ;
37- private String hash ;
38- private List <String > limitToFiles ;
38+ private static class GetAnalysisKey {
39+ private final String type = "file" ;
40+ private final String hash ;
41+ private final List <String > limitToFiles ;
42+ private final String shard ;
3943
40- public GetAnalysisKey (String hash , List <String > limitToFiles ) {
41- this .type = type ;
44+ public GetAnalysisKey (String hash , List <String > limitToFiles , String shard ) {
4245 this .hash = hash ;
4346 this .limitToFiles = limitToFiles ;
47+ this .shard = shard ;
4448 }
4549
4650 public String getHash () {
@@ -51,6 +55,10 @@ public List<String> getLimitToFiles() {
5155 return limitToFiles ;
5256 }
5357
58+ public String getShard () {
59+ return shard ;
60+ }
61+
5462 @ Override
5563 public boolean equals (Object o ) {
5664 if (this == o ) return true ;
0 commit comments