@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; } }
@Override public void recoverMessageStoreStatistics() throws IOException { int count = 0; synchronized(indexMutex) { count = pageFile.tx().execute(new Transaction.CallableClosure<Integer, IOException>(){ @Override public Integer execute(Transaction tx) throws IOException { // Iterate through all index entries to get a count of messages in the destination. StoredDestination sd = getStoredDestination(dest, tx); int rc=0; for (Iterator<Entry<String, Long>> iterator = sd.messageIdIndex.iterator(tx); iterator.hasNext();) { iterator.next(); rc++; } return rc; } }); } getMessageStoreStatistics().getMessageCount().setCount(count); }
@Override public void recoverMessageStoreStatistics() throws IOException { synchronized (messageTable) { long size = 0; int count = 0; for (Message message : messageTable.values()) { size += message.getSize(); } getMessageStoreStatistics().reset(); getMessageStoreStatistics().getMessageCount().setCount(count); getMessageStoreStatistics().getMessageSize().setTotalSize(size); } }
getMessageStoreStatistics().getMessageCount().setCount(recoveredStatistics.getMessageCount().getCount()); getMessageStoreStatistics().getMessageSize().setTotalSize(recoveredStatistics.getMessageSize().getTotalSize()); } finally {
@Override public void recoverMessageStoreStatistics() throws IOException { int count = 0; synchronized(indexMutex) { count = pageFile.tx().execute(new Transaction.CallableClosure<Integer, IOException>(){ @Override public Integer execute(Transaction tx) throws IOException { // Iterate through all index entries to get a count of messages in the destination. StoredDestination sd = getStoredDestination(dest, tx); int rc=0; for (Iterator<Entry<String, Long>> iterator = sd.messageIdIndex.iterator(tx); iterator.hasNext();) { iterator.next(); rc++; } return rc; } }); } getMessageStoreStatistics().getMessageCount().setCount(count); }
@Override public void recoverMessageStoreStatistics() throws IOException { int count = 0; synchronized(indexMutex) { count = pageFile.tx().execute(new Transaction.CallableClosure<Integer, IOException>(){ @Override public Integer execute(Transaction tx) throws IOException { // Iterate through all index entries to get a count of messages in the destination. StoredDestination sd = getStoredDestination(dest, tx); int rc=0; for (Iterator<Entry<String, Long>> iterator = sd.messageIdIndex.iterator(tx); iterator.hasNext();) { iterator.next(); rc++; } return rc; } }); } getMessageStoreStatistics().getMessageCount().setCount(count); }
@Override public void recoverMessageStoreStatistics() throws IOException { int count = 0; synchronized(indexMutex) { count = pageFile.tx().execute(new Transaction.CallableClosure<Integer, IOException>(){ @Override public Integer execute(Transaction tx) throws IOException { // Iterate through all index entries to get a count of messages in the destination. StoredDestination sd = getStoredDestination(dest, tx); int rc=0; for (Iterator<Entry<String, Long>> iterator = sd.messageIdIndex.iterator(tx); iterator.hasNext();) { iterator.next(); rc++; } return rc; } }); } getMessageStoreStatistics().getMessageCount().setCount(count); }
@Override public void recoverMessageStoreStatistics() throws IOException { synchronized (messageTable) { long size = 0; int count = 0; for (Message message : messageTable.values()) { size += message.getSize(); } getMessageStoreStatistics().reset(); getMessageStoreStatistics().getMessageCount().setCount(count); getMessageStoreStatistics().getMessageSize().setTotalSize(size); } }
@Override public void recoverMessageStoreStatistics() throws IOException { synchronized (messageTable) { long size = 0; int count = 0; for (Message message : messageTable.values()) { size += message.getSize(); } getMessageStoreStatistics().reset(); getMessageStoreStatistics().getMessageCount().setCount(count); getMessageStoreStatistics().getMessageSize().setTotalSize(size); } }
@Override public void recoverMessageStoreStatistics() throws IOException { synchronized (messageTable) { long size = 0; int count = 0; for (Message message : messageTable.values()) { size += message.getSize(); } getMessageStoreStatistics().reset(); getMessageStoreStatistics().getMessageCount().setCount(count); getMessageStoreStatistics().getMessageSize().setTotalSize(size); } }
public void purge() throws Exception { ConnectionContext c = createConnectionContext(); List<MessageReference> list = null; do { doPageIn(true); pagedInMessagesLock.readLock().lock(); try { list = new ArrayList<MessageReference>(pagedInMessages.values()); }finally { pagedInMessagesLock.readLock().unlock(); } for (MessageReference ref : list) { try { QueueMessageReference r = (QueueMessageReference) ref; removeMessage(c, r); } catch (IOException e) { } } // don't spin/hang if stats are out and there is nothing left in the // store } while (!list.isEmpty() && this.destinationStatistics.getMessages().getCount() > 0); if (this.destinationStatistics.getMessages().getCount() > 0) { LOG.warn(getActiveMQDestination().getQualifiedName() + " after purge complete, message count stats report: " + this.destinationStatistics.getMessages().getCount()); } gc(); this.destinationStatistics.getMessages().setCount(0); getMessages().clear(); }
getMessageStoreStatistics().getMessageCount().setCount(recoveredStatistics.getMessageCount().getCount()); getMessageStoreStatistics().getMessageSize().setTotalSize(recoveredStatistics.getMessageSize().getTotalSize()); } finally {
getMessageStoreStatistics().getMessageCount().setCount(recoveredStatistics.getMessageCount().getCount()); getMessageStoreStatistics().getMessageSize().setTotalSize(recoveredStatistics.getMessageSize().getTotalSize()); } finally {
getMessageStoreStatistics().getMessageCount().setCount(recoveredStatistics.getMessageCount().getCount()); getMessageStoreStatistics().getMessageSize().setTotalSize(recoveredStatistics.getMessageSize().getTotalSize()); } finally {
} else { int messageCount = store.getMessageCount(); destinationStatistics.getMessages().setCount(messageCount);