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 2022/11/15 03:50:46 UTC

[GitHub] [cassandra] Maxwell-Guo commented on a diff in pull request #1998: sstabledump errors when dumping data from index for CASSANDRA-17698

Maxwell-Guo commented on code in PR #1998:
URL: https://github.com/apache/cassandra/pull/1998#discussion_r1022289287


##########
src/java/org/apache/cassandra/db/marshal/TypeParser.java:
##########
@@ -130,6 +138,73 @@ public AbstractType<?> parse() throws SyntaxException, ConfigurationException
             return getAbstractType(name);
     }
 
+
+    /**
+     * parse PartitionOrdering from old version of PartitionOrdering' string format 
+     * */
+    private static  AbstractType<?> defaultParsePartitionOrdering(TypeParser typeParser)
+    {
+        IPartitioner partitioner = DatabaseDescriptor.getPartitioner();
+        Iterator<String> argIterator = typeParser.getKeyValueParameters().keySet().iterator();
+        if (argIterator.hasNext()) {
+            partitioner = FBUtilities.newPartitioner(argIterator.next());
+            assert !argIterator.hasNext();
+        }
+        return partitioner.partitionOrdering();
+    }
+    
+    //the format is (partitioner:type)
+    public AbstractType<?> getPartitionerDefinedOrder()
+    {
+        if (isEOS())
+            return defaultParsePartitionOrdering(this);
+        skipBlank();
+        if (str.charAt(idx) != '(')
+            throw new IllegalStateException();
+        Pair<Boolean, AbstractType<?>>  result = null;
+        ++idx; // skipping '('
+
+        if (str.charAt(idx) == ')')
+        {
+            ++idx;
+            return  defaultParsePartitionOrdering(this);

Review Comment:
   just want to using the old format type parse of PartitionerDefinedOrder to do a double check parse. 
   if the string of type is %s(%s) 



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