Examples of capacity()


Examples of org.apache.lucene.util.OpenBitSet.capacity()

        OpenBitSet result = new OpenBitSet(reader.maxDoc());

        OpenBitSet docsHit = ((lucandra.IndexReader) reader).getDocsHit();      
      
        List<ByteBuffer> filteredValues = new ArrayList<ByteBuffer>();
        for(int i=0; i<docsHit.capacity(); i++){         
            if(docsHit.fastGet(i))
                filteredValues.add(ByteBuffer.wrap(CassandraUtils.writeVInt(i)));
        }

        if (filteredValues.size() == 0)
View Full Code Here

Examples of org.apache.mina.common.ByteBuffer.capacity()

  public CacheableImpl(Object obj) {
    ByteBuffer tmp = ByteBuffer.allocate(1024, true);
    tmp.setAutoExpand(true);
    tmp.putObject(obj);
    bytes = new byte[tmp.capacity()];
    tmp.get(bytes);
    cached = true;
    tmp.release();
    tmp = null;
  }
View Full Code Here

Examples of org.apache.mina.core.buffer.IoBuffer.capacity()

    public void testAllocate() throws Exception {
        for (int i = 10; i < 1048576 * 2; i = i * 11 / 10) // increase by 10%
        {
            IoBuffer buf = IoBuffer.allocate(i);
            assertEquals(0, buf.position());
            assertEquals(buf.capacity(), buf.remaining());
            assertTrue(buf.capacity() >= i);
            assertTrue(buf.capacity() < i * 2);
        }
    }

View Full Code Here

Examples of org.apache.pig.PigServer.capacity()

    public void testPigServer() throws Throwable {
        log.debug("creating pig server");
        PigContext pigContext = new PigContext(ExecType.MAPREDUCE, cluster.getProperties());
        PigServer pig = new PigServer(pigContext);
        System.out.println("testing capacity");
        long capacity = pig.capacity();
        assertTrue(capacity > 0);
        String sampleFileName = "/tmp/fileTest";
        if (!pig.existsFile(sampleFileName)) {
            ElementDescriptor path = pigContext.getDfs().asElement(sampleFileName);
            OutputStream os = path.create();
View Full Code Here

Examples of org.directmemory.memory.OffHeapMemoryBuffer.capacity()

  }

  public void rawInsert(int megabytes, int howMany) {
    OffHeapMemoryBuffer mem = OffHeapMemoryBuffer.createNew(megabytes * 1024 * 1024);
    assertNotNull(mem);
    int size = mem.capacity() / (howMany);
    size -= size / 100 * 1;
    logger.info("payload size=" + size);
    logger.info("entries=" + howMany);

    logger.info("starting...");
View Full Code Here

Examples of org.elasticsearch.common.netty.buffer.ChannelBuffer.capacity()

        final int payloadSize = 100;
        int CYCLE_SIZE = 50000;
        final long NUMBER_OF_ITERATIONS = 500000;

        ChannelBuffer message = ChannelBuffers.buffer(100);
        for (int i = 0; i < message.capacity(); i++) {
            message.writeByte((byte) i);
        }

        // Configure the server.
        ServerBootstrap serverBootstrap = new ServerBootstrap(
View Full Code Here

Examples of org.glassfish.grizzly.Buffer.capacity()

        Connection<?> connection = context.getConnection();
        Channel channel = GrizzlyChannel.getOrAddChannel(connection, url, handler);
        try {
            if (message instanceof Buffer) { // 收到新的数据包
                Buffer buffer = (Buffer) message; // 缓存
                int readable = buffer.capacity(); // 本次可读取新数据的大小
                if (readable == 0) {
                    return context.getStopAction();
                }
                byte[] bytes; // byte[]缓存区,将Buffer转成byte[],再转成UnsafeByteArrayInputStream
                int offset; // 指向已用数据的偏移量,off之前的数据都是已用过的
View Full Code Here

Examples of org.gudy.azureus2.core3.util.DirectByteBuffer.capacity()

           
          }else{
           
            read_buffer.position(DirectByteBuffer.SS_PROXY, 0);
           
            read_buffer.limit( DirectByteBuffer.SS_PROXY, read_buffer.capacity(DirectByteBuffer.SS_PROXY));
          }
        }
      }
     
      return( len > 0 );
View Full Code Here

Examples of org.gudy.azureus2.core3.util.DirectByteBuffer.capacity()

       
      }else{
       
        read_buffer.position(DirectByteBuffer.SS_PROXY,0);
       
        read_buffer.limit( DirectByteBuffer.SS_PROXY, read_buffer.capacity(DirectByteBuffer.SS_PROXY));
       
        connection.requestReadSelect( chan2 );
      }
     
      return( written > 0 );
View Full Code Here

Examples of org.hornetq.api.core.HornetQBuffer.capacity()

         file.read(directBuffer);

         directBuffer.rewind();

         fileBuffer = HornetQBuffers.wrappedBuffer(directBuffer);
         fileBuffer.writerIndex(fileBuffer.capacity());

         while (fileBuffer.readable())
         {
            final int position = fileBuffer.readerIndex();
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.