EMMA Coverage Report (generated Sun Mar 01 22:06:14 CET 2015)
[all classes][org.h2.store]

COVERAGE SUMMARY FOR SOURCE FILE [SessionState.java]

nameclass, %method, %block, %line, %
SessionState.java100% (1/1)0%   (0/3)0%   (0/48)0%   (0/5)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class SessionState100% (1/1)0%   (0/3)0%   (0/48)0%   (0/5)
SessionState (): void 0%   (0/1)0%   (0/3)0%   (0/1)
isCommitted (int, int): boolean 0%   (0/1)0%   (0/20)0%   (0/3)
toString (): String 0%   (0/1)0%   (0/25)0%   (0/1)

1/*
2 * Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
3 * and the EPL 1.0 (http://h2database.com/html/license.html).
4 * Initial Developer: H2 Group
5 */
6package org.h2.store;
7 
8 
9/**
10 * The session state contains information about when was the last commit of a
11 * session. It is only used during recovery.
12 */
13class SessionState {
14 
15    /**
16     * The session id
17     */
18    public int sessionId;
19 
20    /**
21     * The last log id where a commit for this session is found.
22     */
23    public int lastCommitLog;
24 
25    /**
26     * The position where a commit for this session is found.
27     */
28    public int lastCommitPos;
29 
30    /**
31     * The in-doubt transaction if there is one.
32     */
33    public PageStoreInDoubtTransaction inDoubtTransaction;
34 
35    /**
36     * Check if this session state is already committed at this point.
37     *
38     * @param logId the log id
39     * @param pos the position in the log
40     * @return true if it is committed
41     */
42    public boolean isCommitted(int logId, int pos) {
43        if (logId != lastCommitLog) {
44            return lastCommitLog > logId;
45        }
46        return lastCommitPos >= pos;
47    }
48 
49    @Override
50    public String toString() {
51        return "sessionId:" + sessionId + " log:" + lastCommitLog +
52                " pos:" + lastCommitPos + " inDoubt:" + inDoubtTransaction;
53    }
54}

[all classes][org.h2.store]
EMMA 2.0.5312 (C) Vladimir Roubtsov