当前位置: 首页>>代码示例>>Java>>正文


Java Database.isFilesReadOnly方法代码示例

本文整理汇总了Java中org.hsqldb.Database.isFilesReadOnly方法的典型用法代码示例。如果您正苦于以下问题:Java Database.isFilesReadOnly方法的具体用法?Java Database.isFilesReadOnly怎么用?Java Database.isFilesReadOnly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.hsqldb.Database的用法示例。


在下文中一共展示了Database.isFilesReadOnly方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initParams

import org.hsqldb.Database; //导入方法依赖的package包/类
/**
 * initial external parameters are set here.
 */
protected void initParams(Database database, String baseFileName,
                          boolean defrag) {

    this.dataFileName   = baseFileName + Logger.dataFileExtension;
    this.backupFileName = baseFileName + Logger.backupFileExtension;
    this.database       = database;
    fa                  = database.logger.getFileAccess();
    dataFileScale       = database.logger.getDataFileScale();
    cachedRowPadding    = 8;

    if (dataFileScale > 8) {
        cachedRowPadding = dataFileScale;
    }

    initialFreePos = MIN_INITIAL_FREE_POS;

    if (initialFreePos < dataFileScale) {
        initialFreePos = dataFileScale;
    }

    cacheReadonly = database.isFilesReadOnly();
    maxCacheRows  = database.logger.getCacheMaxRows();
    maxCacheBytes = database.logger.getCacheSize();
    maxDataFileSize = (long) Integer.MAX_VALUE * dataFileScale
                      * database.logger.getDataFileFactor();

    if (defrag) {
        this.dataFileName   = dataFileName + Logger.newFileExtension;
        this.backupFileName = backupFileName + Logger.newFileExtension;
        this.maxCacheRows   = 1024;
        this.maxCacheBytes  = 1024 * 4096;
    }
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:37,代码来源:DataFileCache.java

示例2: initParams

import org.hsqldb.Database; //导入方法依赖的package包/类
/**
 * initial external parameters are set here.
 */
protected void initParams(Database database, String baseFileName,
                          boolean defrag) {

    this.dataFileName   = baseFileName + Logger.dataFileExtension;
    this.backupFileName = baseFileName + Logger.backupFileExtension;
    this.database       = database;
    fa                  = database.logger.getFileAccess();
    dataFileScale       = database.logger.getDataFileScale();
    cachedRowPadding    = 8;

    if (dataFileScale > 8) {
        cachedRowPadding = dataFileScale;
    }

    initialFreePos = MIN_INITIAL_FREE_POS;

    if (initialFreePos < dataFileScale) {
        initialFreePos = dataFileScale;
    }

    cacheReadonly = database.isFilesReadOnly();
    maxCacheRows  = database.logger.propCacheMaxRows;
    maxCacheBytes = database.logger.propCacheMaxSize;
    maxDataFileSize = (long) Integer.MAX_VALUE * dataFileScale
                      * database.logger.getDataFileFactor();

    if (defrag) {
        this.dataFileName   = baseFileName + Logger.newFileExtension;
        this.backupFileName = baseFileName + Logger.newFileExtension;
        this.maxCacheRows   = 1024;
        this.maxCacheBytes  = 1024 * 4096;
    }
}
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:37,代码来源:DataFileCache.java

示例3: initParams

import org.hsqldb.Database; //导入方法依赖的package包/类
/**
 * initial external parameters are set here.
 */
protected void initParams(Database database,
                          String baseFileName) throws HsqlException {

    HsqlDatabaseProperties props = database.getProperties();

    fileName       = baseFileName + ".data";
    backupFileName = baseFileName + ".backup";
    this.database  = database;
    fa             = database.getFileAccess();

    int cacheScale =
        props.getIntegerProperty(HsqlDatabaseProperties.hsqldb_cache_scale,
                                 14, 8, 18);
    int cacheSizeScale = props.getIntegerProperty(
        HsqlDatabaseProperties.hsqldb_cache_size_scale, 10, 6, 20);
    int cacheFreeCountScale = props.getIntegerProperty(
        HsqlDatabaseProperties.hsqldb_cache_free_count_scale, 9, 6, 12);

    incBackup = database.getProperties().isPropertyTrue(
        HsqlDatabaseProperties.hsqldb_inc_backup);
    cacheFileScale = database.getProperties().getIntegerProperty(
        HsqlDatabaseProperties.hsqldb_cache_file_scale, 8);

    if (cacheFileScale != 1) {
        cacheFileScale = 8;
    }

    cacheReadonly = database.isFilesReadOnly();

    int lookupTableLength = 1 << cacheScale;
    int avgRowBytes       = 1 << cacheSizeScale;

    maxCacheSize    = lookupTableLength * 3;
    maxCacheBytes   = maxCacheSize * avgRowBytes;
    maxDataFileSize = (long) Integer.MAX_VALUE * cacheFileScale;
    maxFreeBlocks   = 1 << cacheFreeCountScale;
    dataFile        = null;
    shadowFile      = null;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:43,代码来源:DataFileCache.java

示例4: initParams

import org.hsqldb.Database; //导入方法依赖的package包/类
/**
 * initial external parameters are set here.
 */
protected void initParams(Database database,
                          String baseFileName) throws HsqlException {

    HsqlDatabaseProperties props = database.getProperties();

    fileName       = baseFileName + ".data";
    backupFileName = baseFileName + ".backup";
    this.database  = database;
    fa             = database.getFileAccess();

    int cacheScale =
        props.getIntegerProperty(HsqlDatabaseProperties.hsqldb_cache_scale,
                                 14, 8, 18);
    int cacheSizeScale = props.getIntegerProperty(
        HsqlDatabaseProperties.hsqldb_cache_size_scale, 10, 6, 20);
    int cacheFreeCountScale = props.getIntegerProperty(
        HsqlDatabaseProperties.hsqldb_cache_free_count_scale, 9, 6, 12);

    cacheFileScale = database.getProperties().getIntegerProperty(
        HsqlDatabaseProperties.hsqldb_cache_file_scale, 1);

    if (cacheFileScale != 1) {
        cacheFileScale = 8;
    }

    cacheReadonly = database.isFilesReadOnly();

    int lookupTableLength = 1 << cacheScale;
    int avgRowBytes       = 1 << cacheSizeScale;

    maxCacheSize    = lookupTableLength * 3;
    maxCacheBytes   = maxCacheSize * avgRowBytes;
    maxDataFileSize = cacheFileScale == 1 ? Integer.MAX_VALUE
                                          : (long) Integer.MAX_VALUE * 4;
    maxFreeBlocks   = 1 << cacheFreeCountScale;
    dataFile        = null;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:41,代码来源:DataFileCache.java

示例5: initParams

import org.hsqldb.Database; //导入方法依赖的package包/类
/**
 * initial external parameters are set here.
 */
protected void initParams(Database database, String baseFileName) {

    HsqlDatabaseProperties props = database.getProperties();

    fileName       = baseFileName + ".data";
    backupFileName = baseFileName + ".backup";
    this.database  = database;
    fa             = database.getFileAccess();

    int cacheScale =
        props.getIntegerProperty(HsqlDatabaseProperties.hsqldb_cache_scale,
                                 14, 8, 18);
    int cacheSizeScale = props.getIntegerProperty(
        HsqlDatabaseProperties.hsqldb_cache_size_scale, 10, 6, 20);
    int cacheFreeCountScale = props.getIntegerProperty(
        HsqlDatabaseProperties.hsqldb_cache_free_count_scale, 9, 6, 12);

    incBackup = database.getProperties().isPropertyTrue(
        HsqlDatabaseProperties.hsqldb_inc_backup);
    cacheFileScale = database.getProperties().getIntegerProperty(
        HsqlDatabaseProperties.hsqldb_cache_file_scale, 8);

    if (cacheFileScale != 1) {
        cacheFileScale = 8;
    }

    cachedRowPadding = 8;

    if (cacheFileScale > 8) {
        cachedRowPadding = cacheFileScale;
    }

    cacheReadonly = database.isFilesReadOnly();

    int lookupTableLength = 1 << cacheScale;
    int avgRowBytes       = 1 << cacheSizeScale;

    maxCacheSize    = lookupTableLength * 3;
    maxCacheBytes   = maxCacheSize * avgRowBytes;
    maxDataFileSize = cacheFileScale == 1 ? Integer.MAX_VALUE
                                          : (long) Integer.MAX_VALUE
                                          * cacheFileScale;
    maxFreeBlocks = 1 << cacheFreeCountScale;
    dataFile      = null;
    shadowFile    = null;
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:50,代码来源:DataFileCache.java

示例6: openLog

import org.hsqldb.Database; //导入方法依赖的package包/类
/**
 *  Opens the specified Database object's database files and starts up
 *  the logging process. <p>
 *
 *  If the specified Database object is a new database, its database
 *  files are first created.
 *
 * @param  db the Database
 * @throws  HsqlException if there is a problem, such as the case when
 *      the specified files are in use by another process
 */
public void openLog(Database db) {

    needsCheckpoint = false;

    String path = db.getPath();
    int loglevel = db.getProperties().getIntegerProperty(
        HsqlDatabaseProperties.hsqldb_applog, 0);

    this.database = db;

    if (loglevel != SimpleLog.LOG_NONE) {
        appLog = new SimpleLog(path + ".app.log", loglevel,
                               !db.isFilesReadOnly());
    }

    appLog.sendLine(SimpleLog.LOG_ERROR, "Database (re)opened");

    logStatements = false;

    boolean useLock = db.getProperties().isPropertyTrue(
        HsqlDatabaseProperties.hsqldb_lock_file);

    if (useLock && !db.isFilesReadOnly()) {
        acquireLock(path);
    }

    log = new Log(db);

    log.open();

    logsStatements = logStatements = !db.isFilesReadOnly();
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:44,代码来源:Logger.java

示例7: openLog

import org.hsqldb.Database; //导入方法依赖的package包/类
/**
 *  Opens the specified Database object's database files and starts up
 *  the logging process. <p>
 *
 *  If the specified Database object is a new database, its database
 *  files are first created.
 *
 * @param  db the Database
 * @throws  HsqlException if there is a problem, such as the case when
 *      the specified files are in use by another process
 */
public void openLog(Database db) throws HsqlException {

    needsCheckpoint = false;

    String path = db.getPath();
    int loglevel = db.getProperties().getIntegerProperty(
        HsqlDatabaseProperties.hsqldb_applog, 0);

    if (loglevel != SimpleLog.LOG_NONE) {
        appLog = new SimpleLog(path + ".app.log", loglevel,
                               !db.isFilesReadOnly());
    }

    appLog.sendLine(SimpleLog.LOG_ERROR, "Database (re)opened");

    logStatements = false;

    boolean useLock = db.getProperties().isPropertyTrue(
        HsqlDatabaseProperties.hsqldb_lock_file);

    if (useLock && !db.isFilesReadOnly()) {
        acquireLock(path);
    }

    log = new Log(db);

    log.open();

    logStatements = !db.isFilesReadOnly();
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:42,代码来源:Logger.java


注:本文中的org.hsqldb.Database.isFilesReadOnly方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。