@@ -32,7 +32,7 @@ public Server(SideInputRetriever sideInputRetriever) {
32
32
/**
33
33
* constructor to create gRPC server with gRPC config.
34
34
*
35
- * @param grpcConfig to configure the max message size for grpc
35
+ * @param grpcConfig to configure the max message size for grpc
36
36
* @param sideInputRetriever to retrieve the side input
37
37
*/
38
38
public Server (SideInputRetriever sideInputRetriever , GRPCConfig grpcConfig ) {
@@ -41,7 +41,8 @@ public Server(SideInputRetriever sideInputRetriever, GRPCConfig grpcConfig) {
41
41
}
42
42
43
43
@ VisibleForTesting
44
- protected Server (GRPCConfig grpcConfig , SideInputRetriever service , ServerInterceptor interceptor , String serverName ) {
44
+ protected Server (GRPCConfig grpcConfig , SideInputRetriever service , ServerInterceptor interceptor ,
45
+ String serverName ) {
45
46
this .grpcConfig = grpcConfig ;
46
47
this .server = new GrpcServerWrapper (
47
48
interceptor ,
@@ -67,8 +68,7 @@ public void start() throws Exception {
67
68
68
69
log .info (
69
70
"server started, listening on {}" ,
70
- this .grpcConfig .isLocal () ?
71
- "localhost:" + this .grpcConfig .getPort () : this .grpcConfig .getSocketPath ());
71
+ this .grpcConfig .isLocal () ? "localhost:" + this .grpcConfig .getPort () : this .grpcConfig .getSocketPath ());
72
72
73
73
// register shutdown hook to gracefully shut down the server
74
74
Runtime .getRuntime ().addShutdownHook (new Thread (() -> {
@@ -83,11 +83,14 @@ public void start() throws Exception {
83
83
}
84
84
85
85
/**
86
- * Blocks until the server has terminated. If the server is already terminated, this method
87
- * will return immediately. If the server is not yet terminated, this method will block the
86
+ * Blocks until the server has terminated. If the server is already terminated,
87
+ * this method
88
+ * will return immediately. If the server is not yet terminated, this method
89
+ * will block the
88
90
* calling thread until the server has terminated.
89
91
*
90
- * @throws InterruptedException if the current thread is interrupted while waiting
92
+ * @throws InterruptedException if the current thread is interrupted while
93
+ * waiting
91
94
*/
92
95
public void awaitTermination () throws InterruptedException {
93
96
log .info ("side input server is waiting for termination" );
@@ -96,7 +99,8 @@ public void awaitTermination() throws InterruptedException {
96
99
}
97
100
98
101
/**
99
- * Stop serving requests and shutdown resources. Await termination on the main thread since the
102
+ * Stop serving requests and shutdown resources. Await termination on the main
103
+ * thread since the
100
104
* grpc library uses daemon threads.
101
105
*
102
106
* @throws InterruptedException if shutdown is interrupted
0 commit comments