Skip to content

Commit

Permalink
move channelz back to the abstract class
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiitk committed Aug 31, 2020
1 parent 1270459 commit a9782a4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ final List<? extends ServerStreamTracer.Factory> getTracerFactories() {
return Collections.unmodifiableList(tracerFactories);
}

protected final InternalChannelz getChannelz() {
protected InternalChannelz getChannelz() {
return channelz;
}

Expand Down
6 changes: 6 additions & 0 deletions core/src/main/java/io/grpc/internal/ServerImplBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import com.google.common.base.Preconditions;
import io.grpc.Deadline;
import io.grpc.InternalChannelz;
import io.grpc.ServerBuilder;
import io.grpc.ServerStreamTracer;
import java.io.File;
Expand Down Expand Up @@ -85,6 +86,11 @@ public void setStatsRecordRealTimeMetrics(boolean value) {
super.setStatsRecordRealTimeMetrics(value);
}

@Override
public InternalChannelz getChannelz() {
return super.getChannelz();
}

@Override
public ObjectPool<? extends Executor> getExecutorPool() {
return super.getExecutorPool();
Expand Down
5 changes: 1 addition & 4 deletions netty/src/main/java/io/grpc/netty/NettyServerBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import io.grpc.ExperimentalApi;
import io.grpc.ForwardingServerBuilder;
import io.grpc.Internal;
import io.grpc.InternalChannelz;
import io.grpc.ServerBuilder;
import io.grpc.ServerStreamTracer;
import io.grpc.internal.FixedObjectPool;
Expand Down Expand Up @@ -90,8 +89,6 @@ public final class NettyServerBuilder extends ForwardingServerBuilder<NettyServe
private final List<SocketAddress> listenAddresses = new ArrayList<>();

private TransportTracer.Factory transportTracerFactory = TransportTracer.getDefaultFactory();
private InternalChannelz channelz = InternalChannelz.instance();

private ChannelFactory<? extends ServerChannel> channelFactory =
Utils.DEFAULT_SERVER_CHANNEL_FACTORY;
private final Map<ChannelOption<?>, Object> channelOptions = new HashMap<>();
Expand Down Expand Up @@ -606,7 +603,7 @@ List<NettyServer> buildTransportServers(
keepAliveTimeInNanos, keepAliveTimeoutInNanos,
maxConnectionIdleInNanos, maxConnectionAgeInNanos,
maxConnectionAgeGraceInNanos, permitKeepAliveWithoutCalls, permitKeepAliveTimeInNanos,
channelz);
this.serverImplBuilder.getChannelz());
transportServers.add(transportServer);
}
return Collections.unmodifiableList(transportServers);
Expand Down

0 comments on commit a9782a4

Please sign in to comment.