Examples of previousReceiveBufferSize()


Examples of com.facebook.presto.jdbc.internal.netty.channel.ReceiveBufferSizePredictor.previousReceiveBufferSize()

            final ChannelBuffer buffer = bufferFactory.getBuffer(readBytes);
            buffer.setBytes(0, bb);
            buffer.writerIndex(readBytes);

            // Update the predictor.
            predictor.previousReceiveBufferSize(readBytes);

            // Fire the event.
            fireMessageReceived(channel, buffer);
        }
View Full Code Here

Examples of com.facebook.presto.jdbc.internal.netty.channel.ReceiveBufferSizePredictor.previousReceiveBufferSize()

            byteBuffer.flip();

            int readBytes = byteBuffer.remaining();
            if (readBytes > 0) {
                // Update the predictor.
                predictor.previousReceiveBufferSize(readBytes);

                final ChannelBuffer buffer = bufferFactory.getBuffer(readBytes);
                buffer.setBytes(0, byteBuffer);
                buffer.writerIndex(readBytes);
View Full Code Here

Examples of com.facebook.presto.jdbc.internal.netty.channel.ReceiveBufferSizePredictor.previousReceiveBufferSize()

                final ChannelBuffer buffer = bufferFactory.getBuffer(readBytes);
                buffer.setBytes(0, byteBuffer);
                buffer.writerIndex(readBytes);

                // Update the predictor.
                predictor.previousReceiveBufferSize(readBytes);

                // Notify the interested parties about the newly arrived message.
                fireMessageReceived(
                        channel, buffer, remoteAddress);
            }
View Full Code Here

Examples of com.firefly.net.ReceiveBufferSizePredictor.previousReceiveBufferSize()

  private static Log log = LogFactory.getInstance().getLog("firefly-system");

  @Test
  public void testAdaptive() {
    ReceiveBufferSizePredictor receiveBufferSizePredictor = new AdaptiveReceiveBufferSizePredictor();
    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    log.debug("current buf size: " + receiveBufferSizePredictor.nextReceiveBufferSize());
    Assert.assertThat(receiveBufferSizePredictor.nextReceiveBufferSize(), is(1024));
View Full Code Here

Examples of com.firefly.net.ReceiveBufferSizePredictor.previousReceiveBufferSize()

  @Test
  public void testAdaptive() {
    ReceiveBufferSizePredictor receiveBufferSizePredictor = new AdaptiveReceiveBufferSizePredictor();
    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    log.debug("current buf size: " + receiveBufferSizePredictor.nextReceiveBufferSize());
    Assert.assertThat(receiveBufferSizePredictor.nextReceiveBufferSize(), is(1024));

    receiveBufferSizePredictor.previousReceiveBufferSize(1025);
View Full Code Here

Examples of com.firefly.net.ReceiveBufferSizePredictor.previousReceiveBufferSize()

  @Test
  public void testAdaptive() {
    ReceiveBufferSizePredictor receiveBufferSizePredictor = new AdaptiveReceiveBufferSizePredictor();
    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    log.debug("current buf size: " + receiveBufferSizePredictor.nextReceiveBufferSize());
    Assert.assertThat(receiveBufferSizePredictor.nextReceiveBufferSize(), is(1024));

    receiveBufferSizePredictor.previousReceiveBufferSize(1025);
    receiveBufferSizePredictor.previousReceiveBufferSize(1300);
View Full Code Here

Examples of com.firefly.net.ReceiveBufferSizePredictor.previousReceiveBufferSize()

    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    log.debug("current buf size: " + receiveBufferSizePredictor.nextReceiveBufferSize());
    Assert.assertThat(receiveBufferSizePredictor.nextReceiveBufferSize(), is(1024));

    receiveBufferSizePredictor.previousReceiveBufferSize(1025);
    receiveBufferSizePredictor.previousReceiveBufferSize(1300);
    log.debug("current buf size: " + receiveBufferSizePredictor.nextReceiveBufferSize());
    Assert.assertThat(receiveBufferSizePredictor.nextReceiveBufferSize(), greaterThan(1024));

    receiveBufferSizePredictor.previousReceiveBufferSize(4000);
View Full Code Here

Examples of com.firefly.net.ReceiveBufferSizePredictor.previousReceiveBufferSize()

    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    log.debug("current buf size: " + receiveBufferSizePredictor.nextReceiveBufferSize());
    Assert.assertThat(receiveBufferSizePredictor.nextReceiveBufferSize(), is(1024));

    receiveBufferSizePredictor.previousReceiveBufferSize(1025);
    receiveBufferSizePredictor.previousReceiveBufferSize(1300);
    log.debug("current buf size: " + receiveBufferSizePredictor.nextReceiveBufferSize());
    Assert.assertThat(receiveBufferSizePredictor.nextReceiveBufferSize(), greaterThan(1024));

    receiveBufferSizePredictor.previousReceiveBufferSize(4000);
    log.debug("current buf size: " + receiveBufferSizePredictor.nextReceiveBufferSize());
View Full Code Here

Examples of com.firefly.net.ReceiveBufferSizePredictor.previousReceiveBufferSize()

    receiveBufferSizePredictor.previousReceiveBufferSize(1025);
    receiveBufferSizePredictor.previousReceiveBufferSize(1300);
    log.debug("current buf size: " + receiveBufferSizePredictor.nextReceiveBufferSize());
    Assert.assertThat(receiveBufferSizePredictor.nextReceiveBufferSize(), greaterThan(1024));

    receiveBufferSizePredictor.previousReceiveBufferSize(4000);
    log.debug("current buf size: " + receiveBufferSizePredictor.nextReceiveBufferSize());
    Assert.assertThat(receiveBufferSizePredictor.nextReceiveBufferSize(), greaterThan(2000));
  }

  @Test
View Full Code Here

Examples of com.firefly.net.ReceiveBufferSizePredictor.previousReceiveBufferSize()

  }

  @Test
  public void testFix() {
    ReceiveBufferSizePredictor receiveBufferSizePredictor = new FixedReceiveBufferSizePredictor(1024 * 8);
    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    Assert.assertThat(receiveBufferSizePredictor.nextReceiveBufferSize(), is(1024 * 8));
    receiveBufferSizePredictor.previousReceiveBufferSize(40000);
    Assert.assertThat(receiveBufferSizePredictor.nextReceiveBufferSize(), is(1024 * 8));
  }

 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.