Package com.hazelcast.map.impl

Examples of com.hazelcast.map.impl.DefaultMapServiceContext


    private void setMockRuntimeMemoryInfoAccessor(IMap map, final long totalMemoryMB, final long freeMemoryMB, final long maxMemoryMB) {
        final MapProxyImpl mapProxy = (MapProxyImpl) map;
        final MapService mapService = (MapService) mapProxy.getService();
        final MapServiceContext mapServiceContext = mapService.getMapServiceContext();
        final DefaultMapServiceContext defaultMapServiceContext = (DefaultMapServiceContext) mapServiceContext;
        final EvictionOperator evictionOperator = EvictionOperator.create(new MemoryInfoAccessor() {
            @Override
            public long getTotalMemory() {
                return convertMegaBytesToBytes(totalMemoryMB);
            }

            @Override
            public long getFreeMemory() {
                return convertMegaBytesToBytes(freeMemoryMB);
            }

            @Override
            public long getMaxMemory() {
                return convertMegaBytesToBytes(maxMemoryMB);
            }
        }, mapServiceContext);

        defaultMapServiceContext.setEvictionOperator(evictionOperator);
    }
View Full Code Here

TOP

Related Classes of com.hazelcast.map.impl.DefaultMapServiceContext

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.