Package org.apache.cassandra.serializers

Examples of org.apache.cassandra.serializers.MarshalException


        {
            return ByteBufferUtil.hexToBytes(source);
        }
        catch (NumberFormatException e)
        {
            throw new MarshalException(String.format("cannot parse '%s' as hex bytes", source), e);
        }
    }
View Full Code Here


    public void validateFields(CFMetaData metadata) throws MarshalException
    {
        super.validateFields(metadata);

        if (timeToLive <= 0)
            throw new MarshalException("A column TTL should be > 0");
        if (localExpirationTime < 0)
            throw new MarshalException("The local expiration time should not be negative");
    }
View Full Code Here

    public void validateFields(CFMetaData metadata) throws MarshalException
    {
        super.validateFields(metadata);

        if (getTimeToLive() <= 0)
            throw new MarshalException("A column TTL should be > 0");
        if (getLocalDeletionTime() < 0)
            throw new MarshalException("The local expiration time should not be negative");
    }
View Full Code Here

                uuid = UUID.fromString(source);
                idBytes = decompose(uuid);
            }
            catch (IllegalArgumentException e)
            {
                throw new MarshalException(String.format("unable to make UUID from '%s'", source), e);
            }

            if (uuid.version() != 1)
                throw new MarshalException("TimeUUID supports only version 1 UUIDs");
        } else
        {
            idBytes = ByteBuffer.wrap(UUIDGen.getTimeUUIDBytes(DateType.dateStringToTimestamp(source)));
        }
View Full Code Here

                uuid = UUID.fromString(source);
                idBytes = decompose(uuid);
            }
            catch (IllegalArgumentException e)
            {
                throw new MarshalException(String.format("Unable to make UUID from '%s'", source), e);
            }

            if (uuid.version() != 1)
                throw new MarshalException("TimeUUID supports only version 1 UUIDs");
        } else
        {
            throw new MarshalException(String.format("Unknown timeuuid representation: %s", source));
        }
        return idBytes;
    }
View Full Code Here

    public void validateFields(CFMetaData metadata) throws MarshalException
    {
        validateName(metadata);

        if ((int) (internalSize() - valueStartOffset()) != 4)
            throw new MarshalException("A tombstone value should be 4 bytes long");
        if (getLocalDeletionTime() < 0)
            throw new MarshalException("The local deletion time should not be negative");
    }
View Full Code Here

                uuid = UUID.fromString(source);
                return ByteBuffer.wrap(UUIDGen.decompose(uuid));
            }
            catch (IllegalArgumentException e)
            {
                throw new MarshalException(String.format("unable to make UUID from '%s'", source), e);
            }
        }

        try
        {
            return ByteBuffer.wrap(UUIDGen.getTimeUUIDBytes(TimestampSerializer.dateStringToTimestamp(source)));
        }
        catch (MarshalException e)
        {
            throw new MarshalException(String.format("unable to make version 1 UUID from '%s'", source), e);
        }
    }
View Full Code Here

        {
            return ByteBufferUtil.hexToBytes(source);
        }
        catch (NumberFormatException e)
        {
            throw new MarshalException(String.format("cannot parse '%s' as hex bytes", source), e);
        }
    }
View Full Code Here

                uuid = UUID.fromString(source);
                idBytes = decompose(uuid);
            }
            catch (IllegalArgumentException e)
            {
                throw new MarshalException(String.format("Unable to make UUID from '%s'", source), e);
            }

            if (uuid.version() != 1)
                throw new MarshalException("TimeUUID supports only version 1 UUIDs");
        } else
        {
            throw new MarshalException(String.format("Unknown timeuuid representation: %s", source));
        }
        return idBytes;
    }
View Full Code Here

        {
            return ByteBufferUtil.hexToBytes(source);
        }
        catch (NumberFormatException e)
        {
            throw new MarshalException(String.format("cannot parse '%s' as hex bytes", source), e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.cassandra.serializers.MarshalException

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.