Skip to content

Commit af16ac7

Browse files
committed
Add track failure option parameter in rest server
1 parent 4236dd6 commit af16ac7

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/main/java/RestServer/TaskRequest.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,9 @@ public class TaskRequest {
242242
private boolean mongoIsAtlas;
243243
private ArrayList<MongoSDKClient> mongoClients;
244244

245+
@JsonProperty("track_failures")
246+
private boolean trackFailures;
247+
245248
private boolean validate_doc_load_params() {
246249
if (this.bucketName == null && this.mongoBucketName == null)
247250
return false;
@@ -346,6 +349,7 @@ private void log_request() {
346349
System.out.println("mongo_bucket_name: " + mongoBucketName);
347350
System.out.println("mongo_collection_name: " + mongoCollectionName);
348351
System.out.println("mongo_is_atlas: " + mongoIsAtlas);
352+
System.out.println("track_failures: " + trackFailures);
349353
}
350354

351355
public ResponseEntity<Map<String, Object>> create_clients() {
@@ -671,15 +675,14 @@ public ResponseEntity<Map<String, Object>> doc_load() {
671675
}
672676
}
673677

674-
boolean trackFailures = true;
675678
ArrayList<String> task_names = new ArrayList<String>();
676679
String task_name = "Task_" + TaskRequest.task_id.incrementAndGet();
677680
int retry = 0;
678681
for (int i = 0; i < ws.workers; i++) {
679682
String th_name = task_name + "_" + i;
680683
WorkLoadGenerate wlg = new WorkLoadGenerate(th_name, dg, TaskRequest.SDKClientPool, esClient,
681684
this.durabilityLevel,
682-
this.docTTL, this.docTTLUnit, trackFailures,
685+
this.docTTL, this.docTTLUnit, this.trackFailures,
683686
retry, null);
684687
wlg.set_collection_for_load(this.bucketName, this.scopeName, this.collectionName);
685688
TaskRequest.loader_tasks.put(th_name, wlg);
@@ -846,14 +849,13 @@ public ResponseEntity<Map<String, Object>> loadSIFTDataset() throws IOException
846849
return new ResponseEntity<>(body, HttpStatus.BAD_REQUEST);
847850
}
848851

849-
boolean trackFailures = true;
850852
String task_name = "Task_" + TaskRequest.task_id.incrementAndGet() + k + "_" + ws.dr.create_s + "_"
851853
+ ws.dr.create_e;
852854
int retry = 0;
853855
String th_name = task_name + "_" + i;
854856
WorkLoadGenerate wlg = new WorkLoadGenerate(th_name, dg, TaskRequest.SDKClientPool, esClient,
855857
this.durabilityLevel,
856-
this.docTTL, this.docTTLUnit, trackFailures, retry, null);
858+
this.docTTL, this.docTTLUnit, this.trackFailures, retry, null);
857859
wlg.set_collection_for_load(this.bucketName, this.scopeName, this.collectionName);
858860
TaskRequest.loader_tasks.put(th_name, wlg);
859861
task_names.add(th_name);

0 commit comments

Comments
 (0)