Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package org.apache.cassandra.db.virtual;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
Expand Down Expand Up @@ -133,9 +134,8 @@ public static class MutationTrackingShardsTable extends AbstractVirtualTable
.build());
}

private void addShardRows(Shard shard, SimpleDataSet result)
private void addShardRows(Shard.DebugInfo shardDebugInfo, SimpleDataSet result)
{
Shard.DebugInfo shardDebugInfo = shard.getDebugInfo();
for (Map.Entry<CoordinatorLogId, CoordinatorLog.DebugInfo> entry : shardDebugInfo.logs.entrySet())
{
CoordinatorLogId logId = entry.getKey();
Expand All @@ -159,7 +159,7 @@ public DataSet data()

for (Shard shard : MutationTrackingService.instance().getShards())
{
addShardRows(shard, result);
addShardRows(shard.getDebugInfo(), result);
}

return result;
Expand All @@ -170,16 +170,12 @@ public DataSet data(DecoratedKey key)
{
String keyspaceName = UTF8Type.instance.compose(key.getKey());
SimpleDataSet result = new SimpleDataSet(metadata());

for (Shard shard : MutationTrackingService.instance().getShards())
{
Shard.DebugInfo debugInfo = shard.getDebugInfo();
if (!debugInfo.keyspace.equals(keyspaceName))
continue;

addShardRows(shard, result);
}


List<Shard> shards = new ArrayList<>();
MutationTrackingService.instance().forEachShardInKeyspace(keyspaceName, shards::add);
for (Shard shard : shards)
addShardRows(shard.getDebugInfo(), result);

return result;
}
}
Expand Down