ifesdjeen commented on code in PR #3689:
URL: https://github.com/apache/cassandra/pull/3689#discussion_r1849986819


##########
test/harry/main/org/apache/cassandra/harry/execution/CQLVisitExecutor.java:
##########
@@ -0,0 +1,143 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.harry.execution;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import accord.utils.Invariants;
+import org.apache.cassandra.harry.SchemaSpec;
+import org.apache.cassandra.harry.op.Visit;
+import org.apache.cassandra.harry.op.Operations;
+import org.apache.cassandra.harry.model.Model;
+
+/**
+ *
+ * TODO: Transactional results ; LET
+ */
+public abstract class CQLVisitExecutor
+{
+    private static final Logger logger = 
LoggerFactory.getLogger(QueryBuildingVisitExecutor.class);
+    protected final SchemaSpec schema;
+
+    protected final DataTracker dataTracker;
+    protected final Model model;
+    private final QueryBuildingVisitExecutor queryBuilder;
+
+    public CQLVisitExecutor(SchemaSpec schema, DataTracker dataTracker, Model 
model, QueryBuildingVisitExecutor queryBuilder)
+    {
+        this.schema = schema;
+        this.dataTracker = dataTracker;
+        this.model = model;
+        this.queryBuilder = queryBuilder;
+    }
+
+    public static void replay(CQLVisitExecutor executor, Model.Replay replay)
+    {
+        for (Visit visit : replay)
+            executeVisit(visit, executor, replay);
+    }
+
+    public static void executeVisit(Visit visit, CQLVisitExecutor executor, 
Model.Replay replay)
+    {
+        try
+        {
+            executor.execute(visit);
+        }
+        catch (Throwable t)
+        {
+            // Existing issues
+            if (t.getMessage() != null && t.getMessage().contains("class 
org.apache.cassandra.db.ReadQuery$1 cannot be cast to class 
org.apache.cassandra.db.SinglePartitionReadQuery$Group"))
+                return;

Review Comment:
   If I remove this, test will be constantly failing. And fixing this test is 
outside of scope of this patch. We have to leave it in, otherwise these tests 
are sort of useless.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to