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


##########
test/harry/main/org/apache/cassandra/harry/SchemaSpec.java:
##########
@@ -0,0 +1,374 @@
+/*
+ * 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;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.function.Consumer;
+import java.util.stream.Collectors;
+
+import accord.utils.Invariants;
+import org.apache.cassandra.cql3.ast.Symbol;
+import org.apache.cassandra.harry.gen.Generator;
+import org.apache.cassandra.harry.gen.Generators;
+import org.apache.cassandra.harry.gen.ValueGenerators;
+import org.apache.cassandra.harry.util.IteratorsUtil;
+import org.apache.cassandra.service.consensus.TransactionalMode;
+import org.apache.cassandra.utils.ByteArrayUtil;
+
+import static 
org.apache.cassandra.harry.SchemaSpec.Options.SKIP_WRITE_TIMESTAMPS;
+import static org.apache.cassandra.harry.SchemaSpec.Options.TRANSACTIONAL_MODE;
+import static org.apache.cassandra.harry.gen.InvertibleGenerator.MAX_ENTROPY;
+
+public class SchemaSpec
+{
+    public final String keyspace;
+    public final String table;
+
+    public final List<ColumnSpec<?>> partitionKeys;
+    public final List<ColumnSpec<?>> clusteringKeys;
+    public final List<ColumnSpec<?>> regularColumns;
+    public final List<ColumnSpec<?>> staticColumns;
+
+    public final List<ColumnSpec<?>> allColumnInSelectOrder;
+    public final ValueGenerators valueGenerators;
+    public final Map<Options, Object> options;

Review Comment:
   > One example of why fields were confusing is an introduction of boolean for 
write timestamps. 
   
   This got replaced with `Options.SKIP_WRITE_TIMESTAMPS`, which I find is far 
more confusing as the usage is `Object...`
   
   so the following does not do what I would expect
   
   ```
   new SchemaSpec(..., Options.SKIP_WRITE_TIMESTAMPS, false, ...
   ```
   
   I asked you to include the timestamp, but you drop them... because you don't 
*care* about the second value and only do an existence check... these are 
boolean options that *require* an argument that gets ignored... 
   
   The same issue exists for:
   
   ```
   Options.DISABLE_READ_REPAIR
   Options.COMPACT_STORAGE
   Options.TRACK_LTS
   Options.IF_NOT_EXISTS
   ```
   
   In order to *know* what is allowed, I have to go find the usage of each and 
reverse engineer what is allowed...  before I could use the type system...



-- 
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