Package voldemort.versioning

Examples of voldemort.versioning.Occurred


            } else {

                // Update the value
                List<Versioned<byte[]>> removedValueList = new ArrayList<Versioned<byte[]>>();
                for(Versioned<byte[]> versioned: existingValuesList) {
                    Occurred occurred = value.getVersion().compare(versioned.getVersion());
                    if(occurred == Occurred.BEFORE)
                        throw new ObsoleteVersionException("Obsolete version for key '" + key
                                                           + "': " + value.getVersion());
                    else if(occurred == Occurred.AFTER)
                        removedValueList.add(versioned);
View Full Code Here


            Iterator<Versioned<V>> iter = valuesInStorage.iterator();
            boolean obsolete = false;
            // Compare the current version with a set of accepted versions
            while(iter.hasNext()) {
                Versioned<V> curr = iter.next();
                Occurred occurred = value.getVersion().compare(curr.getVersion());
                if(occurred == Occurred.BEFORE) {
                    obsolete = true;
                    break;
                } else if(occurred == Occurred.AFTER) {
                    iter.remove();
View Full Code Here

                    }
                    break;
                }

                // Check the ordering of the current value
                Occurred occurred = curr.getVersion().compare(currentGoodversion);
                if(occurred == Occurred.BEFORE) {
                    // This value is obsolete! Break from the loop
                    if(logger.isDebugEnabled()) {
                        logger.debug("Version is obsolete : " + curr);
                    }
View Full Code Here

        }
        // Check for existing versions - remember which items to
        // remove in case of success
        List<Versioned<V>> itemsToRemove = new ArrayList<Versioned<V>>(items.size());
        for(Versioned<V> versioned: items) {
            Occurred occurred = value.getVersion().compare(versioned.getVersion());
            if(occurred == Occurred.BEFORE) {
                throw new ObsoleteVersionException("Obsolete version for key '" + key + "': "
                                                   + value.getVersion());
            } else if(occurred == Occurred.AFTER) {
                itemsToRemove.add(versioned);
View Full Code Here

            select = conn.prepareStatement(selectSql);
            select.setBytes(1, key.get());
            results = select.executeQuery();
            while(results.next()) {
                VectorClock version = new VectorClock(results.getBytes("version_"));
                Occurred occurred = value.getVersion().compare(version);
                if(occurred == Occurred.BEFORE)
                    throw new ObsoleteVersionException("Attempt to put version "
                                                       + value.getVersion()
                                                       + " which is superceeded by " + version
                                                       + ".");
View Full Code Here

                // compare vector clocks and throw out old ones, for updates

                Iterator<Versioned<byte[]>> iter = vals.iterator();
                while(iter.hasNext()) {
                    Versioned<byte[]> curr = iter.next();
                    Occurred occurred = value.getVersion().compare(curr.getVersion());
                    if(occurred == Occurred.BEFORE)
                        throw new ObsoleteVersionException("Key "
                                                           + new String(hexCodec.encode(key.get()))
                                                           + " "
                                                           + value.getVersion().toString()
View Full Code Here

TOP

Related Classes of voldemort.versioning.Occurred

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.