Skip to content

Commit

Permalink
refactor(storagenode): rename jsontag of proto/snpb.(StorageNodeMetad…
Browse files Browse the repository at this point in the history
…ataDescriptor).LogStreamReplicas

This PR renames jsontag of `proto/snpb.(StorageNodeMetadataDescriptor).LogStreamReplicas` from
logStreams to logStreamReplicas. It is more explicit and correct naming.

Resolves #89.
  • Loading branch information
ijsong committed Oct 9, 2023
1 parent 02c83de commit b6ab649
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 56 deletions.
4 changes: 2 additions & 2 deletions bin/tests/test_start_varlogsn.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def test_parse_get_storagenode_without_logstreams_response(self):
snm = json.load(f)
self.assertIn("storageNodeId", snm)
self.assertIn("address", snm)
self.assertIn("logStreams", snm)
self.assertIsInstance(snm["logStreams"], list)
self.assertIn("logStreamReplicas", snm)
self.assertIsInstance(snm["logStreamReplicas"], list)


if __name__ == '__main__':
Expand Down
96 changes: 48 additions & 48 deletions proto/snpb/metadata.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions proto/snpb/metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ message StorageNodeMetadataDescriptor {
repeated varlogpb.StorageDescriptor storages = 3
[(gogoproto.nullable) = false];

// LogStreams are the list of metadata for log stream replicas.
// LogStreamReplicas are the list of metadata for log stream replicas.
repeated LogStreamReplicaMetadataDescriptor log_stream_replicas = 4
[(gogoproto.nullable) = false, (gogoproto.jsontag) = "logStreams"];
[(gogoproto.nullable) = false, (gogoproto.jsontag) = "logStreamReplicas"];

varlogpb.StorageNodeStatus status = 5;

Expand Down
2 changes: 1 addition & 1 deletion testdata/varlogctl/addstoragenode.0.golden.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"clusterId":1,"storageNodeId":1,"address":"127.0.0.1:10000","storages":[{"path":"/tmp1","used":32768,"total":1048576},{"path":"/tmp2","used":65536,"total":2097152}],"logStreams":[{"storageNodeId":1,"address":"127.0.0.1:10000","topicId":1,"logStreamId":1,"version":1,"globalHighWatermark":100,"localLowWatermark":{"llsn":1,"glsn":1},"localHighWatermark":{"llsn":51,"glsn":97},"path":"/tmp1/foo","storage_size_bytes":4096,"createdTime":"0001-01-01T00:00:00Z","updatedTime":"0001-01-01T00:00:00Z"}],"startTime":"2022-10-01T03:23:21Z","createTime":"2022-09-27T17:46:40Z","lastHeartbeatTime":"2022-11-01T11:37:19Z"}
{"clusterId":1,"storageNodeId":1,"address":"127.0.0.1:10000","storages":[{"path":"/tmp1","used":32768,"total":1048576},{"path":"/tmp2","used":65536,"total":2097152}],"logStreamReplicas":[{"storageNodeId":1,"address":"127.0.0.1:10000","topicId":1,"logStreamId":1,"version":1,"globalHighWatermark":100,"localLowWatermark":{"llsn":1,"glsn":1},"localHighWatermark":{"llsn":51,"glsn":97},"path":"/tmp1/foo","storage_size_bytes":4096,"createdTime":"0001-01-01T00:00:00Z","updatedTime":"0001-01-01T00:00:00Z"}],"startTime":"2022-10-01T03:23:21Z","createTime":"2022-09-27T17:46:40Z","lastHeartbeatTime":"2022-11-01T11:37:19Z"}
2 changes: 1 addition & 1 deletion testdata/varlogctl/getstoragenode.0.golden.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"clusterId":1,"storageNodeId":1,"address":"127.0.0.1:10000","storages":[{"path":"/tmp1","used":32768,"total":1048576},{"path":"/tmp2","used":65536,"total":2097152}],"logStreams":[{"storageNodeId":1,"address":"127.0.0.1:10000","topicId":1,"logStreamId":1,"version":1,"globalHighWatermark":100,"localLowWatermark":{"llsn":1,"glsn":1},"localHighWatermark":{"llsn":51,"glsn":97},"path":"/tmp1/foo","storage_size_bytes":4096,"createdTime":"0001-01-01T00:00:00Z","updatedTime":"0001-01-01T00:00:00Z"}],"startTime":"2022-10-01T03:23:21Z","createTime":"2022-09-27T17:46:40Z","lastHeartbeatTime":"2022-11-01T11:37:19Z"}
{"clusterId":1,"storageNodeId":1,"address":"127.0.0.1:10000","storages":[{"path":"/tmp1","used":32768,"total":1048576},{"path":"/tmp2","used":65536,"total":2097152}],"logStreamReplicas":[{"storageNodeId":1,"address":"127.0.0.1:10000","topicId":1,"logStreamId":1,"version":1,"globalHighWatermark":100,"localLowWatermark":{"llsn":1,"glsn":1},"localHighWatermark":{"llsn":51,"glsn":97},"path":"/tmp1/foo","storage_size_bytes":4096,"createdTime":"0001-01-01T00:00:00Z","updatedTime":"0001-01-01T00:00:00Z"}],"startTime":"2022-10-01T03:23:21Z","createTime":"2022-09-27T17:46:40Z","lastHeartbeatTime":"2022-11-01T11:37:19Z"}
2 changes: 1 addition & 1 deletion testdata/varlogctl/getstoragenode.1.golden.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"clusterId":1,"storageNodeId":1,"address":"127.0.0.1:10000","storages":[{"path":"/tmp1","used":32768,"total":1048576},{"path":"/tmp2","used":65536,"total":2097152}],"logStreams":[],"startTime":"2022-10-01T03:23:21Z","createTime":"2022-09-27T17:46:40Z","lastHeartbeatTime":"2022-11-01T11:37:19Z"}
{"clusterId":1,"storageNodeId":1,"address":"127.0.0.1:10000","storages":[{"path":"/tmp1","used":32768,"total":1048576},{"path":"/tmp2","used":65536,"total":2097152}],"logStreamReplicas":[],"startTime":"2022-10-01T03:23:21Z","createTime":"2022-09-27T17:46:40Z","lastHeartbeatTime":"2022-11-01T11:37:19Z"}
2 changes: 1 addition & 1 deletion testdata/varlogctl/liststoragenodes.1.golden.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"clusterId":1,"storageNodeId":1,"address":"127.0.0.1:10000","storages":[{"path":"/tmp1","used":32768,"total":1048576},{"path":"/tmp2","used":65536,"total":2097152}],"logStreams":[{"storageNodeId":1,"address":"127.0.0.1:10000","topicId":1,"logStreamId":1,"version":1,"globalHighWatermark":100,"localLowWatermark":{"llsn":1,"glsn":1},"localHighWatermark":{"llsn":51,"glsn":97},"path":"/tmp1/foo","storage_size_bytes":4096,"createdTime":"0001-01-01T00:00:00Z","updatedTime":"0001-01-01T00:00:00Z"}],"startTime":"2022-10-01T03:23:21Z","createTime":"2022-09-27T17:46:40Z","lastHeartbeatTime":"2022-11-01T11:37:19Z"}]
[{"clusterId":1,"storageNodeId":1,"address":"127.0.0.1:10000","storages":[{"path":"/tmp1","used":32768,"total":1048576},{"path":"/tmp2","used":65536,"total":2097152}],"logStreamReplicas":[{"storageNodeId":1,"address":"127.0.0.1:10000","topicId":1,"logStreamId":1,"version":1,"globalHighWatermark":100,"localLowWatermark":{"llsn":1,"glsn":1},"localHighWatermark":{"llsn":51,"glsn":97},"path":"/tmp1/foo","storage_size_bytes":4096,"createdTime":"0001-01-01T00:00:00Z","updatedTime":"0001-01-01T00:00:00Z"}],"startTime":"2022-10-01T03:23:21Z","createTime":"2022-09-27T17:46:40Z","lastHeartbeatTime":"2022-11-01T11:37:19Z"}]

0 comments on commit b6ab649

Please sign in to comment.