Skip to content

Commit

Permalink
Merge pull request kakao#214 from ijsong/change-indent
Browse files Browse the repository at this point in the history
style: use four-space indent size for go source files
  • Loading branch information
ijsong authored Nov 7, 2022
2 parents 34fed84 + 54b6b83 commit b25b869
Show file tree
Hide file tree
Showing 14 changed files with 111 additions and 148 deletions.
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ insert_final_newline = true
charset = utf-8

[*.go]
indent_style = tab
tab_width = 8
indent_style = space
indent_size = 4

[*.proto]
indent_style = space
Expand Down
1 change: 1 addition & 0 deletions cmd/rpc_test_server/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build rpc_e2e
// +build rpc_e2e

package main
Expand Down
2 changes: 1 addition & 1 deletion pkg/varlog/subscribe.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ func (p *transmitter) handleResult(r transmitResult) error {
var err error

/* NOTE Ignore transmitResult with GLSN less than p.wanted.
They can be delivered by subscribers that have not yet closed.
They can be delivered by subscribers that have not yet closed.
*/
if r.result.GLSN == types.InvalidGLSN {
err = p.handleError(r)
Expand Down
28 changes: 10 additions & 18 deletions proto/mrpb/management.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@ option (gogoproto.goproto_sizecache_all) = false;

message AddPeerRequest {
uint32 cluster_id = 1 [
(gogoproto.casttype) =
"github.com/kakao/varlog/pkg/types.ClusterID",
(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.ClusterID",
(gogoproto.customname) = "ClusterID"
];

uint64 node_id = 2 [
(gogoproto.casttype) =
"github.com/kakao/varlog/pkg/types.NodeID",
(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.NodeID",
(gogoproto.customname) = "NodeID"
];

Expand All @@ -32,22 +30,19 @@ message AddPeerRequest {

message RemovePeerRequest {
uint32 cluster_id = 1 [
(gogoproto.casttype) =
"github.com/kakao/varlog/pkg/types.ClusterID",
(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.ClusterID",
(gogoproto.customname) = "ClusterID"
];

uint64 node_id = 2 [
(gogoproto.casttype) =
"github.com/kakao/varlog/pkg/types.NodeID",
(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.NodeID",
(gogoproto.customname) = "NodeID"
];
}

message GetClusterInfoRequest {
uint32 cluster_id = 1 [
(gogoproto.casttype) =
"github.com/kakao/varlog/pkg/types.ClusterID",
(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.ClusterID",
(gogoproto.customname) = "ClusterID"
];
}
Expand All @@ -60,27 +55,24 @@ message ClusterInfo {
}

uint32 cluster_id = 1 [
(gogoproto.casttype) =
"github.com/kakao/varlog/pkg/types.ClusterID",
(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.ClusterID",
(gogoproto.customname) = "ClusterID",
(gogoproto.jsontag) = "clusterId"
];

uint64 node_id = 2 [
(gogoproto.casttype) =
"github.com/kakao/varlog/pkg/types.NodeID",
(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.NodeID",
(gogoproto.customname) = "NodeID",
(gogoproto.jsontag) = "nodeId"
];

uint64 leader = 3 [(gogoproto.casttype) =
"github.com/kakao/varlog/pkg/types.NodeID"];
uint64 leader = 3
[(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.NodeID"];

int32 replication_factor = 4 [(gogoproto.jsontag) = "replicationFactor"];

map<uint64, Member> members = 5
[(gogoproto.castkey) =
"github.com/kakao/varlog/pkg/types.NodeID"];
[(gogoproto.castkey) = "github.com/kakao/varlog/pkg/types.NodeID"];

// applied_index is the AppliedIndex of RAFT that is updated by changing
// configuration of members. For example, AddPeer and RemovePeer result in
Expand Down
17 changes: 6 additions & 11 deletions proto/mrpb/metadata_repository.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,11 @@ message LogStreamRequest {

message SealRequest {
uint32 cluster_id = 1 [
(gogoproto.casttype) =
"github.com/kakao/varlog/pkg/types.ClusterID",
(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.ClusterID",
(gogoproto.customname) = "ClusterID"
];
int32 log_stream_id = 2 [
(gogoproto.casttype) =
"github.com/kakao/varlog/pkg/types.LogStreamID",
(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.LogStreamID",
(gogoproto.customname) = "LogStreamID"
];
}
Expand All @@ -52,13 +50,11 @@ message SealResponse {

message UnsealRequest {
uint32 cluster_id = 1 [
(gogoproto.casttype) =
"github.com/kakao/varlog/pkg/types.ClusterID",
(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.ClusterID",
(gogoproto.customname) = "ClusterID"
];
int32 log_stream_id = 2 [
(gogoproto.casttype) =
"github.com/kakao/varlog/pkg/types.LogStreamID",
(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.LogStreamID",
(gogoproto.customname) = "LogStreamID"
];
}
Expand All @@ -69,16 +65,15 @@ message UnsealResponse {

message TopicRequest {
int32 topic_id = 1 [
(gogoproto.casttype) =
"github.com/kakao/varlog/pkg/types.TopicID",
(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.TopicID",
(gogoproto.customname) = "TopicID"
];
}

service MetadataRepositoryService {
rpc RegisterStorageNode(StorageNodeRequest) returns (google.protobuf.Empty) {}
rpc UnregisterStorageNode(StorageNodeRequest)
returns (google.protobuf.Empty) {}
returns (google.protobuf.Empty) {}
rpc RegisterTopic(TopicRequest) returns (google.protobuf.Empty) {}
rpc UnregisterTopic(TopicRequest) returns (google.protobuf.Empty) {}
rpc RegisterLogStream(LogStreamRequest) returns (google.protobuf.Empty) {}
Expand Down
42 changes: 15 additions & 27 deletions proto/mrpb/raft_entry.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,21 @@ message RegisterStorageNode {

message UnregisterStorageNode {
int32 storage_node_id = 1 [
(gogoproto.casttype) =
"github.com/kakao/varlog/pkg/types.StorageNodeID",
(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.StorageNodeID",
(gogoproto.customname) = "StorageNodeID"
];
}

message RegisterTopic {
int32 topic_id = 1 [
(gogoproto.casttype) =
"github.com/kakao/varlog/pkg/types.TopicID",
(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.TopicID",
(gogoproto.customname) = "TopicID"
];
}

message UnregisterTopic {
int32 topic_id = 1 [
(gogoproto.casttype) =
"github.com/kakao/varlog/pkg/types.TopicID",
(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.TopicID",
(gogoproto.customname) = "TopicID"
];
}
Expand All @@ -52,8 +49,7 @@ message RegisterLogStream {

message UnregisterLogStream {
int32 log_stream_id = 1 [
(gogoproto.casttype) =
"github.com/kakao/varlog/pkg/types.LogStreamID",
(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.LogStreamID",
(gogoproto.customname) = "LogStreamID"
];
}
Expand All @@ -64,55 +60,49 @@ message UpdateLogStream {

message Report {
int32 storage_node_id = 1 [
(gogoproto.casttype) =
"github.com/kakao/varlog/pkg/types.StorageNodeID",
(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.StorageNodeID",
(gogoproto.customname) = "StorageNodeID"
];
repeated snpb.LogStreamUncommitReport uncommit_report = 3
[(gogoproto.nullable) = false];
[(gogoproto.nullable) = false];
}

message Reports {
uint64 node_id = 1 [
(gogoproto.casttype) =
"github.com/kakao/varlog/pkg/types.NodeID",
(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.NodeID",
(gogoproto.customname) = "NodeID"
];
google.protobuf.Timestamp created_time = 2
[(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
[(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
repeated Report reports = 3;
}

message Commit {
uint64 node_id = 1 [
(gogoproto.casttype) =
"github.com/kakao/varlog/pkg/types.NodeID",
(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.NodeID",
(gogoproto.customname) = "NodeID"
];
google.protobuf.Timestamp created_time = 2
[(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
[(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
}

message Seal {
int32 log_stream_id = 1 [
(gogoproto.casttype) =
"github.com/kakao/varlog/pkg/types.LogStreamID",
(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.LogStreamID",
(gogoproto.customname) = "LogStreamID"
];
}

message Unseal {
int32 log_stream_id = 1 [
(gogoproto.casttype) =
"github.com/kakao/varlog/pkg/types.LogStreamID",
(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.LogStreamID",
(gogoproto.customname) = "LogStreamID"
];
}

message AddPeer {
uint64 node_id = 1 [
(gogoproto.casttype) =
"github.com/kakao/varlog/pkg/types.NodeID",
(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.NodeID",
(gogoproto.customname) = "NodeID"
];
string url = 2;
Expand All @@ -121,16 +111,14 @@ message AddPeer {

message RemovePeer {
uint64 node_id = 1 [
(gogoproto.casttype) =
"github.com/kakao/varlog/pkg/types.NodeID",
(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.NodeID",
(gogoproto.customname) = "NodeID"
];
}

message Endpoint {
uint64 node_id = 1 [
(gogoproto.casttype) =
"github.com/kakao/varlog/pkg/types.NodeID",
(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.NodeID",
(gogoproto.customname) = "NodeID"
];
string url = 2;
Expand Down
27 changes: 10 additions & 17 deletions proto/mrpb/raft_metadata_repository.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,25 @@ message LogStreamCommitResults {
option (gogoproto.equal) = true;

uint64 version = 1
[(gogoproto.casttype) =
"github.com/kakao/varlog/pkg/types.Version"];
[(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.Version"];
repeated snpb.LogStreamCommitResult commit_results = 3
[(gogoproto.nullable) = false];
[(gogoproto.nullable) = false];
}

message StorageNodeUncommitReport {
int32 storage_node_id = 1 [
(gogoproto.casttype) =
"github.com/kakao/varlog/pkg/types.StorageNodeID",
(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.StorageNodeID",
(gogoproto.customname) = "StorageNodeID"
];
repeated snpb.LogStreamUncommitReport uncommit_reports = 2
[(gogoproto.nullable) = false];
[(gogoproto.nullable) = false];
}

message LogStreamUncommitReports {
option (gogoproto.equal) = true;

map<int32, snpb.LogStreamUncommitReport> replicas = 1 [
(gogoproto.castkey) =
"github.com/kakao/varlog/pkg/types.StorageNodeID",
(gogoproto.castkey) = "github.com/kakao/varlog/pkg/types.StorageNodeID",
(gogoproto.nullable) = false
];
varlogpb.LogStreamStatus status = 2;
Expand All @@ -50,13 +47,11 @@ message LogStreamUncommitReports {
message MetadataRepositoryDescriptor {
message LogStreamDescriptor {
uint64 trim_version = 1
[(gogoproto.casttype) =
"github.com/kakao/varlog/pkg/types.Version"];
[(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.Version"];
repeated LogStreamCommitResults commit_history = 2
[(gogoproto.nullable) = true];
[(gogoproto.nullable) = true];
map<int32, LogStreamUncommitReports> uncommit_reports = 3
[(gogoproto.castkey) =
"github.com/kakao/varlog/pkg/types.LogStreamID"];
[(gogoproto.castkey) = "github.com/kakao/varlog/pkg/types.LogStreamID"];
}

message PeerDescriptor {
Expand All @@ -66,8 +61,7 @@ message MetadataRepositoryDescriptor {

message PeerDescriptorMap {
map<uint64, PeerDescriptor> peers = 1
[(gogoproto.castkey) =
"github.com/kakao/varlog/pkg/types.NodeID"];
[(gogoproto.castkey) = "github.com/kakao/varlog/pkg/types.NodeID"];
// applied_index is the AppliedIndex of RAFT that is updated by changing
// configuration of members. For example, AddPeer and RemovePeer result
// in increasing applied_index.
Expand All @@ -78,6 +72,5 @@ message MetadataRepositoryDescriptor {
LogStreamDescriptor log_stream = 2 [(gogoproto.nullable) = true];
PeerDescriptorMap peers_map = 3 [(gogoproto.nullable) = false];
map<uint64, string> endpoints = 4
[(gogoproto.castkey) =
"github.com/kakao/varlog/pkg/types.NodeID"];
[(gogoproto.castkey) = "github.com/kakao/varlog/pkg/types.NodeID"];
}
8 changes: 4 additions & 4 deletions proto/snpb/log_io.proto
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ message LogStreamMetadataRequest {

message LogStreamMetadataResponse {
varlogpb.LogStreamDescriptor log_stream_descriptor = 1
[(gogoproto.nullable) = false];
[(gogoproto.nullable) = false];
}

message LogStreamReplicaMetadataRequest {
Expand All @@ -172,7 +172,7 @@ message LogStreamReplicaMetadataRequest {

message LogStreamReplicaMetadataResponse {
LogStreamReplicaMetadataDescriptor log_stream_replica = 1
[(gogoproto.nullable) = false];
[(gogoproto.nullable) = false];
}

service LogIO {
Expand All @@ -182,7 +182,7 @@ service LogIO {
rpc SubscribeTo(SubscribeToRequest) returns (stream SubscribeToResponse) {}
rpc TrimDeprecated(TrimDeprecatedRequest) returns (google.protobuf.Empty) {}
rpc LogStreamReplicaMetadata(LogStreamReplicaMetadataRequest)
returns (LogStreamReplicaMetadataResponse) {}
returns (LogStreamReplicaMetadataResponse) {}
rpc LogStreamMetadata(LogStreamMetadataRequest)
returns (LogStreamMetadataResponse) {}
returns (LogStreamMetadataResponse) {}
}
Loading

0 comments on commit b25b869

Please sign in to comment.