mirror of https://github.com/grpc/grpc-java.git
core: remove 2 suffix from streams
This commit is contained in:
parent
7b821a0e50
commit
ee38b3754e
|
|
@ -46,10 +46,10 @@ import javax.annotation.Nullable;
|
||||||
* implement {@link #transportState()} and {@link #abstractClientStreamSink()}. Must only be called
|
* implement {@link #transportState()} and {@link #abstractClientStreamSink()}. Must only be called
|
||||||
* from the sending application thread.
|
* from the sending application thread.
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractClientStream2 extends AbstractStream2
|
public abstract class AbstractClientStream extends AbstractStream
|
||||||
implements ClientStream, MessageFramer.Sink {
|
implements ClientStream, MessageFramer.Sink {
|
||||||
|
|
||||||
private static final Logger log = Logger.getLogger(AbstractClientStream2.class.getName());
|
private static final Logger log = Logger.getLogger(AbstractClientStream.class.getName());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A sink for outbound operations, separated from the stream simply to avoid name
|
* A sink for outbound operations, separated from the stream simply to avoid name
|
||||||
|
|
@ -88,7 +88,7 @@ public abstract class AbstractClientStream2 extends AbstractStream2
|
||||||
* multiple times and from any thread.
|
* multiple times and from any thread.
|
||||||
*
|
*
|
||||||
* <p>This is a clone of {@link ClientStream#cancel(Status)};
|
* <p>This is a clone of {@link ClientStream#cancel(Status)};
|
||||||
* {@link AbstractClientStream2#cancel} delegates to this method.
|
* {@link AbstractClientStream#cancel} delegates to this method.
|
||||||
*/
|
*/
|
||||||
void cancel(Status status);
|
void cancel(Status status);
|
||||||
}
|
}
|
||||||
|
|
@ -104,7 +104,7 @@ public abstract class AbstractClientStream2 extends AbstractStream2
|
||||||
*/
|
*/
|
||||||
private volatile boolean cancelled;
|
private volatile boolean cancelled;
|
||||||
|
|
||||||
protected AbstractClientStream2(WritableBufferAllocator bufferAllocator,
|
protected AbstractClientStream(WritableBufferAllocator bufferAllocator,
|
||||||
StatsTraceContext statsTraceCtx, Metadata headers, boolean useGet) {
|
StatsTraceContext statsTraceCtx, Metadata headers, boolean useGet) {
|
||||||
Preconditions.checkNotNull(headers, "headers");
|
Preconditions.checkNotNull(headers, "headers");
|
||||||
this.useGet = useGet;
|
this.useGet = useGet;
|
||||||
|
|
@ -182,7 +182,7 @@ public abstract class AbstractClientStream2 extends AbstractStream2
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This should only called from the transport thread. */
|
/** This should only called from the transport thread. */
|
||||||
protected abstract static class TransportState extends AbstractStream2.TransportState {
|
protected abstract static class TransportState extends AbstractStream.TransportState {
|
||||||
/** Whether listener.closed() has been called. */
|
/** Whether listener.closed() has been called. */
|
||||||
private final StatsTraceContext statsTraceCtx;
|
private final StatsTraceContext statsTraceCtx;
|
||||||
private boolean listenerClosed;
|
private boolean listenerClosed;
|
||||||
|
|
@ -42,7 +42,7 @@ import javax.annotation.Nullable;
|
||||||
* implement {@link #transportState()} and {@link #abstractServerStreamSink()}. Must only be called
|
* implement {@link #transportState()} and {@link #abstractServerStreamSink()}. Must only be called
|
||||||
* from the sending application thread.
|
* from the sending application thread.
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractServerStream extends AbstractStream2
|
public abstract class AbstractServerStream extends AbstractStream
|
||||||
implements ServerStream, MessageFramer.Sink {
|
implements ServerStream, MessageFramer.Sink {
|
||||||
/**
|
/**
|
||||||
* A sink for outbound operations, separated from the stream simply to avoid name
|
* A sink for outbound operations, separated from the stream simply to avoid name
|
||||||
|
|
@ -184,7 +184,7 @@ public abstract class AbstractServerStream extends AbstractStream2
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This should only called from the transport thread. */
|
/** This should only called from the transport thread. */
|
||||||
protected abstract static class TransportState extends AbstractStream2.TransportState {
|
protected abstract static class TransportState extends AbstractStream.TransportState {
|
||||||
/** Whether listener.closed() has been called. */
|
/** Whether listener.closed() has been called. */
|
||||||
private boolean listenerClosed;
|
private boolean listenerClosed;
|
||||||
private ServerStreamListener listener;
|
private ServerStreamListener listener;
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ import javax.annotation.concurrent.GuardedBy;
|
||||||
* The stream and stream state as used by the application. Must only be called from the sending
|
* The stream and stream state as used by the application. Must only be called from the sending
|
||||||
* application thread.
|
* application thread.
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractStream2 implements Stream {
|
public abstract class AbstractStream implements Stream {
|
||||||
/** The framer to use for sending messages. */
|
/** The framer to use for sending messages. */
|
||||||
protected abstract Framer framer();
|
protected abstract Framer framer();
|
||||||
|
|
||||||
|
|
@ -252,10 +252,10 @@ public abstract class AbstractStream2 implements Stream {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notify that the stream does not exist in a usable state any longer. This causes {@link
|
* Notify that the stream does not exist in a usable state any longer. This causes {@link
|
||||||
* AbstractStream2#isReady()} to return {@code false} from this point forward.
|
* AbstractStream#isReady()} to return {@code false} from this point forward.
|
||||||
*
|
*
|
||||||
* <p>This does not generally need to be called explicitly by the transport, as it is handled
|
* <p>This does not generally need to be called explicitly by the transport, as it is handled
|
||||||
* implicitly by {@link AbstractClientStream2} and {@link AbstractServerStream}.
|
* implicitly by {@link AbstractClientStream} and {@link AbstractServerStream}.
|
||||||
*/
|
*/
|
||||||
protected final void onStreamDeallocated() {
|
protected final void onStreamDeallocated() {
|
||||||
synchronized (onReadyLock) {
|
synchronized (onReadyLock) {
|
||||||
|
|
@ -42,7 +42,7 @@ import javax.annotation.Nullable;
|
||||||
/**
|
/**
|
||||||
* Base implementation for client streams using HTTP2 as the transport.
|
* Base implementation for client streams using HTTP2 as the transport.
|
||||||
*/
|
*/
|
||||||
public abstract class Http2ClientStreamTransportState extends AbstractClientStream2.TransportState {
|
public abstract class Http2ClientStreamTransportState extends AbstractClientStream.TransportState {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Metadata marshaller for HTTP status lines.
|
* Metadata marshaller for HTTP status lines.
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ import io.grpc.Metadata;
|
||||||
import io.grpc.Status;
|
import io.grpc.Status;
|
||||||
import io.grpc.Status.Code;
|
import io.grpc.Status.Code;
|
||||||
import io.grpc.StreamTracer;
|
import io.grpc.StreamTracer;
|
||||||
import io.grpc.internal.AbstractClientStream2.TransportState;
|
import io.grpc.internal.AbstractClientStream.TransportState;
|
||||||
import io.grpc.internal.MessageFramerTest.ByteWritableBuffer;
|
import io.grpc.internal.MessageFramerTest.ByteWritableBuffer;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
|
@ -63,11 +63,11 @@ import org.mockito.Mock;
|
||||||
import org.mockito.MockitoAnnotations;
|
import org.mockito.MockitoAnnotations;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test for {@link AbstractClientStream2}. This class tries to test functionality in
|
* Test for {@link AbstractClientStream}. This class tries to test functionality in
|
||||||
* AbstractClientStream2, but not in any super classes.
|
* AbstractClientStream2, but not in any super classes.
|
||||||
*/
|
*/
|
||||||
@RunWith(JUnit4.class)
|
@RunWith(JUnit4.class)
|
||||||
public class AbstractClientStream2Test {
|
public class AbstractClientStreamTest {
|
||||||
|
|
||||||
@Rule public final ExpectedException thrown = ExpectedException.none();
|
@Rule public final ExpectedException thrown = ExpectedException.none();
|
||||||
|
|
||||||
|
|
@ -91,7 +91,7 @@ public class AbstractClientStream2Test {
|
||||||
public void cancel_doNotAcceptOk() {
|
public void cancel_doNotAcceptOk() {
|
||||||
for (Code code : Code.values()) {
|
for (Code code : Code.values()) {
|
||||||
ClientStreamListener listener = new NoopClientStreamListener();
|
ClientStreamListener listener = new NoopClientStreamListener();
|
||||||
AbstractClientStream2 stream = new BaseAbstractClientStream(allocator, statsTraceCtx);
|
AbstractClientStream stream = new BaseAbstractClientStream(allocator, statsTraceCtx);
|
||||||
stream.start(listener);
|
stream.start(listener);
|
||||||
if (code != Code.OK) {
|
if (code != Code.OK) {
|
||||||
stream.cancel(Status.fromCodeValue(code.value()));
|
stream.cancel(Status.fromCodeValue(code.value()));
|
||||||
|
|
@ -109,7 +109,7 @@ public class AbstractClientStream2Test {
|
||||||
@Test
|
@Test
|
||||||
public void cancel_failsOnNull() {
|
public void cancel_failsOnNull() {
|
||||||
ClientStreamListener listener = new NoopClientStreamListener();
|
ClientStreamListener listener = new NoopClientStreamListener();
|
||||||
AbstractClientStream2 stream = new BaseAbstractClientStream(allocator, statsTraceCtx);
|
AbstractClientStream stream = new BaseAbstractClientStream(allocator, statsTraceCtx);
|
||||||
stream.start(listener);
|
stream.start(listener);
|
||||||
thrown.expect(NullPointerException.class);
|
thrown.expect(NullPointerException.class);
|
||||||
|
|
||||||
|
|
@ -119,7 +119,7 @@ public class AbstractClientStream2Test {
|
||||||
@Test
|
@Test
|
||||||
public void cancel_notifiesOnlyOnce() {
|
public void cancel_notifiesOnlyOnce() {
|
||||||
final BaseTransportState state = new BaseTransportState(statsTraceCtx);
|
final BaseTransportState state = new BaseTransportState(statsTraceCtx);
|
||||||
AbstractClientStream2 stream = new BaseAbstractClientStream(allocator, state, new BaseSink() {
|
AbstractClientStream stream = new BaseAbstractClientStream(allocator, state, new BaseSink() {
|
||||||
@Override
|
@Override
|
||||||
public void cancel(Status errorStatus) {
|
public void cancel(Status errorStatus) {
|
||||||
// Cancel should eventually result in a transportReportStatus on the transport thread
|
// Cancel should eventually result in a transportReportStatus on the transport thread
|
||||||
|
|
@ -136,7 +136,7 @@ public class AbstractClientStream2Test {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void startFailsOnNullListener() {
|
public void startFailsOnNullListener() {
|
||||||
AbstractClientStream2 stream = new BaseAbstractClientStream(allocator, statsTraceCtx);
|
AbstractClientStream stream = new BaseAbstractClientStream(allocator, statsTraceCtx);
|
||||||
|
|
||||||
thrown.expect(NullPointerException.class);
|
thrown.expect(NullPointerException.class);
|
||||||
|
|
||||||
|
|
@ -145,7 +145,7 @@ public class AbstractClientStream2Test {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void cantCallStartTwice() {
|
public void cantCallStartTwice() {
|
||||||
AbstractClientStream2 stream = new BaseAbstractClientStream(allocator, statsTraceCtx);
|
AbstractClientStream stream = new BaseAbstractClientStream(allocator, statsTraceCtx);
|
||||||
stream.start(mockListener);
|
stream.start(mockListener);
|
||||||
thrown.expect(IllegalStateException.class);
|
thrown.expect(IllegalStateException.class);
|
||||||
|
|
||||||
|
|
@ -155,7 +155,7 @@ public class AbstractClientStream2Test {
|
||||||
@Test
|
@Test
|
||||||
public void inboundDataReceived_failsOnNullFrame() {
|
public void inboundDataReceived_failsOnNullFrame() {
|
||||||
ClientStreamListener listener = new NoopClientStreamListener();
|
ClientStreamListener listener = new NoopClientStreamListener();
|
||||||
AbstractClientStream2 stream = new BaseAbstractClientStream(allocator, statsTraceCtx);
|
AbstractClientStream stream = new BaseAbstractClientStream(allocator, statsTraceCtx);
|
||||||
stream.start(listener);
|
stream.start(listener);
|
||||||
|
|
||||||
TransportState state = stream.transportState();
|
TransportState state = stream.transportState();
|
||||||
|
|
@ -166,7 +166,7 @@ public class AbstractClientStream2Test {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void inboundHeadersReceived_notifiesListener() {
|
public void inboundHeadersReceived_notifiesListener() {
|
||||||
AbstractClientStream2 stream = new BaseAbstractClientStream(allocator, statsTraceCtx);
|
AbstractClientStream stream = new BaseAbstractClientStream(allocator, statsTraceCtx);
|
||||||
stream.start(mockListener);
|
stream.start(mockListener);
|
||||||
Metadata headers = new Metadata();
|
Metadata headers = new Metadata();
|
||||||
|
|
||||||
|
|
@ -176,7 +176,7 @@ public class AbstractClientStream2Test {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void inboundHeadersReceived_failsIfStatusReported() {
|
public void inboundHeadersReceived_failsIfStatusReported() {
|
||||||
AbstractClientStream2 stream = new BaseAbstractClientStream(allocator, statsTraceCtx);
|
AbstractClientStream stream = new BaseAbstractClientStream(allocator, statsTraceCtx);
|
||||||
stream.start(mockListener);
|
stream.start(mockListener);
|
||||||
stream.transportState().transportReportStatus(Status.CANCELLED, false, new Metadata());
|
stream.transportState().transportReportStatus(Status.CANCELLED, false, new Metadata());
|
||||||
|
|
||||||
|
|
@ -188,7 +188,7 @@ public class AbstractClientStream2Test {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void inboundHeadersReceived_acceptsGzipEncoding() {
|
public void inboundHeadersReceived_acceptsGzipEncoding() {
|
||||||
AbstractClientStream2 stream = new BaseAbstractClientStream(allocator, statsTraceCtx);
|
AbstractClientStream stream = new BaseAbstractClientStream(allocator, statsTraceCtx);
|
||||||
stream.start(mockListener);
|
stream.start(mockListener);
|
||||||
Metadata headers = new Metadata();
|
Metadata headers = new Metadata();
|
||||||
headers.put(GrpcUtil.MESSAGE_ENCODING_KEY, new Codec.Gzip().getMessageEncoding());
|
headers.put(GrpcUtil.MESSAGE_ENCODING_KEY, new Codec.Gzip().getMessageEncoding());
|
||||||
|
|
@ -199,7 +199,7 @@ public class AbstractClientStream2Test {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void inboundHeadersReceived_acceptsIdentityEncoding() {
|
public void inboundHeadersReceived_acceptsIdentityEncoding() {
|
||||||
AbstractClientStream2 stream = new BaseAbstractClientStream(allocator, statsTraceCtx);
|
AbstractClientStream stream = new BaseAbstractClientStream(allocator, statsTraceCtx);
|
||||||
stream.start(mockListener);
|
stream.start(mockListener);
|
||||||
Metadata headers = new Metadata();
|
Metadata headers = new Metadata();
|
||||||
headers.put(GrpcUtil.MESSAGE_ENCODING_KEY, Codec.Identity.NONE.getMessageEncoding());
|
headers.put(GrpcUtil.MESSAGE_ENCODING_KEY, Codec.Identity.NONE.getMessageEncoding());
|
||||||
|
|
@ -210,7 +210,7 @@ public class AbstractClientStream2Test {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void rstStreamClosesStream() {
|
public void rstStreamClosesStream() {
|
||||||
AbstractClientStream2 stream = new BaseAbstractClientStream(allocator, statsTraceCtx);
|
AbstractClientStream stream = new BaseAbstractClientStream(allocator, statsTraceCtx);
|
||||||
stream.start(mockListener);
|
stream.start(mockListener);
|
||||||
// The application will call request when waiting for a message, which will in turn call this
|
// The application will call request when waiting for a message, which will in turn call this
|
||||||
// on the transport thread.
|
// on the transport thread.
|
||||||
|
|
@ -226,7 +226,7 @@ public class AbstractClientStream2Test {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getRequest() {
|
public void getRequest() {
|
||||||
AbstractClientStream2.Sink sink = mock(AbstractClientStream2.Sink.class);
|
AbstractClientStream.Sink sink = mock(AbstractClientStream.Sink.class);
|
||||||
final ClientStreamTracer tracer = spy(new ClientStreamTracer() {});
|
final ClientStreamTracer tracer = spy(new ClientStreamTracer() {});
|
||||||
ClientStreamTracer.Factory tracerFactory =
|
ClientStreamTracer.Factory tracerFactory =
|
||||||
new ClientStreamTracer.Factory() {
|
new ClientStreamTracer.Factory() {
|
||||||
|
|
@ -236,7 +236,7 @@ public class AbstractClientStream2Test {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
StatsTraceContext statsTraceCtx = new StatsTraceContext(new StreamTracer[] {tracer});
|
StatsTraceContext statsTraceCtx = new StatsTraceContext(new StreamTracer[] {tracer});
|
||||||
AbstractClientStream2 stream = new BaseAbstractClientStream(allocator,
|
AbstractClientStream stream = new BaseAbstractClientStream(allocator,
|
||||||
new BaseTransportState(statsTraceCtx), sink, statsTraceCtx, true);
|
new BaseTransportState(statsTraceCtx), sink, statsTraceCtx, true);
|
||||||
stream.start(mockListener);
|
stream.start(mockListener);
|
||||||
stream.writeMessage(new ByteArrayInputStream(new byte[1]));
|
stream.writeMessage(new ByteArrayInputStream(new byte[1]));
|
||||||
|
|
@ -259,7 +259,7 @@ public class AbstractClientStream2Test {
|
||||||
/**
|
/**
|
||||||
* No-op base class for testing.
|
* No-op base class for testing.
|
||||||
*/
|
*/
|
||||||
private static class BaseAbstractClientStream extends AbstractClientStream2 {
|
private static class BaseAbstractClientStream extends AbstractClientStream {
|
||||||
private final TransportState state;
|
private final TransportState state;
|
||||||
private final Sink sink;
|
private final Sink sink;
|
||||||
|
|
||||||
|
|
@ -305,7 +305,7 @@ public class AbstractClientStream2Test {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class BaseSink implements AbstractClientStream2.Sink {
|
private static class BaseSink implements AbstractClientStream.Sink {
|
||||||
@Override
|
@Override
|
||||||
public void writeHeaders(Metadata headers, byte[] payload) {}
|
public void writeHeaders(Metadata headers, byte[] payload) {}
|
||||||
|
|
||||||
|
|
@ -319,7 +319,7 @@ public class AbstractClientStream2Test {
|
||||||
public void cancel(Status reason) {}
|
public void cancel(Status reason) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class BaseTransportState extends AbstractClientStream2.TransportState {
|
private static class BaseTransportState extends AbstractClientStream.TransportState {
|
||||||
public BaseTransportState(StatsTraceContext statsTraceCtx) {
|
public BaseTransportState(StatsTraceContext statsTraceCtx) {
|
||||||
super(DEFAULT_MAX_MESSAGE_SIZE, statsTraceCtx);
|
super(DEFAULT_MAX_MESSAGE_SIZE, statsTraceCtx);
|
||||||
}
|
}
|
||||||
|
|
@ -43,7 +43,7 @@ import io.grpc.InternalMethodDescriptor;
|
||||||
import io.grpc.Metadata;
|
import io.grpc.Metadata;
|
||||||
import io.grpc.MethodDescriptor;
|
import io.grpc.MethodDescriptor;
|
||||||
import io.grpc.Status;
|
import io.grpc.Status;
|
||||||
import io.grpc.internal.AbstractClientStream2;
|
import io.grpc.internal.AbstractClientStream;
|
||||||
import io.grpc.internal.GrpcUtil;
|
import io.grpc.internal.GrpcUtil;
|
||||||
import io.grpc.internal.Http2ClientStreamTransportState;
|
import io.grpc.internal.Http2ClientStreamTransportState;
|
||||||
import io.grpc.internal.StatsTraceContext;
|
import io.grpc.internal.StatsTraceContext;
|
||||||
|
|
@ -61,7 +61,7 @@ import javax.annotation.Nullable;
|
||||||
* Client stream for a Netty transport. Must only be called from the sending application
|
* Client stream for a Netty transport. Must only be called from the sending application
|
||||||
* thread.
|
* thread.
|
||||||
*/
|
*/
|
||||||
class NettyClientStream extends AbstractClientStream2 {
|
class NettyClientStream extends AbstractClientStream {
|
||||||
private static final InternalMethodDescriptor methodDescriptorAccessor =
|
private static final InternalMethodDescriptor methodDescriptorAccessor =
|
||||||
new InternalMethodDescriptor(InternalKnownTransport.NETTY);
|
new InternalMethodDescriptor(InternalKnownTransport.NETTY);
|
||||||
|
|
||||||
|
|
@ -115,7 +115,7 @@ class NettyClientStream extends AbstractClientStream2 {
|
||||||
return method.isSafe();
|
return method.isSafe();
|
||||||
}
|
}
|
||||||
|
|
||||||
private class Sink implements AbstractClientStream2.Sink {
|
private class Sink implements AbstractClientStream.Sink {
|
||||||
@Override
|
@Override
|
||||||
public void writeHeaders(Metadata headers, byte[] requestPayload) {
|
public void writeHeaders(Metadata headers, byte[] requestPayload) {
|
||||||
// Convert the headers into Netty HTTP/2 headers.
|
// Convert the headers into Netty HTTP/2 headers.
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ import io.grpc.Attributes;
|
||||||
import io.grpc.Metadata;
|
import io.grpc.Metadata;
|
||||||
import io.grpc.MethodDescriptor;
|
import io.grpc.MethodDescriptor;
|
||||||
import io.grpc.Status;
|
import io.grpc.Status;
|
||||||
import io.grpc.internal.AbstractClientStream2;
|
import io.grpc.internal.AbstractClientStream;
|
||||||
import io.grpc.internal.GrpcUtil;
|
import io.grpc.internal.GrpcUtil;
|
||||||
import io.grpc.internal.Http2ClientStreamTransportState;
|
import io.grpc.internal.Http2ClientStreamTransportState;
|
||||||
import io.grpc.internal.StatsTraceContext;
|
import io.grpc.internal.StatsTraceContext;
|
||||||
|
|
@ -55,7 +55,7 @@ import okio.Buffer;
|
||||||
/**
|
/**
|
||||||
* Client stream for the okhttp transport.
|
* Client stream for the okhttp transport.
|
||||||
*/
|
*/
|
||||||
class OkHttpClientStream extends AbstractClientStream2 {
|
class OkHttpClientStream extends AbstractClientStream {
|
||||||
|
|
||||||
private static final int WINDOW_UPDATE_THRESHOLD = Utils.DEFAULT_WINDOW_SIZE / 2;
|
private static final int WINDOW_UPDATE_THRESHOLD = Utils.DEFAULT_WINDOW_SIZE / 2;
|
||||||
|
|
||||||
|
|
@ -124,7 +124,7 @@ class OkHttpClientStream extends AbstractClientStream2 {
|
||||||
return Attributes.EMPTY;
|
return Attributes.EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Sink implements AbstractClientStream2.Sink {
|
class Sink implements AbstractClientStream.Sink {
|
||||||
@Override
|
@Override
|
||||||
public void writeHeaders(Metadata metadata, byte[] payload) {
|
public void writeHeaders(Metadata metadata, byte[] payload) {
|
||||||
String defaultPath = "/" + method.getFullMethodName();
|
String defaultPath = "/" + method.getFullMethodName();
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ import io.grpc.MethodDescriptor.MethodType;
|
||||||
import io.grpc.Status;
|
import io.grpc.Status;
|
||||||
import io.grpc.Status.Code;
|
import io.grpc.Status.Code;
|
||||||
import io.grpc.StatusException;
|
import io.grpc.StatusException;
|
||||||
import io.grpc.internal.AbstractStream2;
|
import io.grpc.internal.AbstractStream;
|
||||||
import io.grpc.internal.ClientStreamListener;
|
import io.grpc.internal.ClientStreamListener;
|
||||||
import io.grpc.internal.ClientTransport;
|
import io.grpc.internal.ClientTransport;
|
||||||
import io.grpc.internal.GrpcUtil;
|
import io.grpc.internal.GrpcUtil;
|
||||||
|
|
@ -1129,7 +1129,7 @@ public class OkHttpClientTransportTest {
|
||||||
initTransport();
|
initTransport();
|
||||||
// exactly one byte below the threshold
|
// exactly one byte below the threshold
|
||||||
int messageLength =
|
int messageLength =
|
||||||
AbstractStream2.TransportState.DEFAULT_ONREADY_THRESHOLD - HEADER_LENGTH - 1;
|
AbstractStream.TransportState.DEFAULT_ONREADY_THRESHOLD - HEADER_LENGTH - 1;
|
||||||
setInitialWindowSize(0);
|
setInitialWindowSize(0);
|
||||||
MockStreamListener listener = new MockStreamListener();
|
MockStreamListener listener = new MockStreamListener();
|
||||||
OkHttpClientStream stream = clientTransport.newStream(method, new Metadata());
|
OkHttpClientStream stream = clientTransport.newStream(method, new Metadata());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue