mirror of https://github.com/apache/cassandra
Merge bcd76eae43 into 8fda60880b
This commit is contained in:
commit
c700f93ae6
|
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
package org.apache.cassandra.db.virtual;
|
package org.apache.cassandra.db.virtual;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -133,9 +134,8 @@ public class MutationTrackingTables
|
||||||
.build());
|
.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())
|
for (Map.Entry<CoordinatorLogId, CoordinatorLog.DebugInfo> entry : shardDebugInfo.logs.entrySet())
|
||||||
{
|
{
|
||||||
CoordinatorLogId logId = entry.getKey();
|
CoordinatorLogId logId = entry.getKey();
|
||||||
|
|
@ -159,7 +159,7 @@ public class MutationTrackingTables
|
||||||
|
|
||||||
for (Shard shard : MutationTrackingService.instance().getShards())
|
for (Shard shard : MutationTrackingService.instance().getShards())
|
||||||
{
|
{
|
||||||
addShardRows(shard, result);
|
addShardRows(shard.getDebugInfo(), result);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
@ -170,16 +170,12 @@ public class MutationTrackingTables
|
||||||
{
|
{
|
||||||
String keyspaceName = UTF8Type.instance.compose(key.getKey());
|
String keyspaceName = UTF8Type.instance.compose(key.getKey());
|
||||||
SimpleDataSet result = new SimpleDataSet(metadata());
|
SimpleDataSet result = new SimpleDataSet(metadata());
|
||||||
|
|
||||||
for (Shard shard : MutationTrackingService.instance().getShards())
|
List<Shard> shards = new ArrayList<>();
|
||||||
{
|
MutationTrackingService.instance().forEachShardInKeyspace(keyspaceName, shards::add);
|
||||||
Shard.DebugInfo debugInfo = shard.getDebugInfo();
|
for (Shard shard : shards)
|
||||||
if (!debugInfo.keyspace.equals(keyspaceName))
|
addShardRows(shard.getDebugInfo(), result);
|
||||||
continue;
|
|
||||||
|
|
||||||
addShardRows(shard, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue