public XAXactId(String xactIdString) {
// extract it in pieces delimited by COLON
int start, end, length;
// xx
start = 1;
end = xactIdString.indexOf(COLON, start);
if (SanityManager.DEBUG)
SanityManager.ASSERT(end != -1, "illegal string format");
String xx = xactIdString.substring(start, end);
int N = Integer.parseInt(xx);
if (SanityManager.DEBUG)
{
SanityManager.ASSERT(N > 0 && N < = Xid.MAXGTRIDSIZE, "illegal gtrid size");
}
// yy
start = end+1; // skip the COLON
end = xactIdString.indexOf(COLON, start);
if (SanityManager.DEBUG)
SanityManager.ASSERT(end != -1, "illegal string format");
String yy = xactIdString.substring(start,end);
int M = Integer.parseInt(yy);
if (SanityManager.DEBUG)
SanityManager.ASSERT(M > 0 && N < = Xid.MAXBQUALSIZE, "illegal bqual size");
// ffffffff
start = end+1; // skip the COLON
end = xactIdString.indexOf(COLON, start);
if (SanityManager.DEBUG)
SanityManager.ASSERT(end != -1, "illegal string format");
String f = xactIdString.substring(start,end);
format_id = Integer.parseInt(f, 16);
// n...n
start = end+1; // skip the COLON
end = xactIdString.indexOf(COLON, start);
if (SanityManager.DEBUG)
SanityManager.ASSERT(end != -1, "illegal string format");
global_id = org.apache.derby.iapi.util.StringUtil.fromHexString(xactIdString, start, (end-start));
if (SanityManager.DEBUG)
SanityManager.ASSERT(global_id.length == N, "inconsistent global_id length");
// m...m
start = end+1; // skip the COLON
end = xactIdString.indexOf(COLON, start);
if (SanityManager.DEBUG)
SanityManager.ASSERT(end != -1, "illegal string format");
branch_id = org.apache.derby.iapi.util.StringUtil.fromHexString(xactIdString, start, (end-start));
if (SanityManager.DEBUG)
SanityManager.ASSERT(branch_id.length == M,
"inconsistent branch_id length, expect " + M + " got " +
branch_id.length);
}
|