smiklosovic commented on code in PR #2047:
URL: https://github.com/apache/cassandra/pull/2047#discussion_r1067943179


##########
src/java/org/apache/cassandra/db/SystemKeyspaceMigrator41.java:
##########
@@ -159,10 +162,36 @@ static void migrateSSTableActivity()
                      })
         );
     }
+    
+    @VisibleForTesting
+    static void migrateCompactionHistory()
+    {
+        migrateTable(false,
+                     SystemKeyspace.COMPACTION_HISTORY,
+                     SystemKeyspace.COMPACTION_HISTORY,
+                     new String[]{ "id",
+                                   "bytes_in",
+                                   "bytes_out",
+                                   "columnfamily_name",
+                                   "compacted_at",
+                                   "keyspace_name",
+                                   "rows_merged",
+                                   "compaction_properties" },
+                     row -> Collections.singletonList(new Object[]{ 
row.getTimeUUID("id") ,
+                                                                    
row.has("bytes_in") ? row.getLong("bytes_in") : null,
+                                                                    
row.has("bytes_out") ? row.getLong("bytes_out") : null,
+                                                                    
row.has("columnfamily_name") ? row.getString("columnfamily_name") : null,
+                                                                    
row.has("compacted_at") ? row.getTimestamp("compacted_at") : null,
+                                                                    
row.has("keyspace_name") ? row.getString("keyspace_name") : null,
+                                                                    
row.has("rows_merged") ? row.getMap("rows_merged", Int32Type.instance, 
LongType.instance) : null,
+                                                                    
CompactionHistoryProperty.getCompactionHistroyProperties(row.getMap("compaction_properties",
 UTF8Type.instance, UTF8Type.instance))
+                     })
+        );
+    }
 
     /**
      * Perform table migration by reading data from the old table, converting 
it, and adding to the new table.
-     *
+     * if oldName and newName are same, means refresh data in table 

Review Comment:
   `If oldName and newName are same, it means refresh data in table.`



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