Examples of alloc()


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

  {
    // newAlloc < 0
    History h = new History( 0, 10, 5 );
    checkUsedAlloc( h, 0, 0 );
    // try to underflow
    h.alloc( -1 );
  }
 
  /** @throws Exception */
  @Test( expected = IllegalStateException.class )
  public void alloc7() throws Exception
View Full Code Here

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

  public void alloc7() throws Exception
  {
    // newAlloc < 0
    History h = new History( 0, 10, 5 );
    checkUsedAlloc( h, 0, 0 );
    h.alloc( 1 );
    checkUsedAlloc( h, 0, 1 );
    // try to underflow
    h.alloc( -2 );
  }
 
View Full Code Here

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

    History h = new History( 0, 10, 5 );
    checkUsedAlloc( h, 0, 0 );
    h.alloc( 1 );
    checkUsedAlloc( h, 0, 1 );
    // try to underflow
    h.alloc( -2 );
  }
 
  /** @throws Exception */
  @Test
  public void alloc8() throws Exception
View Full Code Here

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

  @Test
  public void alloc8() throws Exception
  {
    History h = new History( 0, 10, 5 );
    checkUsedAlloc( h, 0, 0 );
    h.alloc( 1 );
    checkUsedAlloc( h, 0, 1 );
    try
    {
      // try to underflow
      h.alloc( -2 );
View Full Code Here

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

    h.alloc( 1 );
    checkUsedAlloc( h, 0, 1 );
    try
    {
      // try to underflow
      h.alloc( -2 );
      fail( "never reached" );
    }
    catch ( IllegalStateException e )
    {
      // make sure alloc was not adjusted...
View Full Code Here

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

  @Test( expected = IllegalArgumentException.class )
  public void alloc9() throws Exception
  {
    // k == 0
    History h = new History( 0, 10, 5 );
    h.alloc( 0 );
  }
 
  /** @throws Exception */
  @Test
  public void suggested1() throws Exception
View Full Code Here

Examples of io.netty.buffer.ByteBuf.alloc()

       
        cos.writeRawVarint32(RAW_BODY_TAG);
        cos.writeRawVarint32(rawBodyLength);
        cos.flush(); // need to flush so that dbody goes after if cos is caching.
       
        CompositeByteBuf cbb = new CompositeByteBuf(buf.alloc(), true, msg.dBodies.length + 1);
        cbb.addComponent(buf);
        int bufLength = buf.readableBytes();
        for(ByteBuf b : msg.dBodies){
          cbb.addComponent(b);
          bufLength += b.readableBytes();
View Full Code Here

Examples of io.netty.buffer.ByteBuf.alloc()

        cos.writeRawVarint32(RAW_BODY_TAG);
        cos.writeRawVarint32(rawBodyLength);
        cos.flush(); // need to flush so that dbody goes after if cos is caching.

        CompositeByteBuf cbb = new CompositeByteBuf(buf.alloc(), true, msg.dBodies.length + 1);
        cbb.addComponent(buf);
        int bufLength = buf.readableBytes();
        for (ByteBuf b : msg.dBodies) {
          cbb.addComponent(b);
          bufLength += b.readableBytes();
View Full Code Here

Examples of io.netty.channel.Channel.alloc()

              + getLength(destination.getScope().getState()) + getLength(config.getInstanceName())
              + getLength(destination.getInstanceName());
      int messageLength = message == null ? 0 : message.readableBytes();

      // Build message header
      ByteBuf headerBuf = channel.alloc().buffer(headerLength);
      headerBuf.writeInt(MESSAGE_VERSION).writeInt(messageType)
          .writeLong(messageId.getMostSignificantBits())
          .writeLong(messageId.getLeastSignificantBits());
      writeStringWithLength(headerBuf, destination.getScope().getCluster());
      writeStringWithLength(headerBuf, destination.getScope().getResource());
View Full Code Here

Examples of io.netty.channel.Channel.alloc()

      writeStringWithLength(headerBuf, config.getInstanceName());
      writeStringWithLength(headerBuf, destination.getInstanceName());

      // Compose message header and payload
      headerBuf.writeInt(messageLength);
      CompositeByteBuf fullByteBuf = channel.alloc().compositeBuffer(2);
      fullByteBuf.addComponent(headerBuf);
      fullByteBuf.writerIndex(headerBuf.readableBytes());
      if (message != null) {
        fullByteBuf.addComponent(message);
        fullByteBuf.writerIndex(fullByteBuf.writerIndex() + message.readableBytes());
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.