Mmuzaf commented on code in PR #3412:
URL: https://github.com/apache/cassandra/pull/3412#discussion_r1767010179
##########
src/java/org/apache/cassandra/db/virtual/SystemViewsKeyspace.java:
##########
@@ -28,6 +31,8 @@
public final class SystemViewsKeyspace extends VirtualKeyspace
{
+ public static final String STORAGE_OPERATIONS =
"storage_operations_history";
Review Comment:
Updated to the `compaction_operations_history`
##########
src/java/org/apache/cassandra/db/compaction/CompactionManager.java:
##########
@@ -2537,4 +2608,104 @@ public interface CompactionPauser extends AutoCloseable
{
public void close();
}
+
+ public static class OperationInfo
+ {
+ /** The unique id for this operation */
+ public final TimeUUID operationId = TimeUUID.Generator.nextTimeUUID();
+ /** The type of operation being performed */
+ public final OperationType operationType;
+ /** The keyspace names for which this operation is being performed */
+ public final Set<String> keyspaceNames = new ConcurrentSkipListSet<>();
+ /** The keyspace and table names for which this operation is being
performed */
+ public final Map<CFInfo, AllSSTableOpStatus> processedCfs = new
ConcurrentHashMap<>();
+ /** The number of sstables that have been completed for each keyspace
*/
+ public final Map<String, AtomicInteger> processedSStables = new
ConcurrentHashMap<>();
+ /** The final result of the operation */
+ private volatile AllSSTableOpStatus result;
+
+ private OperationInfo(OperationType operationType)
+ {
+ this.operationType = operationType;
+ }
+
+ private void markKeyspace(String keyspace)
+ {
+ keyspaceNames.add(keyspace);
+ processedSStables.computeIfAbsent(keyspace, k -> new
AtomicInteger());
+ }
+
+ private void tableProcessedStatus(String keyspace, String table,
AllSSTableOpStatus status)
+ {
+ processedCfs.putIfAbsent(new CFInfo(keyspace, table), status);
+ }
+
+ private void markTableProcessed(String keyspace)
+ {
+ processedSStables.computeIfAbsent(keyspace, k -> new
AtomicInteger()).incrementAndGet();
+ }
+
+ public AllSSTableOpStatus result()
+ {
+ return result;
+ }
+
+ public Map<CFInfo, AllSSTableOpStatus> processedCfs()
+ {
+ return processedCfs;
+ }
+
+ public Map<String, AtomicInteger> processedSStables()
Review Comment:
Fixed.
##########
src/java/org/apache/cassandra/db/compaction/CompactionManager.java:
##########
@@ -2537,4 +2608,104 @@ public interface CompactionPauser extends AutoCloseable
{
public void close();
}
+
+ public static class OperationInfo
+ {
+ /** The unique id for this operation */
+ public final TimeUUID operationId = TimeUUID.Generator.nextTimeUUID();
+ /** The type of operation being performed */
+ public final OperationType operationType;
+ /** The keyspace names for which this operation is being performed */
+ public final Set<String> keyspaceNames = new ConcurrentSkipListSet<>();
+ /** The keyspace and table names for which this operation is being
performed */
+ public final Map<CFInfo, AllSSTableOpStatus> processedCfs = new
ConcurrentHashMap<>();
+ /** The number of sstables that have been completed for each keyspace
*/
+ public final Map<String, AtomicInteger> processedSStables = new
ConcurrentHashMap<>();
Review Comment:
Fixed.
--
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]