@Override public MessageStoreStatistics readPayload(final DataInput dataIn) throws IOException { if (!dataIn.readBoolean()) { return null; } MessageStoreStatistics messageStoreStatistics = new MessageStoreStatistics(); messageStoreStatistics.getMessageCount().setCount(dataIn.readLong()); messageStoreStatistics.getMessageSize().setTotalSize(dataIn.readLong()); messageStoreStatistics.getMessageSize().setMaxSize(dataIn.readLong()); messageStoreStatistics.getMessageSize().setMinSize(dataIn.readLong()); messageStoreStatistics.getMessageSize().setCount(dataIn.readLong()); return messageStoreStatistics; } }
protected void incrementAndAddSizeToStoreStat(Transaction tx, String kahaDestKey, StoredDestination sd, long size) throws IOException { MessageStoreStatistics storeStats = getStoreStats(kahaDestKey); if (storeStats != null) { incrementAndAddSizeToStoreStat(size, storeStats); sd.messageStoreStatistics.put(tx, storeStats); } else if (sd != null){ // During the recovery the storeStats is null MessageStoreStatistics storedStoreStats = sd.messageStoreStatistics.get(tx); if (storedStoreStats == null) { storedStoreStats = new MessageStoreStatistics(); } incrementAndAddSizeToStoreStat(size, storedStoreStats); sd.messageStoreStatistics.put(tx, storedStoreStats); } }
protected void decrementAndSubSizeToStoreStat(Transaction tx, String kahaDestKey, StoredDestination sd, long size) throws IOException { MessageStoreStatistics storeStats = getStoreStats(kahaDestKey); if (storeStats != null) { decrementAndSubSizeToStoreStat(size, storeStats); sd.messageStoreStatistics.put(tx, storeStats); } else if (sd != null){ // During the recovery the storeStats is null MessageStoreStatistics storedStoreStats = sd.messageStoreStatistics.get(tx); if (storedStoreStats == null) { storedStoreStats = new MessageStoreStatistics(); } decrementAndSubSizeToStoreStat(size, storedStoreStats); sd.messageStoreStatistics.put(tx, storedStoreStats); } }