Package voldemort.xml

Examples of voldemort.xml.StoreDefinitionsMapper.writeStore()


        if(versionedStoreList != null) {
            String stores = versionedStoreList.get(0).getValue();
            StoreDefinitionsMapper mapper = new StoreDefinitionsMapper();
            List<StoreDefinition> storeDefinitions = mapper.readStoreList(new StringReader(stores));
            for(StoreDefinition storeDef: storeDefinitions) {
                Versioned<String> versionedStoreValue = new Versioned<String>(mapper.writeStore(storeDef));
                storesRepo.put(storeDef.getName(), versionedStoreValue, null);
            }
        }
        this.storeDefinitionsStorageEngine = storesRepo;
View Full Code Here


            }
            for(StoreDefinition storeDef: storeDefinitions) {
                try {
                    FileUtils.writeStringToFile(new File(storeDefDirPath + File.separator
                                                         + storeDef.getName()),
                                                mapper.writeStore(storeDef));
                } catch(IOException e) {
                    throw new VoldemortException("Cannot write store definition to file: "
                                                 + storeDef.getName(), e);
                }
            }
View Full Code Here

                // Update the STORES directory and the corresponding entry in
                // metadata cache
                Set<String> specifiedStoreNames = new HashSet<String>();
                for(StoreDefinition storeDef: storeDefinitions) {
                    specifiedStoreNames.add(storeDef.getName());
                    String storeDefStr = mapper.writeStore(storeDef);
                    Versioned<String> versionedValueStr = new Versioned<String>(storeDefStr,
                                                                                value.getVersion());
                    this.storeDefinitionsStorageEngine.put(storeDef.getName(),
                                                           versionedValueStr,
                                                           "");
View Full Code Here

            for(StoreDefinition storeDef: storeDefinitions) {
                if(!this.storeNames.contains(storeDef.getName())) {
                    throw new VoldemortException("Cannot update a store which does not exist !");
                }

                String storeDefStr = mapper.writeStore(storeDef);
                Versioned<String> versionedValueStr = new Versioned<String>(storeDefStr,
                                                                            value.getVersion());
                this.storeDefinitionsStorageEngine.put(storeDef.getName(), versionedValueStr, "");

                // Update the metadata cache
View Full Code Here

            // Check for backwards compatibility
            StoreDefinitionUtils.validateSchemaAsNeeded(storeDef);

            // Otherwise add to the STORES directory
            StoreDefinitionsMapper mapper = new StoreDefinitionsMapper();
            String storeDefStr = mapper.writeStore(storeDef);
            Versioned<String> versionedValueStr = new Versioned<String>(storeDefStr);
            this.storeDefinitionsStorageEngine.put(storeDef.getName(), versionedValueStr, null);

            // Update the metadata cache
            this.metadataCache.put(storeDef.getName(), new Versioned<Object>(storeDefStr));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.