Examples of MemoryManager


Examples of org.apache.flink.runtime.memorymanager.MemoryManager

      UnilateralSortMerger<String> sorter = null;
      BufferedReader reader = null;
      BufferedReader verifyReader = null;
     
      try {
        MemoryManager mm = new DefaultMemoryManager(1024 * 1024, 1);
        IOManager ioMan = new IOManager();
         
        TypeSerializer<String> serializer = StringSerializer.INSTANCE;
        TypeComparator<String> comparator = new StringComparator(true);
       
View Full Code Here

Examples of org.apache.flink.runtime.memorymanager.MemoryManager

      UnilateralSortMerger<Tuple2<String, String[]>> sorter = null;
      BufferedReader reader = null;
      BufferedReader verifyReader = null;
     
      try {
        MemoryManager mm = new DefaultMemoryManager(1024 * 1024, 1);
        IOManager ioMan = new IOManager();
         
        TupleTypeInfo<Tuple2<String, String[]>> typeInfo = (TupleTypeInfo<Tuple2<String, String[]>>) (TupleTypeInfo<?>) TypeInfoParser.parse("Tuple2<String, String[]>");

        TypeSerializer<Tuple2<String, String[]>> serializer = typeInfo.createSerializer();
View Full Code Here

Examples of org.apache.phoenix.memory.MemoryManager

        Tuple[] expectedResults = new Tuple[] {
                new SingleKeyValueTuple(new KeyValue(A, SINGLE_COLUMN_FAMILY, SINGLE_COLUMN, Bytes.toBytes(1))),
                new SingleKeyValueTuple(new KeyValue(B, SINGLE_COLUMN_FAMILY, SINGLE_COLUMN, Bytes.toBytes(1))),
            };

        MemoryManager memoryManager = new DelegatingMemoryManager(new GlobalMemoryManager(threshold, 0));
        ResultIterator scanner = new SpoolingResultIterator(iterator, memoryManager, threshold, maxSizeSpool);
        AssertResults.assertResults(scanner, expectedResults);
    }
View Full Code Here

Examples of org.glassfish.grizzly.memory.MemoryManager

        final AtomicInteger counter = new AtomicInteger();
       
        return new ThreadFactory() {
            @Override
            public Thread newThread(Runnable r) {
                final MemoryManager mm = config.getMemoryManager();
                final ThreadLocalPoolProvider threadLocalPoolProvider;
               
                if (mm instanceof ThreadLocalPoolProvider) {
                    threadLocalPoolProvider = (ThreadLocalPoolProvider) mm;
                } else {
View Full Code Here

Examples of org.glassfish.grizzly.memory.MemoryManager

    }

    public static Buffer allocateAndReadBuffer(final TCPNIOConnection connection)
            throws IOException {
       
        final MemoryManager memoryManager =
                connection.getTransport().getMemoryManager();
       
        int read;
        Throwable error = null;
        Buffer buffer = null;
       
        try {
            final int receiveBufferSize =
                    Math.min(TCPNIOTransport.MAX_RECEIVE_BUFFER_SIZE,
                            connection.getReadBufferSize());
       
            if (!memoryManager.willAllocateDirect(receiveBufferSize)) {
                final DirectByteBufferRecord ioRecord =
                        DirectByteBufferRecord.get();
                final ByteBuffer directByteBuffer =
                        ioRecord.allocate(receiveBufferSize);
               
                try {
                    read = readSimpleByteBuffer(connection, directByteBuffer);
                    if (read > 0) {
                        directByteBuffer.flip();
                        buffer = memoryManager.allocate(read);
                        buffer.put(directByteBuffer);
                    }
                } finally {
                    ioRecord.release();
                }
            } else {
                buffer = memoryManager.allocateAtLeast(receiveBufferSize);
                read = readBuffer(connection, buffer);
            }
        } catch (Throwable e) {
            error = e;
            read = -1;
View Full Code Here

Examples of org.glassfish.grizzly.memory.MemoryManager

        return new SslResult(output, sslEngineResult);
    }

    Buffer wrapAll(final Buffer input,
            final Allocator allocator) throws SSLException {
        final MemoryManager memoryManager =
                connection.getTransport().getMemoryManager();
       
        final ByteBufferArray bba =
                input.toByteBufferArray(inputByteBufferArray);
        final ByteBuffer[] inputArray = bba.getArray();
View Full Code Here

Examples of org.glassfish.grizzly.memory.MemoryManager

    }


    @Override
    protected TransformationResult<Buffer, Buffer> transformImpl(AttributeStorage storage, Buffer input) throws TransformationException {
        final MemoryManager memoryManager = obtainMemoryManager(storage);
        final LZMAOutputState state = (LZMAOutputState) obtainStateObject(storage);

        if (!state.isInitialized()) {
            initializeOutput(state);
        }
View Full Code Here

Examples of org.glassfish.grizzly.memory.MemoryManager

        return input.hasRemaining();
    }

    @Override
    protected TransformationResult<Buffer, Buffer> transformImpl(AttributeStorage storage, Buffer input) throws TransformationException {
        final MemoryManager memoryManager = obtainMemoryManager(storage);

        final LZMAInputState state = (LZMAInputState) obtainStateObject(storage);
        state.setMemoryManager(memoryManager);

        Buffer decodedBuffer = null;
View Full Code Here

Examples of org.glassfish.grizzly.memory.MemoryManager

    }

    @Override
    protected TransformationResult<Buffer, Buffer> transformImpl(
            AttributeStorage storage, Buffer input) throws TransformationException {
        final MemoryManager memoryManager = obtainMemoryManager(storage);

        final GZipInputState state = (GZipInputState) obtainStateObject(storage);

        if (!state.isInitialized()) {
            if (!initializeInput(input, state)) {
View Full Code Here

Examples of org.glassfish.grizzly.memory.MemoryManager

     */
    @Override
    protected TransformationResult<Buffer, Buffer> transformImpl(
            AttributeStorage storage, Buffer input) throws TransformationException {

        final MemoryManager memoryManager = obtainMemoryManager(storage);
        final GZipOutputState state = (GZipOutputState) obtainStateObject(storage);

        if (!state.isInitialized) {
            state.initialize();
        }
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.