/** * Calculates and adds replica partition stats. */ private void addReplicaStatsOf(RecordStore recordStore, LocalMapOnDemandCalculatedStats onDemandStats) { if (!hasRecords(recordStore)) { return; } long backupEntryCount = 0; long backupEntryMemoryCost = 0; int totalBackupCount = recordStore.getMapContainer().getTotalBackupCount(); for (int replicaNumber = 1; replicaNumber <= totalBackupCount; replicaNumber++) { int partitionId = recordStore.getPartitionId(); Address replicaAddress = getReplicaAddress(partitionId, replicaNumber, totalBackupCount); if (!isReplicaAvailable(replicaAddress, totalBackupCount)) { printWarning(partitionId, replicaNumber); continue; } if (isReplicaOnThisNode(replicaAddress)) { backupEntryMemoryCost += recordStore.getOwnedEntryCost(); backupEntryCount += recordStore.size(); } } if (NATIVE != recordStore.getMapContainer().getMapConfig().getInMemoryFormat()) { onDemandStats.incrementHeapCost(backupEntryMemoryCost); } onDemandStats.incrementBackupEntryMemoryCost(backupEntryMemoryCost); onDemandStats.incrementBackupEntryCount(backupEntryCount); onDemandStats.setBackupCount(recordStore.getMapContainer().getMapConfig().getTotalBackupCount()); }
/** * Calculates and adds replica partition stats. */ private void addReplicaStatsOf(RecordStore recordStore, LocalMapOnDemandCalculatedStats onDemandStats) { if (!hasRecords(recordStore)) { return; } long backupEntryCount = 0; long backupEntryMemoryCost = 0; int totalBackupCount = recordStore.getMapContainer().getTotalBackupCount(); for (int replicaNumber = 1; replicaNumber <= totalBackupCount; replicaNumber++) { int partitionId = recordStore.getPartitionId(); Address replicaAddress = getReplicaAddress(partitionId, replicaNumber, totalBackupCount); if (!isReplicaAvailable(replicaAddress, totalBackupCount)) { printWarning(partitionId, replicaNumber); continue; } if (isReplicaOnThisNode(replicaAddress)) { backupEntryMemoryCost += recordStore.getOwnedEntryCost(); backupEntryCount += recordStore.size(); } } if (NATIVE != recordStore.getMapContainer().getMapConfig().getInMemoryFormat()) { onDemandStats.incrementHeapCost(backupEntryMemoryCost); } onDemandStats.incrementBackupEntryMemoryCost(backupEntryMemoryCost); onDemandStats.incrementBackupEntryCount(backupEntryCount); onDemandStats.setBackupCount(recordStore.getMapContainer().getMapConfig().getTotalBackupCount()); }
private static void addPrimaryStatsOf(RecordStore recordStore, LocalMapOnDemandCalculatedStats onDemandStats) { if (!hasRecords(recordStore)) { return; } LocalRecordStoreStats stats = recordStore.getLocalRecordStoreStats(); onDemandStats.incrementLockedEntryCount(recordStore.getLockedEntryCount()); onDemandStats.incrementHits(stats.getHits()); onDemandStats.incrementDirtyEntryCount(recordStore.getMapDataStore().notFinishedOperationsCount()); onDemandStats.incrementOwnedEntryMemoryCost(recordStore.getOwnedEntryCost()); if (NATIVE != recordStore.getMapContainer().getMapConfig().getInMemoryFormat()) { onDemandStats.incrementHeapCost(recordStore.getOwnedEntryCost()); } onDemandStats.incrementOwnedEntryCount(recordStore.size()); onDemandStats.setLastAccessTime(stats.getLastAccessTime()); onDemandStats.setLastUpdateTime(stats.getLastUpdateTime()); onDemandStats.setBackupCount(recordStore.getMapContainer().getMapConfig().getTotalBackupCount()); }
private static void addPrimaryStatsOf(RecordStore recordStore, LocalMapOnDemandCalculatedStats onDemandStats) { if (!hasRecords(recordStore)) { return; } LocalRecordStoreStats stats = recordStore.getLocalRecordStoreStats(); onDemandStats.incrementLockedEntryCount(recordStore.getLockedEntryCount()); onDemandStats.incrementHits(stats.getHits()); onDemandStats.incrementDirtyEntryCount(recordStore.getMapDataStore().notFinishedOperationsCount()); onDemandStats.incrementOwnedEntryMemoryCost(recordStore.getOwnedEntryCost()); if (NATIVE != recordStore.getMapContainer().getMapConfig().getInMemoryFormat()) { onDemandStats.incrementHeapCost(recordStore.getOwnedEntryCost()); } onDemandStats.incrementOwnedEntryCount(recordStore.size()); onDemandStats.setLastAccessTime(stats.getLastAccessTime()); onDemandStats.setLastUpdateTime(stats.getLastUpdateTime()); onDemandStats.setBackupCount(recordStore.getMapContainer().getMapConfig().getTotalBackupCount()); }