<commit_before><?php
	/*
		Cassandra Cluster Admin
		
		@author <NAME>
		@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()) {<commit_msg>Better cluster node selection and management of dead nodes.<commit_after><?php
	/*
		Cassandra Cluster Admin
		
		@author <NAME>
		@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 {	
		$sys_manager = new SystemManagerPool($cluster_helper->getArrayOfNodesForCurrentCluster(),$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()) {
{'fraction_non_alphanumeric': 0.14970282317979197, 'fraction_numerical': 0.014858841010401188, 'mean_word_length': 5.699004975124378, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '773997', 'n_tokens_mistral': 941, 'n_tokens_neox': 841, 'n_words': 144}