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/10/20 16:52:38 UTC

[GitHub] [cassandra] ifesdjeen opened a new pull request #785: Bring back (relevant) parts of compact storage

ifesdjeen opened a new pull request #785:
URL: https://github.com/apache/cassandra/pull/785


   Patch by Alex Petrov; reviewed by TBD for CASSANDRA-13994


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



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


[GitHub] [cassandra] krummas commented on a change in pull request #785: Bring back (relevant) parts of compact storage

Posted by GitBox <gi...@apache.org>.
krummas commented on a change in pull request #785:
URL: https://github.com/apache/cassandra/pull/785#discussion_r520398929



##########
File path: src/java/org/apache/cassandra/service/pager/PagingState.java
##########
@@ -360,7 +360,8 @@ public static RowMark create(TableMetadata metadata, Row row, ProtocolVersion pr
                 if (!cells.hasNext())

Review comment:
       Should we remove the `ProtocolVersion.V3`-special logic in this file? (a few things from 13994 was not re-added, I guess because we don't need V3 support?) Totally fine doing that in a separate ticket though

##########
File path: src/java/org/apache/cassandra/schema/TableMetadata.java
##########
@@ -1279,4 +1330,194 @@ private void appendDropColumns(CqlBuilder builder)
             }
         }
     }
+
+    public static class CompactTableMetadata extends TableMetadata
+    {
+
+        /*
+         * For dense tables, this alias the single non-PK column the table contains (since it can only have one). We keep
+         * that as convenience to access that column more easily (but we could replace calls by regularAndStaticColumns().iterator().next()
+         * for those tables in practice).
+         */
+        public final ColumnMetadata compactValueColumn;
+
+        private final Set<ColumnMetadata> hiddenColumns;
+        protected CompactTableMetadata(Builder builder)
+        {
+            super(builder);
+
+            compactValueColumn = getCompactValueColumn(regularAndStaticColumns);
+
+            if (isCompactTable() && Flag.isDense(this.flags) && hasEmptyCompactValue())
+            {
+                hiddenColumns = Collections.singleton(compactValueColumn);
+            }
+            else if (isCompactTable() && !Flag.isDense(this.flags))
+            {
+                hiddenColumns = Sets.newHashSetWithExpectedSize(clusteringColumns.size() + 1);
+                hiddenColumns.add(compactValueColumn);
+                hiddenColumns.addAll(clusteringColumns);
+
+            }
+            else
+            {
+                hiddenColumns = Collections.emptySet();
+            }
+        }
+
+        @Override
+        public boolean isCompactTable()
+        {
+            return true;
+        }
+
+        public ColumnMetadata getExistingColumn(ColumnIdentifier name)
+        {
+            ColumnMetadata def = getColumn(name);
+            if (def == null || isHiddenColumn(def))
+                throw new InvalidRequestException(format("Undefined column name %s in table %s", name.toCQLString(), this));
+            return def;
+        }
+
+        public boolean isHiddenColumn(ColumnMetadata def)
+        {
+            return hiddenColumns.contains(def);
+        }
+
+        @Override
+        public Iterator<ColumnMetadata> allColumnsInSelectOrder()
+        {
+            boolean isStaticCompactTable = isStaticCompactTable();
+            boolean noNonPkColumns = hasEmptyCompactValue();
+
+            Iterator<ColumnMetadata> partitionKeyIter = partitionKeyColumns.iterator();
+            Iterator<ColumnMetadata> clusteringIter =
+            isStaticCompactTable ? Collections.emptyIterator() : clusteringColumns.iterator();
+            Iterator<ColumnMetadata> otherColumns =
+            noNonPkColumns

Review comment:
       nit: a bit weird indentation in this method




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



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


[GitHub] [cassandra] smiklosovic closed pull request #785: Bring back (relevant) parts of compact storage

Posted by GitBox <gi...@apache.org>.
smiklosovic closed pull request #785:
URL: https://github.com/apache/cassandra/pull/785


   


-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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