Package voldemort.store

Examples of voldemort.store.StoreOperationFailureException


                            throw new VoldemortException(e);
                        }
                    }

                } else {
                    throw new StoreOperationFailureException(String.format("Store '%s' does not exist on this server",
                                                                           storeName));
                }
            }
        } catch(VoldemortException e) {
            response.setError(ProtoUtils.encodeError(errorCodeMapper, e));
View Full Code Here


                // stores.xml file out otherwise. (see
                // ConfigurationStorageEngine.put for details)

                if(!storeRepository.hasLocalStore(def.getName())) {
                    if(def.getReplicationFactor() > metadataStore.getCluster().getNumberOfNodes()) {
                        throw new StoreOperationFailureException("Cannot add a store whose replication factor ( "
                                                                 + def.getReplicationFactor()
                                                                 + " ) is greater than the number of nodes ( "
                                                                 + metadataStore.getCluster()
                                                                                .getNumberOfNodes()
                                                                 + " )");
                    }

                    logger.info("Adding new store '" + def.getName() + "'");
                    // open the store
                    StorageEngine<ByteArray, byte[], byte[]> engine = storageService.openStore(def);

                    // update stores list in metadata store (this also has the
                    // effect of updating the stores.xml file)
                    try {
                        metadataStore.addStoreDefinition(def);
                    } catch(Exception e) {
                        // rollback open store operation
                        boolean isReadOnly = ReadOnlyStorageConfiguration.TYPE_NAME.equals(def.getType());
                        storageService.removeEngine(engine, isReadOnly, def.getType(), true);
                        throw new VoldemortException(e);
                    }

                    logger.info("Successfully added new store '" + def.getName() + "'");
                } else {
                    logger.error("Failure to add a store with the same name '" + def.getName()
                                 + "'");
                    throw new StoreOperationFailureException(String.format("Store '%s' already exists on this server",
                                                                           def.getName()));
                }
            }
        } catch(VoldemortException e) {
            response.setError(ProtoUtils.encodeError(errorCodeMapper, e));
View Full Code Here

                    }

                } else {
                    logger.error("Failure to reserve memory. Store '" + storeName
                                 + "' does not exist");
                    throw new StoreOperationFailureException(String.format("Store '%s' does not exist on this server",
                                                                           storeName));
                }
            }
        } catch(VoldemortException e) {
            response.setError(ProtoUtils.encodeError(errorCodeMapper, e));
View Full Code Here

TOP

Related Classes of voldemort.store.StoreOperationFailureException

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.