abdullah alamoudi has submitted this change and it was merged.

Change subject: [NOISSUE][TEST] Make store and validate requests non cancellable
......................................................................


[NOISSUE][TEST] Make store and validate requests non cancellable

- user model changes: no
- storage format changes: no
- interface changes: no

details:
- Make store and validate requests non cancellable.

Change-Id: I722681d96f1b0de286dcf614ff15fc7aa625aadd
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2341
Reviewed-by: Murtadha Hubail <[email protected]>
Sonar-Qube: Jenkins <[email protected]>
Integration-Tests: Jenkins <[email protected]>
Tested-by: Jenkins <[email protected]>
---
M 
asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestExecutor.java
1 file changed, 7 insertions(+), 1 deletion(-)

Approvals:
  Anon. E. Moose #1000171: 
  Jenkins: Verified; No violations found; Verified
  Murtadha Hubail: Looks good to me, approved



diff --git 
a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestExecutor.java
 
b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestExecutor.java
index 9cce657..eeea05a 100644
--- 
a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestExecutor.java
+++ 
b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestExecutor.java
@@ -126,6 +126,8 @@
     private static final Pattern MAX_RESULT_READS_PATTERN =
             Pattern.compile("maxresultreads=(\\d+)(\\D|$)", Pattern.MULTILINE);
     public static final int TRUNCATE_THRESHOLD = 16384;
+    public static final Set<String> NON_CANCELLABLE =
+            Collections.unmodifiableSet(new HashSet<>(Arrays.asList("store", 
"validate")));
 
     public static final String DELIVERY_ASYNC = "async";
     public static final String DELIVERY_DEFERRED = "deferred";
@@ -1221,7 +1223,7 @@
             }
             final URI uri = getEndpoint(Servlets.QUERY_SERVICE);
             if (DELIVERY_IMMEDIATE.equals(delivery)) {
-                resultStream = executeQueryService(statement, fmt, uri, 
params, true, null, true);
+                resultStream = executeQueryService(statement, fmt, uri, 
params, true, null, isCancellable(reqType));
                 resultStream = METRICS_QUERY_TYPE.equals(reqType) ? 
ResultExtractor.extractMetrics(resultStream)
                         : ResultExtractor.extract(resultStream);
             } else {
@@ -1832,4 +1834,8 @@
             return target;
         }
     }
+
+    private static boolean isCancellable(String type) {
+        return !NON_CANCELLABLE.contains(type);
+    }
 }

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/2341
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I722681d96f1b0de286dcf614ff15fc7aa625aadd
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: abdullah alamoudi <[email protected]>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Jenkins <[email protected]>
Gerrit-Reviewer: Murtadha Hubail <[email protected]>
Gerrit-Reviewer: abdullah alamoudi <[email protected]>

Reply via email to