Search in sources :

Example 1 with TxVerboseInfo

use of org.apache.ignite.internal.visor.tx.TxVerboseInfo in project ignite by apache.

the class TxCommands method printTxInfoResult.

/**
 * Prints result of --tx --info command to output.
 *
 * @param res Response.
 */
private void printTxInfoResult(Map<ClusterNode, VisorTxTaskResult> res) {
    String lb = null;
    Map<Integer, String> usedCaches = new HashMap<>();
    Map<Integer, String> usedCacheGroups = new HashMap<>();
    VisorTxInfo firstInfo = null;
    TxVerboseInfo firstVerboseInfo = null;
    Set<TransactionState> states = new HashSet<>();
    for (Map.Entry<ClusterNode, VisorTxTaskResult> entry : res.entrySet()) {
        for (VisorTxInfo info : entry.getValue().getInfos()) {
            assert info.getTxVerboseInfo() != null;
            if (lb == null)
                lb = info.getLabel();
            if (firstInfo == null) {
                firstInfo = info;
                firstVerboseInfo = info.getTxVerboseInfo();
            }
            usedCaches.putAll(info.getTxVerboseInfo().usedCaches());
            usedCacheGroups.putAll(info.getTxVerboseInfo().usedCacheGroups());
            states.add(info.getState());
        }
    }
    String indent = "";
    logger.info("");
    logger.info(indent + "Transaction detailed info:");
    printTransactionDetailedInfo(res, usedCaches, usedCacheGroups, firstInfo, firstVerboseInfo, states, indent + DOUBLE_INDENT);
}
Also used : ClusterNode(org.apache.ignite.cluster.ClusterNode) TransactionState(org.apache.ignite.transactions.TransactionState) HashMap(java.util.HashMap) TxVerboseInfo(org.apache.ignite.internal.visor.tx.TxVerboseInfo) VisorTxInfo(org.apache.ignite.internal.visor.tx.VisorTxInfo) VisorTxTaskResult(org.apache.ignite.internal.visor.tx.VisorTxTaskResult) HashMap(java.util.HashMap) Map(java.util.Map) HashSet(java.util.HashSet)

Example 2 with TxVerboseInfo

use of org.apache.ignite.internal.visor.tx.TxVerboseInfo in project ignite by apache.

the class TxCommands method printTransactionMappings.

/**
 * Prints transaction mappings for specific cluster node to output.
 *
 * @param indent Indent.
 * @param entry Entry.
 */
private void printTransactionMappings(String indent, Map.Entry<ClusterNode, VisorTxTaskResult> entry) {
    for (VisorTxInfo info : entry.getValue().getInfos()) {
        TxVerboseInfo verboseInfo = info.getTxVerboseInfo();
        if (verboseInfo != null) {
            logger.info(indent + "Mapping [type=" + verboseInfo.txMappingType() + "]:");
            printTransactionMapping(indent + DOUBLE_INDENT, info, verboseInfo);
        } else {
            logger.info(indent + "Mapping [type=HISTORICAL]:");
            logger.info(indent + DOUBLE_INDENT + "State: " + info.getState());
        }
    }
}
Also used : VisorTxInfo(org.apache.ignite.internal.visor.tx.VisorTxInfo) TxVerboseInfo(org.apache.ignite.internal.visor.tx.TxVerboseInfo)

Aggregations

TxVerboseInfo (org.apache.ignite.internal.visor.tx.TxVerboseInfo)2 VisorTxInfo (org.apache.ignite.internal.visor.tx.VisorTxInfo)2 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Map (java.util.Map)1 ClusterNode (org.apache.ignite.cluster.ClusterNode)1 VisorTxTaskResult (org.apache.ignite.internal.visor.tx.VisorTxTaskResult)1 TransactionState (org.apache.ignite.transactions.TransactionState)1