Examples of UntypedResultSet


Examples of org.apache.cassandra.cql3.UntypedResultSet

        else
        {
            ColumnFamilyStore cfs = table.getColumnFamilyStore(LOCAL_CF);

            String req = "SELECT cluster_name FROM system.%s WHERE key='%s'";
            UntypedResultSet result = processInternal(String.format(req, LOCAL_CF, LOCAL_KEY));

            if (result.isEmpty() || !result.one().has("cluster_name"))
            {

                // this is a brand new node
                if (!cfs.getSSTables().isEmpty())
                    throw new ConfigurationException("Found system table files, but they couldn't be loaded!");

                // no system files.  this is a new node.
                req = "INSERT INTO system.%s (key, cluster_name) VALUES ('%s', '%s')";
                processInternal(String.format(req, LOCAL_CF, LOCAL_KEY, DatabaseDescriptor.getClusterName()));
                return;
            }

            savedClusterName = result.one().getString("cluster_name");
        }

        if (!DatabaseDescriptor.getClusterName().equals(savedClusterName))
            throw new ConfigurationException("Saved cluster name " + savedClusterName + " != configured name " + DatabaseDescriptor.getClusterName());
    }
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.