Permalink
Browse files

Fixed Cassandra configured with authentificator was causing You're no…

…t logged in error in a few place
  • Loading branch information...
1 parent 9183399 commit 2f89f829aef51322396828e0df440fa26a6f00e1 @sebgiroux sebgiroux committed Aug 24, 2011
Showing with 25 additions and 20 deletions.
  1. +7 −7 columnfamily_action.php
  2. +18 −13 helper/ColumnFamilyHelper.php
View
14 columnfamily_action.php
@@ -256,7 +256,7 @@
$cf = ColumnFamilyHelper::getCFInKeyspace($keyspace_name,$columnfamily_name);
try {
- $pool = new ConnectionPool($keyspace_name, $cluster_helper->getArrayOfNodesForCurrentCluster());
+ $pool = new ConnectionPool($keyspace_name, $cluster_helper->getArrayOfNodesForCurrentCluster(),null,5,5000,5000,10000,$cluster_helper->getCredentialsForCurrentCluster());
$column_family = new ColumnFamily($pool, $columnfamily_name);
$vw_vars['results'] = '';
@@ -320,7 +320,7 @@
}
try {
- $pool = new ConnectionPool($keyspace_name, $cluster_helper->getArrayOfNodesForCurrentCluster());
+ $pool = new ConnectionPool($keyspace_name, $cluster_helper->getArrayOfNodesForCurrentCluster(),null,5,5000,5000,10000,$cluster_helper->getCredentialsForCurrentCluster());
$column_family = new ColumnFamily($pool, $columnfamily_name);
$no_index_expression = 0;
@@ -464,7 +464,7 @@
$key = $_POST['key'];
- $pool = new ConnectionPool($keyspace_name, $cluster_helper->getArrayOfNodesForCurrentCluster());
+ $pool = new ConnectionPool($keyspace_name, $cluster_helper->getArrayOfNodesForCurrentCluster(),null,5,5000,5000,10000,$cluster_helper->getCredentialsForCurrentCluster());
$column_family = new ColumnFamily($pool, $columnfamily_name);
$no_column = 1;
@@ -624,7 +624,7 @@
$vw_vars['columnfamily_name'] = $columnfamily_name;
try {
- $pool = new ConnectionPool($keyspace_name, $cluster_helper->getArrayOfNodesForCurrentCluster());
+ $pool = new ConnectionPool($keyspace_name, $cluster_helper->getArrayOfNodesForCurrentCluster(),null,5,5000,5000,10000,$cluster_helper->getCredentialsForCurrentCluster());
$column_family = new ColumnFamily($pool, $columnfamily_name);
// Increment counter
@@ -797,7 +797,7 @@
$vw_vars['mode'] = 'edit';
try {
- $pool = new ConnectionPool($keyspace_name, $cluster_helper->getArrayOfNodesForCurrentCluster());
+ $pool = new ConnectionPool($keyspace_name, $cluster_helper->getArrayOfNodesForCurrentCluster(),null,5,5000,5000,10000,$cluster_helper->getCredentialsForCurrentCluster());
$column_family = new ColumnFamily($pool, $columnfamily_name);
$vw_vars['results'] = '';
@@ -844,7 +844,7 @@
}
try {
- $pool = new ConnectionPool($keyspace_name, $cluster_helper->getArrayOfNodesForCurrentCluster());
+ $pool = new ConnectionPool($keyspace_name, $cluster_helper->getArrayOfNodesForCurrentCluster(),null,5,5000,5000,10000,$cluster_helper->getCredentialsForCurrentCluster());
$column_family = new ColumnFamily($pool, $columnfamily_name);
$column_family->remove($key,null,$super_column_key);
@@ -891,7 +891,7 @@
if (isset($_POST['columnfamily_name'])) $columnfamily_name = $_POST['columnfamily_name'];
try {
- $pool = new ConnectionPool($keyspace_name, $cluster_helper->getArrayOfNodesForCurrentCluster());
+ $pool = new ConnectionPool($keyspace_name, $cluster_helper->getArrayOfNodesForCurrentCluster(),null,5,5000,5000,10000,$cluster_helper->getCredentialsForCurrentCluster());
$column_family = new ColumnFamily($pool, $columnfamily_name);
if ($action == 'dec') {
View
31 helper/ColumnFamilyHelper.php
@@ -40,23 +40,28 @@ public static function getCFInKeyspace($keyspace_name,$columnfamily_name) {
public static function getKeyspacesAndColumnFamiliesDetails() {
global $sys_manager;
- $keyspaces = $sys_manager->describe_keyspaces();
- $keyspaces_name = array();
- $keyspaces_details = array();
-
- foreach ($keyspaces as $keyspace) {
- $keyspaces_name[] = $keyspace->name;
-
- $columnfamilies_name = array();
+ try {
+ $keyspaces = $sys_manager->describe_keyspaces();
+ $keyspaces_name = array();
+ $keyspaces_details = array();
- foreach ($keyspace->cf_defs as $columnfamily) {
- $columnfamilies_name[] = $columnfamily->name;
+ foreach ($keyspaces as $keyspace) {
+ $keyspaces_name[] = $keyspace->name;
+
+ $columnfamilies_name = array();
+
+ foreach ($keyspace->cf_defs as $columnfamily) {
+ $columnfamilies_name[] = $columnfamily->name;
+ }
+
+ $keyspaces_details[] = array('columnfamilies_name' => $columnfamilies_name);
}
- $keyspaces_details[] = array('columnfamilies_name' => $columnfamilies_name);
+ return array('keyspaces_name' => $keyspaces_name, 'keyspaces_details' => $keyspaces_details);
+ }
+ catch(cassandra_InvalidRequestException $e) {
+ die(getHTML('server_error.php',array('error_message' => displayErrorMessage('cassandra_server_error',array('error_message' => $e->getMessage())))).getHTML('footer.php'));
}
-
- return array('keyspaces_name' => $keyspaces_name, 'keyspaces_details' => $keyspaces_details);
}
/*

0 comments on commit 2f89f82

Please sign in to comment.