package com.tiesheng.util.ip2region;

/**
 * database configuration class
 *
 * @author chenxin<chenxin619315 @ gmail.com>
 */
public class DbConfig {
    /**
     * total header data block size
     */
    private int totalHeaderSize;

    /**
     * max index data block size
     * u should always choice the fastest read block size
     */
    private int indexBlockSize;

    /**
     * construct method
     *
     * @param totalHeaderSize
     */
    public DbConfig(int totalHeaderSize) {
        this.totalHeaderSize = totalHeaderSize;
        this.indexBlockSize = 8192;
    }

    public DbConfig() {
        this(8 * 2048);
    }

    public int getTotalHeaderSize() {
        return totalHeaderSize;
    }

    public DbConfig setTotalHeaderSize(int totalHeaderSize) {
        this.totalHeaderSize = totalHeaderSize;
        return this;
    }

    public int getIndexBlockSize() {
        return indexBlockSize;
    }

    public DbConfig setIndexBlockSize(int dataBlockSize) {
        this.indexBlockSize = dataBlockSize;
        return this;
    }
}
