After review, renamed *directBuffers to *directByteBuffers.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2019-09-17 12:16:10 +02:00
parent 1ef4a416b5
commit 0eec727a09
9 changed files with 60 additions and 60 deletions

View File

@ -56,8 +56,8 @@ public class HTTP2Connection extends AbstractConnection implements WriteFlusher.
private final ISession session;
private final int bufferSize;
private final ExecutionStrategy strategy;
private boolean useInputDirectBuffers;
private boolean useOutputDirectBuffers;
private boolean useInputDirectByteBuffers;
private boolean useOutputDirectByteBuffers;
public HTTP2Connection(ByteBufferPool byteBufferPool, Executor executor, EndPoint endPoint, Parser parser, ISession session, int bufferSize)
{
@ -103,22 +103,22 @@ public class HTTP2Connection extends AbstractConnection implements WriteFlusher.
public boolean isUseInputDirectByteBuffers()
{
return useInputDirectBuffers;
return useInputDirectByteBuffers;
}
public void setUseInputDirectByteBuffers(boolean useInputDirectBuffers)
public void setUseInputDirectByteBuffers(boolean useInputDirectByteBuffers)
{
this.useInputDirectBuffers = useInputDirectBuffers;
this.useInputDirectByteBuffers = useInputDirectByteBuffers;
}
public boolean isUseOutputDirectByteBuffers()
{
return useOutputDirectBuffers;
return useOutputDirectByteBuffers;
}
public void setUseOutputDirectByteBuffers(boolean useOutputDirectBuffers)
public void setUseOutputDirectByteBuffers(boolean useOutputDirectByteBuffers)
{
this.useOutputDirectBuffers = useOutputDirectBuffers;
this.useOutputDirectByteBuffers = useOutputDirectByteBuffers;
}
@Override

View File

@ -42,11 +42,11 @@ public class Generator
this(byteBufferPool, true, maxDynamicTableSize, maxHeaderBlockFragment);
}
public Generator(ByteBufferPool byteBufferPool, boolean directBuffers, int maxDynamicTableSize, int maxHeaderBlockFragment)
public Generator(ByteBufferPool byteBufferPool, boolean useDirectByteBuffers, int maxDynamicTableSize, int maxHeaderBlockFragment)
{
this.byteBufferPool = byteBufferPool;
headerGenerator = new HeaderGenerator(directBuffers);
headerGenerator = new HeaderGenerator(useDirectByteBuffers);
hpackEncoder = new HpackEncoder(maxDynamicTableSize);
this.generators = new FrameGenerator[FrameType.values().length];

View File

@ -27,21 +27,21 @@ import org.eclipse.jetty.io.ByteBufferPool;
public class HeaderGenerator
{
private int maxFrameSize = Frame.DEFAULT_MAX_LENGTH;
private final boolean directBuffers;
private final boolean useDirectByteBuffers;
public HeaderGenerator()
{
this(true);
}
public HeaderGenerator(boolean directBuffers)
public HeaderGenerator(boolean useDirectByteBuffers)
{
this.directBuffers = directBuffers;
this.useDirectByteBuffers = useDirectByteBuffers;
}
public boolean isUseDirectByteBuffers()
{
return directBuffers;
return useDirectByteBuffers;
}
public ByteBuffer generate(ByteBufferPool.Lease lease, FrameType frameType, int capacity, int length, int flags, int streamId)

View File

@ -64,8 +64,8 @@ public abstract class AbstractHTTP2ServerConnectionFactory extends AbstractConne
private RateControl rateControl = new WindowRateControl(20, Duration.ofSeconds(1));
private FlowControlStrategy.Factory flowControlStrategyFactory = () -> new BufferingFlowControlStrategy(0.5F);
private long streamIdleTimeout;
private boolean _useInputDirectBuffers;
private boolean _useOutputDirectBuffers;
private boolean _useInputDirectByteBuffers;
private boolean _useOutputDirectByteBuffers;
public AbstractHTTP2ServerConnectionFactory(@Name("config") HttpConfiguration httpConfiguration)
{
@ -198,22 +198,22 @@ public abstract class AbstractHTTP2ServerConnectionFactory extends AbstractConne
public boolean isUseInputDirectByteBuffers()
{
return _useInputDirectBuffers;
return _useInputDirectByteBuffers;
}
public void setUseInputDirectByteBuffers(boolean useInputDirectBuffers)
public void setUseInputDirectByteBuffers(boolean useInputDirectByteBuffers)
{
_useInputDirectBuffers = useInputDirectBuffers;
_useInputDirectByteBuffers = useInputDirectByteBuffers;
}
public boolean isUseOutputDirectByteBuffers()
{
return _useOutputDirectBuffers;
return _useOutputDirectByteBuffers;
}
public void setUseOutputDirectByteBuffers(boolean useOutputDirectBuffers)
public void setUseOutputDirectByteBuffers(boolean useOutputDirectByteBuffers)
{
_useOutputDirectBuffers = useOutputDirectBuffers;
_useOutputDirectByteBuffers = useOutputDirectByteBuffers;
}
public HttpConfiguration getHttpConfiguration()

View File

@ -57,7 +57,7 @@ public class HttpChannelOverHTTP2 extends HttpChannel implements Closeable, Writ
private boolean _expect100Continue;
private boolean _delayedUntilContent;
private boolean _useOutputDirectBuffers;
private boolean _useOutputDirectByteBuffers;
public HttpChannelOverHTTP2(Connector connector, HttpConfiguration configuration, EndPoint endPoint, HttpTransportOverHTTP2 transport)
{
@ -72,12 +72,12 @@ public class HttpChannelOverHTTP2 extends HttpChannel implements Closeable, Writ
@Override
public boolean isUseOutputDirectByteBuffers()
{
return _useOutputDirectBuffers;
return _useOutputDirectByteBuffers;
}
public void setUseOutputDirectByteBuffers(boolean useOutputDirectBuffers)
public void setUseOutputDirectByteBuffers(boolean useOutputDirectByteBuffers)
{
_useOutputDirectBuffers = useOutputDirectBuffers;
_useOutputDirectByteBuffers = useOutputDirectByteBuffers;
}
@Override

View File

@ -72,8 +72,8 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
private final boolean _recordHttpComplianceViolations;
private final LongAdder bytesIn = new LongAdder();
private final LongAdder bytesOut = new LongAdder();
private boolean _useInputDirectBuffers;
private boolean _useOutputDirectBuffers;
private boolean _useInputDirectByteBuffers;
private boolean _useOutputDirectByteBuffers;
/**
* Get the current connection that this thread is dispatched to.
@ -179,22 +179,22 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
public boolean isUseInputDirectByteBuffers()
{
return _useInputDirectBuffers;
return _useInputDirectByteBuffers;
}
public void setUseInputDirectByteBuffers(boolean useInputDirectBuffers)
public void setUseInputDirectByteBuffers(boolean useInputDirectByteBuffers)
{
_useInputDirectBuffers = useInputDirectBuffers;
_useInputDirectByteBuffers = useInputDirectByteBuffers;
}
public boolean isUseOutputDirectByteBuffers()
{
return _useOutputDirectBuffers;
return _useOutputDirectByteBuffers;
}
public void setUseOutputDirectByteBuffers(boolean useOutputDirectBuffers)
public void setUseOutputDirectByteBuffers(boolean useOutputDirectByteBuffers)
{
_useOutputDirectBuffers = useOutputDirectBuffers;
_useOutputDirectByteBuffers = useOutputDirectByteBuffers;
}
@Override
@ -240,8 +240,8 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
{
if (_requestBuffer == null)
{
boolean useDirectBuffers = isUseInputDirectByteBuffers();
_requestBuffer = _bufferPool.acquire(getInputBufferSize(), useDirectBuffers);
boolean useDirectByteBuffers = isUseInputDirectByteBuffers();
_requestBuffer = _bufferPool.acquire(getInputBufferSize(), useDirectByteBuffers);
}
return _requestBuffer;
}
@ -750,7 +750,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
if (_callback == null)
throw new IllegalStateException();
boolean useDirectBuffers = isUseOutputDirectByteBuffers();
boolean useDirectByteBuffers = isUseOutputDirectByteBuffers();
ByteBuffer chunk = _chunk;
while (true)
{
@ -771,19 +771,19 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
case NEED_HEADER:
{
_header = _bufferPool.acquire(_config.getResponseHeaderSize(), useDirectBuffers);
_header = _bufferPool.acquire(_config.getResponseHeaderSize(), useDirectByteBuffers);
continue;
}
case NEED_CHUNK:
{
chunk = _chunk = _bufferPool.acquire(HttpGenerator.CHUNK_SIZE, useDirectBuffers);
chunk = _chunk = _bufferPool.acquire(HttpGenerator.CHUNK_SIZE, useDirectByteBuffers);
continue;
}
case NEED_CHUNK_TRAILER:
{
if (_chunk != null)
_bufferPool.release(_chunk);
chunk = _chunk = _bufferPool.acquire(_config.getResponseHeaderSize(), useDirectBuffers);
chunk = _chunk = _bufferPool.acquire(_config.getResponseHeaderSize(), useDirectByteBuffers);
continue;
}
case FLUSH:

View File

@ -35,8 +35,8 @@ public class HttpConnectionFactory extends AbstractConnectionFactory implements
{
private final HttpConfiguration _config;
private boolean _recordHttpComplianceViolations;
private boolean _useInputDirectBuffers;
private boolean _useOutputDirectBuffers;
private boolean _useInputDirectByteBuffers;
private boolean _useOutputDirectByteBuffers;
public HttpConnectionFactory()
{
@ -70,22 +70,22 @@ public class HttpConnectionFactory extends AbstractConnectionFactory implements
public boolean isUseInputDirectByteBuffers()
{
return _useInputDirectBuffers;
return _useInputDirectByteBuffers;
}
public void setUseInputDirectByteBuffers(boolean useInputDirectBuffers)
public void setUseInputDirectByteBuffers(boolean useInputDirectByteBuffers)
{
_useInputDirectBuffers = useInputDirectBuffers;
_useInputDirectByteBuffers = useInputDirectByteBuffers;
}
public boolean isUseOutputDirectByteBuffers()
{
return _useOutputDirectBuffers;
return _useOutputDirectByteBuffers;
}
public void setUseOutputDirectByteBuffers(boolean useOutputDirectBuffers)
public void setUseOutputDirectByteBuffers(boolean useOutputDirectByteBuffers)
{
_useOutputDirectBuffers = useOutputDirectBuffers;
_useOutputDirectByteBuffers = useOutputDirectByteBuffers;
}
@Override

View File

@ -69,7 +69,7 @@ public class FrameFlusher extends IteratingCallback
private boolean flushed = true;
private Throwable closedCause;
private long idleTimeout;
private boolean useDirectBuffers;
private boolean useDirectByteBuffers;
public FrameFlusher(ByteBufferPool bufferPool, Scheduler scheduler, Generator generator, EndPoint endPoint, int bufferSize, int maxGather)
{
@ -87,12 +87,12 @@ public class FrameFlusher extends IteratingCallback
public boolean isUseDirectByteBuffers()
{
return useDirectBuffers;
return useDirectByteBuffers;
}
public void setUseDirectByteBuffers(boolean useDirectBuffers)
public void setUseDirectByteBuffers(boolean useDirectByteBuffers)
{
this.useDirectBuffers = useDirectBuffers;
this.useDirectByteBuffers = useDirectByteBuffers;
}
/**

View File

@ -68,8 +68,8 @@ public class WebSocketConnection extends AbstractConnection implements Connectio
// Read / Parse variables
private RetainableByteBuffer networkBuffer;
private boolean useInputDirectBuffers;
private boolean useOutputDirectBuffers;
private boolean useInputDirectByteBuffers;
private boolean useOutputDirectByteBuffers;
/**
* Create a WSConnection.
@ -136,22 +136,22 @@ public class WebSocketConnection extends AbstractConnection implements Connectio
public boolean isUseInputDirectByteBuffers()
{
return useInputDirectBuffers;
return useInputDirectByteBuffers;
}
public void setUseInputDirectByteBuffers(boolean useInputDirectBuffers)
public void setUseInputDirectByteBuffers(boolean useInputDirectByteBuffers)
{
this.useInputDirectBuffers = useInputDirectBuffers;
this.useInputDirectByteBuffers = useInputDirectByteBuffers;
}
public boolean isUseOutputDirectByteBuffers()
{
return useOutputDirectBuffers;
return useOutputDirectByteBuffers;
}
public void setUseOutputDirectByteBuffers(boolean useOutputDirectBuffers)
public void setUseOutputDirectByteBuffers(boolean useOutputDirectByteBuffers)
{
this.useOutputDirectBuffers = useOutputDirectBuffers;
this.useOutputDirectByteBuffers = useOutputDirectByteBuffers;
}
/**