Package org.apache.ignite.internal
Class TransactionsMXBeanImpl
- java.lang.Object
-
- org.apache.ignite.internal.TransactionsMXBeanImpl
-
- All Implemented Interfaces:
TransactionsMXBean
public class TransactionsMXBeanImpl extends Object implements TransactionsMXBean
TransactionsMXBean implementation.
-
-
Constructor Summary
Constructors Constructor Description TransactionsMXBeanImpl(GridKernalContext ctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel(String xid)Kills transactions by the xid.StringgetActiveTransactions(Long minDuration, Integer minSize, String prj, String consistentIds, String xid, String lbRegex, Integer limit, String order, boolean detailed, boolean kill)longgetLongOperationsDumpTimeout()Returns a timeout (in millis) for printing long-running transactions as well as transactions that cannot receive locks for all their keys for a long time.longgetLongTransactionTimeDumpThreshold()Returns threshold timeout in milliseconds for long transactions, if transaction exceeds it, it will be dumped in log with information about how much time did it spent in system time (time while aquiring locks, preparing, commiting, etc.)doublegetTransactionTimeDumpSamplesCoefficient()Returns the coefficient for samples of completed transactions that will be dumped in log.intgetTransactionTimeDumpSamplesPerSecondLimit()Returns the limit of samples of completed transactions that will be dumped in log per second, ifTransactionsMXBean.getTransactionTimeDumpSamplesCoefficient()is above0.0.intgetTxKeyCollisionsInterval()booleangetTxOwnerDumpRequestsAllowed()Shows if dump requests from local node to near node are allowed, when long running transaction is found.longgetTxTimeoutOnPartitionMapExchange()Gets transaction timeout on partition map exchange.voidsetLongOperationsDumpTimeout(long timeout)Setting a timeout (in millis) for printing long-running transactions as well as transactions that cannot receive locks for all their keys for a long time.voidsetLongTransactionTimeDumpThreshold(long threshold)Sets threshold timeout in milliseconds for long transactions, if transaction exceeds it, it will be dumped in log with information about how much time did it spent in system time (time while aquiring locks, preparing, commiting, etc.)voidsetTransactionTimeDumpSamplesCoefficient(double coefficient)Sets the coefficient for samples of completed transactions that will be dumped in log.voidsetTransactionTimeDumpSamplesPerSecondLimit(int limit)Sets the limit of samples of completed transactions that will be dumped in log per second, ifTransactionsMXBean.getTransactionTimeDumpSamplesCoefficient()is above0.0.voidsetTxKeyCollisionsInterval(int timeout)Set timeout interval for tx key contention analysis.voidsetTxOwnerDumpRequestsAllowed(boolean allowed)Sets if dump requests from local node to near node are allowed, when long running transaction is found.voidsetTxTimeoutOnPartitionMapExchange(long timeout)Sets transaction timeout on partition map exchange.StringtoString()
-
-
-
Constructor Detail
-
TransactionsMXBeanImpl
public TransactionsMXBeanImpl(GridKernalContext ctx)
- Parameters:
ctx- Context.
-
-
Method Detail
-
getActiveTransactions
public String getActiveTransactions(Long minDuration, Integer minSize, String prj, String consistentIds, String xid, String lbRegex, Integer limit, String order, boolean detailed, boolean kill)
- Specified by:
getActiveTransactionsin interfaceTransactionsMXBean- Parameters:
minDuration- Minimum duration.minSize- Minimum size.prj- Projection.consistentIds- Consistent ids.xid- Xid.lbRegex- Label regex.limit- Limit.order- Order.detailed- Detailed.kill- Kill.- Returns:
- If
detailedflag is set - description of each transaction, else transactions count. - See Also:
CommandMBean
-
cancel
public void cancel(String xid)
Kills transactions by the xid.- Specified by:
cancelin interfaceTransactionsMXBean- Parameters:
xid- Transaction xid.- See Also:
TransactionView.xid(),CommandMBean
-
getTxTimeoutOnPartitionMapExchange
public long getTxTimeoutOnPartitionMapExchange()
Gets transaction timeout on partition map exchange.- Specified by:
getTxTimeoutOnPartitionMapExchangein interfaceTransactionsMXBean- Returns:
- Transaction timeout on partition map exchange in milliseconds.
- See Also:
TransactionConfiguration.getTxTimeoutOnPartitionMapExchange()
-
setTxTimeoutOnPartitionMapExchange
public void setTxTimeoutOnPartitionMapExchange(long timeout)
Sets transaction timeout on partition map exchange.If not set, default value is
TransactionConfiguration.TX_TIMEOUT_ON_PARTITION_MAP_EXCHANGEwhich means transactions will never be rolled back on partition map exchange.- Specified by:
setTxTimeoutOnPartitionMapExchangein interfaceTransactionsMXBean- Parameters:
timeout- Transaction timeout on partition map exchange in milliseconds.- See Also:
TransactionConfiguration.setTxTimeoutOnPartitionMapExchange(long)
-
getTxOwnerDumpRequestsAllowed
public boolean getTxOwnerDumpRequestsAllowed()
Shows if dump requests from local node to near node are allowed, when long running transaction is found. If allowed, the compute request to near node will be made to get thread dump of transaction owner thread.- Specified by:
getTxOwnerDumpRequestsAllowedin interfaceTransactionsMXBean- Returns:
trueif allowed,falseotherwise.
-
setTxOwnerDumpRequestsAllowed
public void setTxOwnerDumpRequestsAllowed(boolean allowed)
Sets if dump requests from local node to near node are allowed, when long running transaction is found. If allowed, the compute request to near node will be made to get thread dump of transaction owner thread.- Specified by:
setTxOwnerDumpRequestsAllowedin interfaceTransactionsMXBean- Parameters:
allowed- whether to allow
-
getLongTransactionTimeDumpThreshold
public long getLongTransactionTimeDumpThreshold()
Returns threshold timeout in milliseconds for long transactions, if transaction exceeds it, it will be dumped in log with information about how much time did it spent in system time (time while aquiring locks, preparing, commiting, etc.) and user time (time when client node runs some code while holding transaction). Returns 0 if not set. No transactions are dumped in log if this parameter is not set.- Specified by:
getLongTransactionTimeDumpThresholdin interfaceTransactionsMXBean- Returns:
- Threshold.
-
setLongTransactionTimeDumpThreshold
public void setLongTransactionTimeDumpThreshold(long threshold)
Sets threshold timeout in milliseconds for long transactions, if transaction exceeds it, it will be dumped in log with information about how much time did it spent in system time (time while aquiring locks, preparing, commiting, etc.) and user time (time when client node runs some code while holding transaction). Can be set to 0 - no transactions will be dumped in log in this case.- Specified by:
setLongTransactionTimeDumpThresholdin interfaceTransactionsMXBean- Parameters:
threshold- Threshold.
-
getTransactionTimeDumpSamplesCoefficient
public double getTransactionTimeDumpSamplesCoefficient()
Returns the coefficient for samples of completed transactions that will be dumped in log.- Specified by:
getTransactionTimeDumpSamplesCoefficientin interfaceTransactionsMXBean- Returns:
- Coefficient current value.
-
setTransactionTimeDumpSamplesCoefficient
public void setTransactionTimeDumpSamplesCoefficient(double coefficient)
Sets the coefficient for samples of completed transactions that will be dumped in log.- Specified by:
setTransactionTimeDumpSamplesCoefficientin interfaceTransactionsMXBean- Parameters:
coefficient- Coefficient.
-
getTransactionTimeDumpSamplesPerSecondLimit
public int getTransactionTimeDumpSamplesPerSecondLimit()
Returns the limit of samples of completed transactions that will be dumped in log per second, ifTransactionsMXBean.getTransactionTimeDumpSamplesCoefficient()is above0.0. Must be integer value greater than0.- Specified by:
getTransactionTimeDumpSamplesPerSecondLimitin interfaceTransactionsMXBean- Returns:
- Limit value.
-
setTransactionTimeDumpSamplesPerSecondLimit
public void setTransactionTimeDumpSamplesPerSecondLimit(int limit)
Sets the limit of samples of completed transactions that will be dumped in log per second, ifTransactionsMXBean.getTransactionTimeDumpSamplesCoefficient()is above0.0. Must be integer value greater than0.- Specified by:
setTransactionTimeDumpSamplesPerSecondLimitin interfaceTransactionsMXBean- Parameters:
limit- Limit value.
-
setLongOperationsDumpTimeout
public void setLongOperationsDumpTimeout(long timeout)
Setting a timeout (in millis) for printing long-running transactions as well as transactions that cannot receive locks for all their keys for a long time. Set less than or equal0to disable.- Specified by:
setLongOperationsDumpTimeoutin interfaceTransactionsMXBean- Parameters:
timeout- Timeout.
-
getLongOperationsDumpTimeout
public long getLongOperationsDumpTimeout()
Returns a timeout (in millis) for printing long-running transactions as well as transactions that cannot receive locks for all their keys for a long time. Returns0or less if not set.- Specified by:
getLongOperationsDumpTimeoutin interfaceTransactionsMXBean- Returns:
- Timeout.
-
setTxKeyCollisionsInterval
public void setTxKeyCollisionsInterval(int timeout)
Set timeout interval for tx key contention analysis.- Specified by:
setTxKeyCollisionsIntervalin interfaceTransactionsMXBean- Parameters:
timeout- Interval in millis.
-
getTxKeyCollisionsInterval
public int getTxKeyCollisionsInterval()
- Specified by:
getTxKeyCollisionsIntervalin interfaceTransactionsMXBean- Returns:
- Current interval in millis.
-
-