recoveryoperation.java

来自「berkeleyDB,强大的嵌入式数据,多个数据库的内核」· Java 代码 · 共 57 行

JAVA
57
字号
/*-* See the file LICENSE for redistribution information.** Copyright (c) 2002-2004*	Sleepycat Software.  All rights reserved.** $Id: RecoveryOperation.java,v 1.1 2004/04/21 01:09:09 mjc Exp $*/package com.sleepycat.db;import com.sleepycat.db.internal.DbConstants;public final class RecoveryOperation {    public static final RecoveryOperation BACKWARD_ROLL =        new RecoveryOperation("BACKWARD_ROLL", DbConstants.DB_TXN_BACKWARD_ROLL);    public static final RecoveryOperation FORWARD_ROLL =        new RecoveryOperation("FORWARD_ROLL", DbConstants.DB_TXN_FORWARD_ROLL);    public static final RecoveryOperation ABORT =        new RecoveryOperation("ABORT", DbConstants.DB_TXN_ABORT);    public static final RecoveryOperation APPLY =        new RecoveryOperation("APPLY", DbConstants.DB_TXN_APPLY);    public static final RecoveryOperation PRINT =        new RecoveryOperation("PRINT", DbConstants.DB_TXN_PRINT);    private String operationName;    private int flag;    private RecoveryOperation(String operationName, int flag) {        this.operationName = operationName;        this.flag = flag;    }    public String toString() {        return "RecoveryOperation." + operationName;    }    /* This is public only so it can be called from internal/DbEnv.java. */    public static RecoveryOperation fromFlag(int flag) {        switch (flag) {        case DbConstants.DB_TXN_BACKWARD_ROLL:            return BACKWARD_ROLL;        case DbConstants.DB_TXN_FORWARD_ROLL:            return FORWARD_ROLL;        case DbConstants.DB_TXN_ABORT:            return ABORT;        case DbConstants.DB_TXN_APPLY:            return APPLY;        case DbConstants.DB_TXN_PRINT:            return PRINT;        default:            throw new IllegalArgumentException(                "Unknown recover operation: " + flag);        }    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?