Package eu.stratosphere.runtime.io.network.bufferprovider.BufferProvider

Examples of eu.stratosphere.runtime.io.network.bufferprovider.BufferProvider.BufferAvailabilityRegistration


    Buffer[] requestedBuffers = new Buffer[NUM_BUFFERS];
    for (int i = 0; i < NUM_BUFFERS; i++) {
      requestedBuffers[i] = bufferPool.requestBuffer(BUFFER_SIZE);
    }

    BufferAvailabilityRegistration registration;
    // --------------------------------------------------------------------
    // 1. success
    // --------------------------------------------------------------------
    registration = bufferPool.registerBufferAvailabilityListener(listener);
    Assert.assertEquals(BufferAvailabilityRegistration.SUCCEEDED_REGISTERED, registration);
View Full Code Here


    }

    BufferAvailabilityListener listener = mock(BufferAvailabilityListener.class);
    doAnswer(RECYCLING_BUFFER_AVAILABLE_ANSWER).when(listener).bufferAvailable(Matchers.<Buffer>anyObject());

    BufferAvailabilityRegistration registration = bufferPool.registerBufferAvailabilityListener(listener);
    Assert.assertEquals(BufferAvailabilityRegistration.SUCCEEDED_REGISTERED, registration);

    // reduce number of designated buffers and recycle all buffers
    bufferPool.setNumDesignatedBuffers(bufferPool.numDesignatedBuffers() - 1);
View Full Code Here

TOP

Related Classes of eu.stratosphere.runtime.io.network.bufferprovider.BufferProvider.BufferAvailabilityRegistration

Copyright © 2018 www.massapicom. 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.