Examples of previousReceiveBufferSize()


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

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

    if (readBytes > 0) {
      bb.flip();
      receiveBufferPool.release(bb);

      // Update the predictor.
      predictor.previousReceiveBufferSize(readBytes);
      session.setReadBytes(readBytes);
      session.setLastReadTime(TIME_PROVIDER.currentTimeMillis());
      // Decode
     
      try {
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));
   
    receiveBufferSizePredictor.previousReceiveBufferSize(500);
    Assert.assertThat(receiveBufferSizePredictor.nextReceiveBufferSize(), greaterThan(2000));
View Full Code Here

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

    receiveBufferSizePredictor.previousReceiveBufferSize(4000);
    log.debug("current buf size: " + receiveBufferSizePredictor.nextReceiveBufferSize());
    Assert.assertThat(receiveBufferSizePredictor.nextReceiveBufferSize(), greaterThan(2000));
   
    receiveBufferSizePredictor.previousReceiveBufferSize(500);
    Assert.assertThat(receiveBufferSizePredictor.nextReceiveBufferSize(), greaterThan(2000));
    receiveBufferSizePredictor.previousReceiveBufferSize(1000);
    Assert.assertThat(receiveBufferSizePredictor.nextReceiveBufferSize(), lessThan(2000));
  }
View Full Code Here

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

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

  @Test
  public void testFix() {
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.