You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2020/02/25 18:03:49 UTC

[GitHub] [cassandra] ifesdjeen commented on a change in pull request #446: CASSANDRA-15564 Refactor repair coordinator to centralize stage change logic and improved the public facing errors

ifesdjeen commented on a change in pull request #446: CASSANDRA-15564 Refactor repair coordinator to centralize stage change logic and improved the public facing errors
URL: https://github.com/apache/cassandra/pull/446#discussion_r383808940
 
 

 ##########
 File path: test/distributed/org/apache/cassandra/distributed/api/Row.java
 ##########
 @@ -0,0 +1,93 @@
+/*
+ * 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.distributed.api;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import java.util.UUID;
+import javax.annotation.Nullable;
+
+public class Row
+{
+    private final String[] names;
+    @Nullable private Object[] results; // mutable to avoid allocations in loops
+
+    public Row(String[] names)
+    {
+        this.names = names;
+    }
+
+    void setResults(@Nullable Object[] results)
+    {
+        this.results = results;
+    }
+
+    public <T> T get(String name)
+    {
+        checkAccess();
+        int idx = findIndex(name);
 
 Review comment:
   Shouold we use hashmap? Main reason is when we're using it with something like Harry, where we're doing quite a few queries, and big-Oh can start to matter.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org