Package com.sleepycat.je.dbi

Examples of com.sleepycat.je.dbi.DbConfigManager


     * specify the type of the array.
     */
    @SuppressWarnings("unchecked")
    public LockManager(EnvironmentImpl envImpl) {

        DbConfigManager configMgr = envImpl.getConfigManager();
        nLockTables = configMgr.getInt(EnvironmentParams.N_LOCK_TABLES);
        oldLockExceptions =
            configMgr.getBoolean(EnvironmentParams.LOCK_OLD_LOCK_EXCEPTIONS);
        lockTables = new Map[nLockTables];
        lockTableLatches = new Latch[nLockTables];
        for (int i = 0; i < nLockTables; i++) {
            lockTables[i] = new HashMap<Long,Lock>();
            lockTableLatches[i] = new Latch("Lock Table " + i);
View Full Code Here


        throws DatabaseException {

        /* Set up log buffers. */
        this.envImpl = envImpl;
        this.fileManager = envImpl.getFileManager();
        DbConfigManager configManager = envImpl.getConfigManager();
        this.readOnly = readOnly;
        logBufferPool = new LogBufferPool(fileManager, envImpl);

        /* See if we're configured to do a checksum when reading in objects. */
        doChecksumOnRead =
            configManager.getBoolean(EnvironmentParams.LOG_CHECKSUM_READ);

        logWriteLatch = new Latch(DEBUG_NAME);
        readBufferSize =
            configManager.getInt(EnvironmentParams.LOG_FAULT_READ_SIZE);

        /* Do the stats definitions. */
        stats = new StatGroup(GROUP_NAME, GROUP_DESC);
        nRepeatFaultReads = new LongStat(stats, LOGMGR_REPEAT_FAULT_READS);
        nTempBufferWrites = new LongStat(stats, LOGMGR_TEMP_BUFFER_WRITES);
View Full Code Here

        logger = LoggerUtils.getLogger(getClass());
        reentrancyGuard = new ReentrancyGuard(envImpl, logger);
        shutdownRequested = new AtomicBoolean(false);

        DbConfigManager configManager = envImpl.getConfigManager();

        int corePoolSize =
            configManager.getInt(EnvironmentParams.EVICTOR_CORE_THREADS);
        int maxPoolSize =
            configManager.getInt(EnvironmentParams.EVICTOR_MAX_THREADS);
        long keepAliveTime =
            configManager.getDuration(EnvironmentParams.EVICTOR_KEEP_ALIVE);
        terminateMillis = configManager.getDuration
            (EnvironmentParams.EVICTOR_TERMINATE_TIMEOUT);

        RejectedExecutionHandler rejectHandler =
            new RejectEvictHandler(nThreadUnavailable);
       
        evictionPool =
            new ThreadPoolExecutor(corePoolSize,
                                   maxPoolSize,
                                   keepAliveTime,
                                   TimeUnit.MILLISECONDS,
                                   new ArrayBlockingQueue<Runnable>(1),
                                   new StoppableThreadFactory(envImpl,
                                                              "JEEvictor",
                                                              logger),
                                   rejectHandler);

        runEvictor =
            configManager.getBoolean(EnvironmentParams.ENV_RUN_EVICTOR);

        allowBinDeltas = configManager.getBoolean
            (EnvironmentParams.EVICTOR_ALLOW_BIN_DELTAS);

        /*
         * Request notification of mutable property changes. Do this after all
         * fields in the evictor have been initialized, in case this is called
View Full Code Here

        nLogFSyncs = new LongStat(stats, FILEMGR_LOG_FSYNCS);
        nFSyncTime = new LongStat(stats, LogStatDefinition.FSYNCMGR_FSYNC_TIME);

        try {
            /* Read configurations. */
            DbConfigManager configManager = envImpl.getConfigManager();
            maxFileSize =
                configManager.getLong(EnvironmentParams.LOG_FILE_MAX);

            useWriteQueue = configManager.getBoolean
                (EnvironmentParams.LOG_USE_WRITE_QUEUE);
            writeQueueSize = configManager.getInt
                (EnvironmentParams.LOG_WRITE_QUEUE_SIZE);
            useODSYNC = configManager.getBoolean
                (EnvironmentParams.LOG_USE_ODSYNC);
            VERIFY_CHECKSUMS = configManager.getBoolean
                (EnvironmentParams.LOG_VERIFY_CHECKSUMS);
            nDataDirs =
                configManager.getInt(EnvironmentParams.LOG_N_DATA_DIRECTORIES);
            if (nDataDirs != 0) {
                dbEnvDataDirs = gatherDataDirs();
            } else {
                checkNoDataDirs();
                dbEnvDataDirs = null;
View Full Code Here

               IOException {

        openEnv(false);

        envImpl = DbInternal.getEnvironmentImpl(env);
        DbConfigManager cm = envImpl.getConfigManager();
        readBufferSize = cm.getInt(EnvironmentParams.LOG_ITERATOR_READ_SIZE);

        /*
         * Find the end of the log.
         */
        LastFileReader reader = new LastFileReader(envImpl, readBufferSize);
View Full Code Here

        this.nameIdPair = repNode.getNameIdPair();

        String groupName;
        if (envImpl != null) {
            logger = LoggerUtils.getLogger(getClass());
            final DbConfigManager configManager = envImpl.getConfigManager();
            groupName = configManager.get(GROUP_NAME);
            int rebroadcastPeriod = configManager.
                getDuration(ELECTIONS_REBROADCAST_PERIOD);
            rebroadcastTask = new RebroadcastTask(rebroadcastPeriod);
        } else {
            logger = LoggerUtils.getLoggerFormatterNeeded(getClass());
            groupName = "TEST_GROUP";
View Full Code Here

        /* Number of reads since the last time getAndResetNReads was called. */
        private int nReadOperations;

        protected ReadWindow(int readBufferSize, EnvironmentImpl envImpl) {
            DbConfigManager configManager = envImpl.getConfigManager();
            maxReadBufferSize =
                configManager.getInt(EnvironmentParams.LOG_ITERATOR_MAX_SIZE);
            this.envImpl = envImpl;
            fileManager = envImpl.getFileManager();

            readBuffer = ByteBuffer.allocate(readBufferSize);
            threadSafeBufferFlip(readBuffer);
View Full Code Here

    private final StatGroup stats;
    private final LongStat requiredEvictBytesStat;

    Arbiter(EnvironmentImpl envImpl) {

        DbConfigManager configManager = envImpl.getConfigManager();
        evictBytesSetting = configManager.getLong
            (EnvironmentParams.EVICTOR_EVICT_BYTES);

        stats = new StatGroup(GROUP_NAME, GROUP_DESC);
        requiredEvictBytesStat = new LongStat(stats,
                                              EVICTOR_REQUIRED_EVICT_BYTES);
View Full Code Here

    public RepGroupDB(RepImpl repImpl)
        throws DatabaseException, IOException {

        this.repImpl = repImpl;

        DbConfigManager configManager = repImpl.getConfigManager();
        emptyGroup = new RepGroupImpl(configManager.get(GROUP_NAME));
        logger = LoggerUtils.getLogger(getClass());
    }
View Full Code Here

     * @throws DatabaseException
     */
    public void addFirstNode()
        throws DatabaseException {

        DbConfigManager configManager = repImpl.getConfigManager();
        String groupName = configManager.get(GROUP_NAME);
        String nodeName = configManager.get(NODE_NAME);

        DatabaseImpl groupDbImpl = repImpl.createGroupDb();

        /* setup the group information as data. */
        GroupBinding groupBinding = new GroupBinding();
View Full Code Here

TOP

Related Classes of com.sleepycat.je.dbi.DbConfigManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.