Examples of used()


Examples of etch.util.core.nio.ByteBufferPool.used()

    MyNotify n1 = new MyNotify();
    MyNotify n2 = new MyNotify();
   
    ByteBuffer b1 = p.alloc( n1 );
    assertNotNull( b1 );
    assertEquals( 1, p.used() );
    Thread.sleep( 15 );
    assertFalse( n1.available );
    assertFalse( n2.available );
   
    ByteBuffer b2 = p.alloc( n2 );
View Full Code Here

Examples of etch.util.core.nio.ByteBufferPool.used()

    assertFalse( n1.available );
    assertFalse( n2.available );
   
    ByteBuffer b2 = p.alloc( n2 );
    assertNull( b2 );
    assertEquals( 1, p.used() );
    Thread.sleep( 15 );
    assertFalse( n1.available );
    assertFalse( n2.available );
   
    // the alloc of b2 failed, but n2 should be registered to be notified
View Full Code Here

Examples of etch.util.core.nio.ByteBufferPool.used()

    // the alloc of b2 failed, but n2 should be registered to be notified
    // when a block is freed. release of b1 should notify n2 of availability
   
    p.release( b1 );
    b1 = null;
    assertEquals( 0, p.used() );
    Thread.sleep( 15 );
    assertFalse( n1.available );
    assertTrue( n2.available );
   
    n2.available = false;
View Full Code Here

Examples of etch.util.core.nio.ByteBufferPool.used()

    assertTrue( n2.available );
   
    n2.available = false;
    b2 = p.alloc( n2 );
    assertNotNull( b2 );
    assertEquals( 1, p.used() );
    Thread.sleep( 15 );
    assertFalse( n1.available );
    assertFalse( n2.available );
   
    p.release( b2 );
View Full Code Here

Examples of etch.util.core.nio.History.used()

    h.tickle();
    assertEquals( 10, h.suggested() ); // avg(10, 10, 10, 10, 10) == 10
    h.tickle();
    assertEquals( 10, h.suggested() ); // avg(10, 10, 10, 10, 10) == 10
   
    assertTrue( h.used( -10 ) );
    assertEquals( 0, h.getUsed() );
   
    h.tickle();
    assertEquals( 10, h.suggested() ); // avg(10, 10, 10, 10, 10) == 10
    h.tickle();
View Full Code Here

Examples of etch.util.core.nio.History.used()

  @Test
  public void suggested5() throws Exception
  {
    History h = new History( 0, 10, 0 );
    assertEquals( 0, h.suggested() );
    assertTrue( h.used( 5 ) );
    assertEquals( 0, h.suggested() );
    h.tickle();
    assertEquals( 0, h.suggested() );
  }
 
View Full Code Here

Examples of etch.util.core.nio.History.used()

  @Test
  public void used1() throws Exception
  {
    History h = new History( 0, 10, 5 );
    checkUsedAlloc( h, 0, 0 );
    assertTrue( h.used( 1 ) );
    checkUsedAlloc( h, 1, 0 );
    assertTrue( h.used( -1 ) );
    checkUsedAlloc( h, 0, 0 );
  }
 
View Full Code Here

Examples of etch.util.core.nio.History.used()

  {
    History h = new History( 0, 10, 5 );
    checkUsedAlloc( h, 0, 0 );
    assertTrue( h.used( 1 ) );
    checkUsedAlloc( h, 1, 0 );
    assertTrue( h.used( -1 ) );
    checkUsedAlloc( h, 0, 0 );
  }
 
  /** @throws Exception */
  @Test
 
View Full Code Here

Examples of etch.util.core.nio.History.used()

  @Test
  public void used2() throws Exception
  {
    History h = new History( 0, 10, 5 );
    checkUsedAlloc( h, 0, 0 );
    assertTrue( h.used( 2 ) );
    checkUsedAlloc( h, 2, 0 );
    assertTrue( h.used( -2 ) );
    checkUsedAlloc( h, 0, 0 );
  }
 
View Full Code Here

Examples of etch.util.core.nio.History.used()

  {
    History h = new History( 0, 10, 5 );
    checkUsedAlloc( h, 0, 0 );
    assertTrue( h.used( 2 ) );
    checkUsedAlloc( h, 2, 0 );
    assertTrue( h.used( -2 ) );
    checkUsedAlloc( h, 0, 0 );
  }
 
  /** @throws Exception */
  @Test
 
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.