/** * displays entries in the activeTx table. * <p>useful for debug. */ public void activeTxDisplay() { for (int i=0; i < activeTx.length; ++i) { if (activeTx[i] == null) continue; synchronized(activeTx) { XACommittingTx tx = activeTx[i]; byte[][] record = tx.getRecord(); System.out.println("activeTx[" + i + "] key=" + Long.toHexString(tx.getLogKey()) + "\n Fields: " + record.length ); for (int j = 0; j < record.length; ++j) { byte[] field = record[j]; System.out.println(" [" + j + "] len=" + field.length + ": " + new String(field)); } } } }
/** * displays entries in the activeTx table. * <p>useful for debug. */ public void activeTxDisplay() { for (int i=0; i < activeTx.length; ++i) { if (activeTx[i] == null) continue; synchronized(activeTx) { XACommittingTx tx = activeTx[i]; byte[][] record = tx.getRecord(); System.out.println("activeTx[" + i + "] key=" + Long.toHexString(tx.getLogKey()) + "\n Fields: " + record.length ); for (int j = 0; j < record.length; ++j) { byte[] field = record[j]; System.out.println(" [" + j + "] len=" + field.length + ": " + new String(field)); } } } }
/** * displays entries in the activeTx table. * <p>useful for debug. */ public void activeTxDisplay() { for (int i=0; i < activeTx.length; ++i) { if (activeTx[i] == null) continue; synchronized(activeTx) { XACommittingTx tx = activeTx[i]; byte[][] record = tx.getRecord(); System.out.println("activeTx[" + i + "] key=" + Long.toHexString(tx.getLogKey()) + "\n Fields: " + record.length ); for (int j = 0; j < record.length; ++j) { byte[] field = record[j]; System.out.println(" [" + j + "] len=" + field.length + ": " + new String(field)); } } } }
public void onRecord(LogRecord plainlr) { XALogRecord lr = (XALogRecord) plainlr; short recordType = lr.type; XACommittingTx tx = lr.getTx(); if (recordType == LogRecordType.XACOMMIT) { byte[][] data = tx.getRecord(); assert data[0].length == 4; int formatId = bytesToInt(data[1]); byte[] globalId = data[1]; byte[] branchId = data[2]; Xid masterXid = xidFactory.recover(formatId, globalId, branchId); Recovery.XidBranchesPair xidBranchesPair = new Recovery.XidBranchesPair(masterXid, tx); recoveredTx.put(masterXid, xidBranchesPair); log.debug("recovered prepare record for master xid: " + masterXid); for (int i = 3; i < data.length; i += 2) { byte[] branchBranchId = data[i]; String name = new String(data[i + 1]); Xid branchXid = xidFactory.recover(formatId, globalId, branchBranchId); TransactionBranchInfoImpl branchInfo = new TransactionBranchInfoImpl(branchXid, name); xidBranchesPair.addBranch(branchInfo); log.debug("recovered branch for resource manager, branchId " + name + ", " + branchXid); } } else { if(recordType != LogRecordType.END_OF_LOG) { // This value crops up every time the server is started log.warn("Received unexpected log record: " + lr +" ("+recordType+")"); } } }
public void onRecord(LogRecord plainlr) { XALogRecord lr = (XALogRecord) plainlr; short recordType = lr.type; XACommittingTx tx = lr.getTx(); if (recordType == LogRecordType.XACOMMIT) { byte[][] data = tx.getRecord(); assert data[0].length == 4; int formatId = bytesToInt(data[1]); byte[] globalId = data[1]; byte[] branchId = data[2]; Xid masterXid = xidFactory.recover(formatId, globalId, branchId); Recovery.XidBranchesPair xidBranchesPair = new Recovery.XidBranchesPair(masterXid, tx); recoveredTx.put(masterXid, xidBranchesPair); log.debug("recovered prepare record for master xid: " + masterXid); for (int i = 3; i < data.length; i += 2) { byte[] branchBranchId = data[i]; String name = new String(data[i + 1]); Xid branchXid = xidFactory.recover(formatId, globalId, branchBranchId); TransactionBranchInfoImpl branchInfo = new TransactionBranchInfoImpl(branchXid, name); xidBranchesPair.addBranch(branchInfo); log.debug("recovered branch for resource manager, branchId " + name + ", " + branchXid); } } else { if(recordType != LogRecordType.END_OF_LOG) { // This value crops up every time the server is started log.warn("Received unexpected log record: " + lr +" ("+recordType+")"); } } }
public void onRecord(LogRecord plainlr) { XALogRecord lr = (XALogRecord) plainlr; short recordType = lr.type; XACommittingTx tx = lr.getTx(); if (recordType == LogRecordType.XACOMMIT) { byte[][] data = tx.getRecord(); assert data[0].length == 4; int formatId = bytesToInt(data[1]); byte[] globalId = data[1]; byte[] branchId = data[2]; Xid masterXid = xidFactory.recover(formatId, globalId, branchId); Recovery.XidBranchesPair xidBranchesPair = new Recovery.XidBranchesPair(masterXid, tx); recoveredTx.put(masterXid, xidBranchesPair); log.debug("recovered prepare record for master xid: " + masterXid); for (int i = 3; i < data.length; i += 2) { byte[] branchBranchId = data[i]; String name = new String(data[i + 1]); Xid branchXid = xidFactory.recover(formatId, globalId, branchBranchId); TransactionBranchInfoImpl branchInfo = new TransactionBranchInfoImpl(branchXid, name); xidBranchesPair.addBranch(branchInfo); log.debug("recovered branch for resource manager, branchId " + name + ", " + branchXid); } } else { if(recordType != LogRecordType.END_OF_LOG) { // This value crops up every time the server is started log.warn("Received unexpected log record: " + lr +" ("+recordType+")"); } } }
public void onRecord(LogRecord plainlr) { XALogRecord lr = (XALogRecord) plainlr; short recordType = lr.type; XACommittingTx tx = lr.getTx(); if (recordType == LogRecordType.XACOMMIT) { byte[][] data = tx.getRecord(); assert data[0].length == 4; int formatId = bytesToInt(data[1]); byte[] globalId = data[1]; byte[] branchId = data[2]; Xid masterXid = xidFactory.recover(formatId, globalId, branchId); Recovery.XidBranchesPair xidBranchesPair = new Recovery.XidBranchesPair(masterXid, tx); recoveredTx.put(masterXid, xidBranchesPair); log.debug("recovered prepare record for master xid: " + masterXid); for (int i = 3; i < data.length; i += 2) { byte[] branchBranchId = data[i]; String name = new String(data[i + 1]); Xid branchXid = xidFactory.recover(formatId, globalId, branchBranchId); TransactionBranchInfoImpl branchInfo = new TransactionBranchInfoImpl(branchXid, name); xidBranchesPair.addBranch(branchInfo); log.debug("recovered branch for resource manager, branchId " + name + ", " + branchXid); } } else { if(recordType != LogRecordType.END_OF_LOG) { // This value crops up every time the server is started log.warn("Received unexpected log record: " + lr +" ("+recordType+")"); } } }
byte[][] record = tx.getRecord(); short recordSize = 0; for(int j=0; j < record.length; ++j)
byte[][] record = tx.getRecord(); short recordSize = 0; for(int j=0; j < record.length; ++j)
byte[][] record = tx.getRecord(); short recordSize = 0; for(int j=0; j < record.length; ++j)
byte[][] record = tx.getRecord();
byte[][] record = tx.getRecord();
byte[][] record = tx.getRecord();