Package org.apache.cassandra.exceptions

Examples of org.apache.cassandra.exceptions.SyntaxException


    protected final Map<String, Object> properties = new HashMap<String, Object>();

    public void addProperty(String name, String value) throws SyntaxException
    {
        if (properties.put(name, value) != null)
            throw new SyntaxException(String.format("Multiple definition for property '%s'", name));
    }
View Full Code Here


        Map<String, String> lowerCased = new HashMap<String, String>(value.size());
        for (Map.Entry<String, String> entry : value.entrySet())
            lowerCased.put(entry.getKey().toLowerCase(), entry.getValue());

        if (properties.put(name, lowerCased) != null)
            throw new SyntaxException(String.format("Multiple definition for property '%s'", name));
    }
View Full Code Here

                continue;

            if (obsolete.contains(name))
                logger.warn("Ignoring obsolete property {}", name);
            else
                throw new SyntaxException(String.format("Unknown property '%s'", name));
        }
    }
View Full Code Here

    {
        Object val = properties.get(name);
        if (val == null)
            return null;
        if (!(val instanceof String))
            throw new SyntaxException(String.format("Invalid value for property '%s'", name));
        return (String)val;
    }
View Full Code Here

    {
        Object val = properties.get(name);
        if (val == null)
            return null;
        if (!(val instanceof Map))
            throw new SyntaxException(String.format("Invalid value for property '%s'", name));
        return (Map<String, String>)val;
    }
View Full Code Here

            {
                return Double.valueOf(value);
            }
            catch (NumberFormatException e)
            {
                throw new SyntaxException(String.format("Invalid double value %s for '%s'", value, key));
            }
        }
    }
View Full Code Here

            {
                return Integer.valueOf(value);
            }
            catch (NumberFormatException e)
            {
                throw new SyntaxException(String.format("Invalid integer value %s for '%s'", value, key));
            }
        }
    }
View Full Code Here

{
    public static AbstractType<?> getInstance(TypeParser parser) throws ConfigurationException, SyntaxException
    {
        List<AbstractType<?>> innerTypes = parser.getTypeParameters();
        if (innerTypes.size() != 1)
            throw new SyntaxException("FrozenType() only accepts one parameter");

        AbstractType<?> innerType = innerTypes.get(0);
        return innerType.freeze();
    }
View Full Code Here

    protected final Map<String, Object> properties = new HashMap<String, Object>();

    public void addProperty(String name, String value) throws SyntaxException
    {
        if (properties.put(name, value) != null)
            throw new SyntaxException(String.format("Multiple definition for property '%s'", name));
    }
View Full Code Here

     * @throws SyntaxException the syntax error.
     */
    public void throwFirstSyntaxError() throws SyntaxException
    {
        if (!errorMsgs.isEmpty())
            throw new SyntaxException(errorMsgs.getFirst());
    }
View Full Code Here

TOP

Related Classes of org.apache.cassandra.exceptions.SyntaxException

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.