@Test public void testGetLastCommittedTransactionTime() throws Exception { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); Assert.assertEquals(shardStats.getLastCommittedTransactionTime(), sdf.format(new Date(0L))); long millis = System.currentTimeMillis(); shardStats.setLastCommittedTransactionTime(millis); Object attribute = mbeanServer.getAttribute(testMBeanName, "LastCommittedTransactionTime"); Assert.assertEquals(attribute, sdf.format(new Date(millis))); Assert.assertNotEquals(attribute, sdf.format(new Date(millis - 1))); }
@Override public String getLastCommittedTransactionTime() { return formatMillis(lastCommittedTransactionTime); }
ShardStats extends AbstractMXBean implements ShardStatsMXBean { @Override public String getLastCommittedTransactionTime() { return formatMillis(lastCommittedTransactionTime); } }
ShardStats extends AbstractMXBean implements ShardStatsMXBean { @Override public String getLastCommittedTransactionTime() { return formatMillis(lastCommittedTransactionTime); } ShardStats(final String shardName, final String mxBeanType, final @Nullable Shard shard); }
ShardStats extends AbstractMXBean implements ShardStatsMXBean { @Override public String getLastCommittedTransactionTime() { return formatMillis(lastCommittedTransactionTime); } ShardStats(final String shardName, final String mxBeanType, final @Nullable Shard shard); @Override String getShardName(); @Override long getCommittedTransactionsCount(); @Override String getLeader(); @Override String getRaftState(); @Override long getReadOnlyTransactionCount(); @Override long getReadWriteTransactionCount(); @Override long getLastLogIndex(); @Override long getLastLogTerm(); @Override long getCurrentTerm(); @Override long getCommitIndex(); @Override long getLastApplied(); @Override long getLastIndex(); @Override long getLastTerm(); @Override long getSnapshotIndex(); @Override long getSnapshotTerm(); @Override long getReplicatedToAllIndex(); @Override String getVotedFor(); @Override boolean isVoting(); @Override String getPeerVotingStates(); @Override boolean isSnapshotCaptureInitiated(); @Override String getLastCommittedTransactionTime(); @Override long getFailedTransactionsCount(); @Override long getFailedReadTransactionsCount(); @Override long getAbortTransactionsCount(); long incrementCommittedTransactionCount(); long incrementReadOnlyTransactionCount(); long incrementReadWriteTransactionCount(); long incrementFailedTransactionsCount(); long incrementFailedReadTransactionsCount(); long incrementAbortTransactionsCount(); void setLastCommittedTransactionTime(final long lastCommittedTransactionTime); @Override long getInMemoryJournalDataSize(); @Override long getInMemoryJournalLogSize(); @Override void resetTransactionCounters(); void setFollowerInitialSyncStatus(final boolean followerInitialSyncStatus); @Override boolean getFollowerInitialSyncStatus(); @Override List<FollowerInfo> getFollowerInfo(); @Override String getPeerAddresses(); @Override String getStatRetrievalTime(); @Override String getStatRetrievalError(); @Override long getLeadershipChangeCount(); void incrementLeadershipChangeCount(); @Override String getLastLeadershipChangeTime(); @Override int getPendingTxCommitQueueSize(); @Override int getTxCohortCacheSize(); @Override void captureSnapshot(); }
ShardStats extends AbstractMXBean implements ShardStatsMXBean { @Override public String getLastCommittedTransactionTime() { return formatMillis(lastCommittedTransactionTime); } ShardStats(final String shardName, final String mxBeanType, final @Nullable Shard shard); @Override String getShardName(); @Override long getCommittedTransactionsCount(); @Override String getLeader(); @Override String getRaftState(); @Override long getReadOnlyTransactionCount(); @Override long getReadWriteTransactionCount(); @Override long getLastLogIndex(); @Override long getLastLogTerm(); @Override long getCurrentTerm(); @Override long getCommitIndex(); @Override long getLastApplied(); @Override long getLastIndex(); @Override long getLastTerm(); @Override long getSnapshotIndex(); @Override long getSnapshotTerm(); @Override long getReplicatedToAllIndex(); @Override String getVotedFor(); @Override boolean isVoting(); @Override String getPeerVotingStates(); @Override boolean isSnapshotCaptureInitiated(); @Override String getLastCommittedTransactionTime(); @Override long getFailedTransactionsCount(); @Override long getFailedReadTransactionsCount(); @Override long getAbortTransactionsCount(); long incrementCommittedTransactionCount(); long incrementReadOnlyTransactionCount(); long incrementReadWriteTransactionCount(); long incrementFailedTransactionsCount(); long incrementFailedReadTransactionsCount(); long incrementAbortTransactionsCount(); void setLastCommittedTransactionTime(final long lastCommittedTransactionTime); @Override long getInMemoryJournalDataSize(); @Override long getInMemoryJournalLogSize(); @Override void resetTransactionCounters(); void setFollowerInitialSyncStatus(final boolean followerInitialSyncStatus); @Override boolean getFollowerInitialSyncStatus(); @Override List<FollowerInfo> getFollowerInfo(); @Override String getPeerAddresses(); @Override String getStatRetrievalTime(); @Override String getStatRetrievalError(); @Override long getLeadershipChangeCount(); void incrementLeadershipChangeCount(); @Override String getLastLeadershipChangeTime(); @Override int getPendingTxCommitQueueSize(); @Override int getTxCohortCacheSize(); @Override void captureSnapshot(); static final String JMX_CATEGORY_SHARD; }