/* Cassandra Cluster Admin @author Sébastien Giroux @copyright All rights reserved - 2011 */ require 'include/phpcassa/connection.php'; require 'include/phpcassa/columnfamily.php'; require 'include/phpcassa/sysmanager.php'; require 'include/lang/english.php'; require 'helper/ClusterHelper.php'; require 'helper/ColumnFamilyHelper.php'; require 'helper/MX4J.php'; require 'conf.inc.php'; define('MINIMUM_THRIFT_API_VERSION_FOR_COUNTERS', '19.10.0'); $cluster_helper = new ClusterHelper($CASSANDRA_CLUSTERS); session_start(); // Make sure the cluster index in the session still exists in the config array if ($cluster_helper->getClusterIndex() > $cluster_helper->getClustersCount() - 1) { $_SESSION['cluster_index'] = 0; } try { $random_server = $cluster_helper->getRandomNodeForCurrentCluster(); $sys_manager = new SystemManager($random_server, $cluster_helper->getCredentialsForCurrentCluster(), 1500, 1500); } catch (TException $e) { die(getHTML('header.php') . getHTML('server_error.php', array('error_message' => displayErrorMessage('cassandra_server_error', array('error_message' => $e->getMessage())))) . getHTML('footer.php')); } /* Get the specified view and replace the php variables */ function getHTML($filename, $php_params = array())