Package com.hazelcast.map

Examples of com.hazelcast.map.PartitionContainer


            this.partition = partition;
            this.wrapperComparator = wrapperComparator;
        }

        public Collection<QueryableEntry> call() throws Exception {
            final PartitionContainer container = mapService.getPartitionContainer(partition);
            final RecordStore recordStore = container.getRecordStore(name);
            LinkedList<QueryableEntry> partitionResult = new LinkedList<QueryableEntry>();
            for (Record record : recordStore.getReadonlyRecordMapByWaitingMapStoreLoad().values()) {
                Data key = record.getKey();
                Object value;
                if (record instanceof CachedDataRecord) {
View Full Code Here


            boolean createLazy = true;
            int currentlyRunningCleanupOperationsCount = 0;
            for (int partitionId = 0; partitionId < partitionCount; partitionId++) {
                InternalPartition partition = nodeEngine.getPartitionService().getPartition(partitionId, false);
                if (partition.isOwnerOrBackup(nodeEngine.getThisAddress())) {
                    final PartitionContainer partitionContainer = mapServiceContext.getPartitionContainer(partitionId);
                    if (isContainerEmpty(partitionContainer)) {
                        continue;
                    }
                    if (hasRunningCleanup(partitionContainer)) {
                        currentlyRunningCleanupOperationsCount++;
View Full Code Here

    @Override
    public void run() throws Exception {
        final long now = Clock.currentTimeMillis();
        final MapService mapService = getService();
        final PartitionContainer partitionContainer = mapService.getMapServiceContext().getPartitionContainer(getPartitionId());
        final ConcurrentMap<String, RecordStore> recordStores = partitionContainer.getMaps();
        final boolean isOwnerPartition = isOwner();
        for (final RecordStore recordStore : recordStores.values()) {
            if (recordStore.size() > 0 && recordStore.isExpirable()) {
                recordStore.evictExpiredEntries(expirationPercentage, isOwnerPartition);
            }
View Full Code Here

    }

    @Override
    public void afterRun() throws Exception {
        final MapService mapService = getService();
        final PartitionContainer partitionContainer = mapService.getMapServiceContext().getPartitionContainer(getPartitionId());
        partitionContainer.setHasRunningCleanup(false);
        partitionContainer.setLastCleanupTime(Clock.currentTimeMillis());
    }
View Full Code Here

                if (value != null) {
                    return;
                }
                final Data key = (Data) storeEvent.getSource().getKey();
                final int partitionId = delayedEntry.getPartitionId();
                final PartitionContainer partitionContainer = mapServiceContext.getPartitionContainer(partitionId);
                final RecordStore recordStore = partitionContainer.getExistingRecordStore(mapContainer.getName());
                if (recordStore != null) {
                    recordStore.getMapDataStore().addTransient(key, Clock.currentTimeMillis());
                }
            }
        });
View Full Code Here

            writeBehindProcessor.callAfterStoreListeners(delayedEntries);
        }
    }

    private RecordStore getRecordStoreOrNull(String mapName, int partitionId) {
        final PartitionContainer partitionContainer = mapServiceContext.getPartitionContainer(partitionId);
        return partitionContainer.getExistingRecordStore(mapName);
    }
View Full Code Here

        final InternalPartitionService partitionService = nodeEngine.getPartitionService();
        final int partitionCount = partitionService.getPartitionCount();
        for (int i = 0; i < partitionCount; i++) {
            final Address owner = partitionService.getPartitionOwner(i);
            if (nodeEngine.getThisAddress().equals(owner)) {
                final PartitionContainer container = mapService.getMapServiceContext().getPartitionContainer(i);
                if (container == null) {
                    return false;
                }
                nodeTotalSize += getRecordStoreSize(mapName, container);
                if (nodeTotalSize >= maxSize) {
View Full Code Here

        final NodeEngine nodeEngine = mapService.getMapServiceContext().getNodeEngine();
        final InternalPartitionService partitionService = nodeEngine.getPartitionService();
        for (int i = 0; i < partitionService.getPartitionCount(); i++) {
            final Address owner = partitionService.getPartitionOwner(i);
            if (nodeEngine.getThisAddress().equals(owner)) {
                final PartitionContainer container = mapService.getMapServiceContext().getPartitionContainer(i);
                if (container == null) {
                    return false;
                }
                final int size = getRecordStoreSize(mapName, container);
                if (size >= maxSize) {
View Full Code Here

        final NodeEngine nodeEngine = mapService.getMapServiceContext().getNodeEngine();
        final Address thisAddress = nodeEngine.getThisAddress();
        for (int i = 0; i < nodeEngine.getPartitionService().getPartitionCount(); i++) {
            InternalPartition partition = nodeEngine.getPartitionService().getPartition(i, false);
            if (partition.isOwnerOrBackup(thisAddress)) {
                final PartitionContainer container = mapService.getMapServiceContext().getPartitionContainer(i);
                if (container == null) {
                    return -1L;
                }
                heapCost += getRecordStoreHeapCost(mapName, container);
            }
View Full Code Here

TOP

Related Classes of com.hazelcast.map.PartitionContainer

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.