Skip to content

Commit c04e9ed

Browse files
committed
Rename repositoryThrottlingStats -> repositorySnapshotStats
1 parent ac2a2a3 commit c04e9ed

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

server/src/internalClusterTest/java/org/elasticsearch/snapshots/RepositorySnapshotStatsIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ public void testRepositorySnapshotStats() {
7676
RepositoriesStats stats = response.getNodes().get(0).getRepositoriesStats();
7777

7878
// These are just broad sanity checks on the values. There are more detailed checks in SnapshotMetricsIT
79-
assertTrue(stats.getRepositoryThrottlingStats().containsKey("test-repo"));
80-
RepositoriesStats.SnapshotStats snapshotStats = stats.getRepositoryThrottlingStats().get("test-repo");
79+
assertTrue(stats.getRepositorySnapshotStats().containsKey("test-repo"));
80+
RepositoriesStats.SnapshotStats snapshotStats = stats.getRepositorySnapshotStats().get("test-repo");
8181
assertThat(snapshotStats.totalWriteThrottledNanos(), greaterThan(0L));
8282
assertThat(snapshotStats.totalReadThrottledNanos(), greaterThan(0L));
8383
assertThat(snapshotStats.shardSnapshotsStarted(), equalTo((long) numberOfShards));

server/src/main/java/org/elasticsearch/repositories/RepositoriesStats.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,35 +27,35 @@
2727

2828
public class RepositoriesStats implements Writeable, ToXContentFragment {
2929

30-
private final Map<String, SnapshotStats> repositoryThrottlingStats;
30+
private final Map<String, SnapshotStats> repositorySnapshotStats;
3131

3232
public RepositoriesStats(StreamInput in) throws IOException {
3333
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_9_X)) {
34-
repositoryThrottlingStats = in.readMap(SnapshotStats::readFrom);
34+
repositorySnapshotStats = in.readMap(SnapshotStats::readFrom);
3535
} else {
36-
repositoryThrottlingStats = new HashMap<>();
36+
repositorySnapshotStats = new HashMap<>();
3737
}
3838
}
3939

40-
public RepositoriesStats(Map<String, SnapshotStats> repositoryThrottlingStats) {
41-
this.repositoryThrottlingStats = new HashMap<>(repositoryThrottlingStats);
40+
public RepositoriesStats(Map<String, SnapshotStats> repositorySnapshotStats) {
41+
this.repositorySnapshotStats = new HashMap<>(repositorySnapshotStats);
4242
}
4343

4444
@Override
4545
public void writeTo(StreamOutput out) throws IOException {
4646
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_9_X)) {
47-
out.writeMap(repositoryThrottlingStats, StreamOutput::writeWriteable);
47+
out.writeMap(repositorySnapshotStats, StreamOutput::writeWriteable);
4848
}
4949
}
5050

5151
@Override
5252
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
53-
builder.field("repositories", repositoryThrottlingStats);
53+
builder.field("repositories", repositorySnapshotStats);
5454
return builder;
5555
}
5656

57-
public Map<String, SnapshotStats> getRepositoryThrottlingStats() {
58-
return Collections.unmodifiableMap(repositoryThrottlingStats);
57+
public Map<String, SnapshotStats> getRepositorySnapshotStats() {
58+
return Collections.unmodifiableMap(repositorySnapshotStats);
5959
}
6060

6161
public record SnapshotStats(

server/src/test/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStatsTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,9 +469,9 @@ public void testSerialization() throws IOException {
469469
}
470470

471471
RepositoriesStats repoThrottlingStats = deserializedNodeStats.getRepositoriesStats();
472-
assertTrue(repoThrottlingStats.getRepositoryThrottlingStats().containsKey("test-repository"));
473-
assertEquals(100, repoThrottlingStats.getRepositoryThrottlingStats().get("test-repository").totalReadThrottledNanos());
474-
assertEquals(200, repoThrottlingStats.getRepositoryThrottlingStats().get("test-repository").totalWriteThrottledNanos());
472+
assertTrue(repoThrottlingStats.getRepositorySnapshotStats().containsKey("test-repository"));
473+
assertEquals(100, repoThrottlingStats.getRepositorySnapshotStats().get("test-repository").totalReadThrottledNanos());
474+
assertEquals(200, repoThrottlingStats.getRepositorySnapshotStats().get("test-repository").totalWriteThrottledNanos());
475475

476476
}
477477
}

server/src/test/java/org/elasticsearch/repositories/RepositoriesServiceTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,8 @@ public void testRepositoriesThrottlingStats() {
378378
var clusterState = createClusterStateWithRepo(repoName, TestRepository.TYPE);
379379
repositoriesService.applyClusterState(new ClusterChangedEvent("put test repository", clusterState, emptyState()));
380380
RepositoriesStats throttlingStats = repositoriesService.getRepositoriesThrottlingStats();
381-
assertTrue(throttlingStats.getRepositoryThrottlingStats().containsKey(repoName));
382-
assertNotNull(throttlingStats.getRepositoryThrottlingStats().get(repoName));
381+
assertTrue(throttlingStats.getRepositorySnapshotStats().containsKey(repoName));
382+
assertNotNull(throttlingStats.getRepositorySnapshotStats().get(repoName));
383383
}
384384

385385
// InvalidRepository is created when current node is non-master node and failed to create repository by applying cluster state from

0 commit comments

Comments
 (0)