public synchronized ManagedChannel getDataChannel() { if (isStopped) { throw new IllegalStateException("Emulator is not running"); } if (dataChannel == null) { dataChannel = newChannelBuilder(port).maxInboundMessageSize(256 * 1024 * 1024).build(); } return dataChannel; }
private ManagedChannel createChannel(int port) { return ManagedChannelBuilder.forAddress("localhost", port) .usePlaintext() .maxInboundMessageSize(256 * 1024 * 1024) .build(); }
/** * Configures limits such as max message sizes that should be used by the channel. * * @param builder The channel builder to configure. * @param name The name of the client to configure. */ protected void configureLimits(final T builder, final String name) { final GrpcChannelProperties properties = getPropertiesFor(name); final Integer maxInboundMessageSize = properties.getMaxInboundMessageSize(); if (maxInboundMessageSize != null) { builder.maxInboundMessageSize(maxInboundMessageSize); } }
@Override public T maxInboundMessageSize(int max) { delegate().maxInboundMessageSize(max); return thisT(); }
@Override public T maxInboundMessageSize(int max) { delegate().maxInboundMessageSize(max); return thisT(); }
/** * Configures limits such as max message sizes that should be used by the channel. * * @param builder The channel builder to configure. * @param name The name of the client to configure. */ protected void configureLimits(final T builder, final String name) { final GrpcChannelProperties properties = getPropertiesFor(name); final Integer maxInboundMessageSize = properties.getMaxInboundMessageSize(); if (maxInboundMessageSize != null) { builder.maxInboundMessageSize(maxInboundMessageSize); } }
public InternalRpcConnection(String memberAddress, int internalServicePort) { this.memberAddress = memberAddress; this.internalServicePort = internalServicePort; ManagedChannelBuilder<?> managedChannelBuilder = ManagedChannelBuilder.forAddress(memberAddress, internalServicePort) .maxInboundMessageSize(256 * 1024 * 1024).usePlaintext(true); channel = managedChannelBuilder.build(); blockingStub = InternalServiceGrpc.newBlockingStub(channel); log.info("Connecting to <" + memberAddress + ":" + internalServicePort + ">"); }
public Node(String nodeKey, String address, int port) { super(); this.nodeKey = nodeKey; this.address = address; this.port = port; inBoundChannel = ManagedChannelBuilder.forAddress(address, port).usePlaintext(true) .maxInboundMessageSize(10 * 1024 * 1024).build(); }
private LoadtestGrpc.LoadtestStub getStub() { if (stubFactory != null) { return stubFactory.get(); } return LoadtestGrpc.newStub( ManagedChannelBuilder.forAddress(networkAddress, PORT) .usePlaintext(true) .maxInboundMessageSize(100000000) .build()); }
.idleTimeout(5L, TimeUnit.SECONDS) .keepAliveTime(30L, TimeUnit.SECONDS) .maxInboundMessageSize(MAX_MESSAGE_SIZE) .usePlaintext(true) .build();
.idleTimeout(5L, TimeUnit.SECONDS) .keepAliveTime(30L, TimeUnit.SECONDS) .maxInboundMessageSize(MAX_MESSAGE_SIZE) .usePlaintext(true) .build();
public void open(boolean compressedConnection) throws IOException { ManagedChannelBuilder<?> managedChannelBuilder = ManagedChannelBuilder.forAddress(member.getServerAddress(), member.getExternalPort()) .maxInboundMessageSize(256 * 1024 * 1024).usePlaintext(true); channel = managedChannelBuilder.build(); blockingStub = ExternalServiceGrpc.newBlockingStub(channel); if (compressedConnection) { blockingStub = blockingStub.withCompression("gzip"); } asyncStub = ExternalServiceGrpc.newStub(channel); if (compressedConnection) { asyncStub = asyncStub.withCompression("gzip"); } System.err.println("INFO: Connecting to <" + member.getServerAddress() + ">"); }
builder.maxInboundMessageSize(maxInboundMessageSize);
builder.maxInboundMessageSize(maxInboundMessageSize);
/** * <p>createNettyChannel.</p> * * @param host a {@link String} object. * @param options a {@link BigtableOptions} object. * @return a {@link ManagedChannel} object. * @throws SSLException if any. */ public static ManagedChannel createNettyChannel(String host, BigtableOptions options, ClientInterceptor ... interceptors) throws SSLException { // Ideally, this should be ManagedChannelBuilder.forAddress(...) rather than an explicit // call to NettyChannelBuilder. Unfortunately, that doesn't work for shaded artifacts. ManagedChannelBuilder<?> builder = ManagedChannelBuilder .forAddress(host, options.getPort()); if (options.usePlaintextNegotiation()) { // NOTE: usePlaintext(true) is deprecated in newer versions of grpc (1.11.0). // usePlantxext() is the preferred approach, but won't work with older versions. // This means that plaintext negotiation can't be used with Beam. builder.usePlaintext(); } return builder .idleTimeout(Long.MAX_VALUE, TimeUnit.SECONDS) .maxInboundMessageSize(MAX_MESSAGE_SIZE) .userAgent(BigtableVersionInfo.CORE_USER_AGENT + "," + options.getUserAgent()) .intercept(interceptors) .build(); }