Package voldemort.utils

Examples of voldemort.utils.ConfigurationException


        InputStream input = null;
        try {
            input = new BufferedInputStream(new FileInputStream(propertyFile.getAbsolutePath()));
            properties.load(input);
        } catch(IOException e) {
            throw new ConfigurationException(e);
        } finally {
            IOUtils.closeQuietly(input);
        }
        setProperties(properties);
    }
View Full Code Here


        InputStream input = null;
        try {
            input = new BufferedInputStream(new FileInputStream(propertyFile.getAbsolutePath()));
            properties.load(input);
        } catch(IOException e) {
            throw new ConfigurationException(e);
        } finally {
            IOUtils.closeQuietly(input);
        }
        setProperties(properties);
    }
View Full Code Here

        InputStream input = null;
        try {
            input = new BufferedInputStream(new FileInputStream(propertyFile.getAbsolutePath()));
            properties.load(input);
        } catch(IOException e) {
            throw new ConfigurationException(e);
        } finally {
            IOUtils.closeQuietly(input);
        }
        setProperties(properties);
    }
View Full Code Here

        } catch(IllegalStateException e) {
            logger.error("Error loading storage configuration '" + configClassName + "'.", e);
        }

        if(storageConfigs.size() == 0)
            throw new ConfigurationException("No storage engine has been enabled!");

        // now, add the configurations of the storage engines needed by system
        // stores, if not yet exist
        initSystemStorageConfig();
    }
View Full Code Here

        if(voldemortConfig.isSlopEnabled()) {

            logger.info("Initializing the slop store using " + voldemortConfig.getSlopStoreType());
            StorageConfiguration config = storageConfigs.get(voldemortConfig.getSlopStoreType());
            if(config == null)
                throw new ConfigurationException("Attempt to open store "
                                                 + SlopStorageEngine.SLOP_STORE_NAME + " but "
                                                 + voldemortConfig.getSlopStoreType()
                                                 + " storage engine has not been enabled.");

            // make a dummy store definition object
View Full Code Here

        logger.info("Opening system store '" + storeDef.getName() + "' (" + storeDef.getType()
                    + ").");

        StorageConfiguration config = storageConfigs.get(storeDef.getType());
        if(config == null)
            throw new ConfigurationException("Attempt to open system store " + storeDef.getName()
                                             + " but " + storeDef.getType()
                                             + " storage engine has not been enabled.");

        final StorageEngine<ByteArray, byte[], byte[]> engine = config.getStore(storeDef, null);
View Full Code Here

    public void updateStore(StoreDefinition storeDef) {
        logger.info("Updating store '" + storeDef.getName() + "' (" + storeDef.getType() + ").");
        StorageConfiguration config = storageConfigs.get(storeDef.getType());
        if(config == null)
            throw new ConfigurationException("Attempt to open store " + storeDef.getName()
                                             + " but " + storeDef.getType()
                                             + " storage engine has not been enabled.");
        config.update(storeDef);
    }
View Full Code Here

        logger.info("Opening store '" + storeDef.getName() + "' (" + storeDef.getType() + ").");

        StorageConfiguration config = storageConfigs.get(storeDef.getType());
        if(config == null)
            throw new ConfigurationException("Attempt to open store " + storeDef.getName()
                                             + " but " + storeDef.getType()
                                             + " storage engine has not been enabled.");

        boolean isReadOnly = storeDef.getType().compareTo(ReadOnlyStorageConfiguration.TYPE_NAME) == 0;
        final RoutingStrategy routingStrategy = new RoutingStrategyFactory().updateRoutingStrategy(storeDef,
View Full Code Here

        engine.close();

        // Also remove any state in the StorageConfiguration (if required)
        StorageConfiguration config = storageConfigs.get(storeType);
        if(config == null) {
            throw new ConfigurationException("Attempt to close storage engine " + engine.getName()
                                             + " but " + storeType
                                             + " storage engine has not been enabled.");
        }
        config.removeStorageEngine(engine);
View Full Code Here

        if(coreThreads < 0)
            throw new IllegalArgumentException("core.threads cannot be less than 1");
        else if(coreThreads > maxThreads)
            throw new IllegalArgumentException("core.threads cannot be greater than max.threads.");
        if(maxThreads < 1)
            throw new ConfigurationException("max.threads cannot be less than 1.");
        if(slopFrequencyMs < 1)
            throw new ConfigurationException("slop.frequency.ms cannot be less than 1.");
        if(socketTimeoutMs < 0)
            throw new ConfigurationException("socket.timeout.ms must be 0 or more ms.");
        if(clientSelectors < 1)
            throw new ConfigurationException("client.selectors must be 1 or more.");
        if(clientRoutingTimeoutMs < 0)
            throw new ConfigurationException("routing.timeout.ms must be 0 or more ms.");
        if(schedulerThreads < 1)
            throw new ConfigurationException("Must have at least 1 scheduler thread, "
                                             + this.schedulerThreads + " set.");
        if(enableServerRouting && !enableSocketServer)
            throw new ConfigurationException("Server-side routing is enabled, this requires the socket server to also be enabled.");
        if(numRestServiceNettyBossThreads < 1)
            throw new ConfigurationException("num.rest.service.netty.boss.threads cannot be less than 1");
        if(numRestServiceNettyWorkerThreads < 1)
            throw new ConfigurationException("num.rest.service.netty.worker.threads cannot be less than 1");
        if(numRestServiceStorageThreads < 1)
            throw new ConfigurationException("num.rest.service.storage.threads cannot be less than 1");
        if(numRestServiceNettyServerBacklog < 0)
            throw new ConfigurationException("num.rest.service.netty.server.backlog cannot be negative");
        if(restServiceStorageThreadPoolQueueSize < 0)
            throw new ConfigurationException("rest.service.storage.thread.pool.queue.size cannot be negative.");
        if(maxHttpAggregatedContentLength <= 0)
            throw new ConfigurationException("max.http.aggregated.content.length must be positive");
        if(REST_HDFS_FETCHER_CLASS.equals(fileFetcherClass) && !enableReadOnlyRestHdfs
           || !REST_HDFS_FETCHER_CLASS.equals(fileFetcherClass) && enableReadOnlyRestHdfs)
            throw new ConfigurationException("The values of \"file.fetcher.class\" and \"enable.readonly.rest.hdfs\" do not match: \n"
                                             + "  file.fetcher.class="
                                             + fileFetcherClass
                                             + "\n  enable.readonly.rest.hdfs="
                                             + enableReadOnlyRestHdfs);
    }
View Full Code Here

TOP

Related Classes of voldemort.utils.ConfigurationException

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.