Skip to content

Commit d6ded8c

Browse files
authored
Set Generic Services option to true (#121)
## What is the goal of this PR? This pull request sets the generic services Java option to true in order to be able to automatically generate the content of the grakn.proto file with the Protobuf.jl Julia package. The [Julia code generator](https://github.com/JuliaIO/ProtoBuf.jl) generates code for generic services if they are switched on for either C++ (cc_generic_services), Python (py_generic_services) or Java (java_generic_services). Without this option set to true, the file cannot be generated. We added the required option into the grakn.proto file as described in the instructions of the Protobuf.jl package [here](https://github.com/JuliaIO/ProtoBuf.jl/blob/master/PROTOC.md#generic-services). It's also described here in the [protobuf language reference](https://developers.google.com/protocol-buffers/docs/reference/java-generated#service). ## What are the changes implemented in this PR? We added the following line `option java_generic_services = true;` into the grakn.proto file. This is the best way because otherwise, we would need to add this option manually or for example with a script, before generating our Julia code files with the Julia code generator. Such a script could break in the future and add further workload for maintenance. It seems to be better to fix this at the source. Another option may be ([derived from the docs](https://developers.google.com/protocol-buffers/docs/reference/java-generated#service)) to rewrite/rethink the grakn.proto code and tie it to one system, as generic services are deprecated and might infer with plugins at some point. This solves the issue described here #JuliaIO/ProtoBuf.jl#165
1 parent 32b9899 commit d6ded8c

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

cluster/cluster_service.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ syntax = "proto3";
1919

2020
option java_package = "grakn.protocol";
2121
option java_outer_classname = "ClusterServiceProto";
22+
option java_generic_services = true;
2223

2324
import "cluster/cluster_server.proto";
2425
import "cluster/cluster_database.proto";

core/core_service.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ syntax = "proto3";
1919

2020
option java_package = "grakn.protocol";
2121
option java_outer_classname = "CoreServiceProto";
22+
option java_generic_services = true;
2223

2324
import "core/core_database.proto";
2425
import "common/session.proto";

0 commit comments

Comments
 (0)