$describe_keyspace = $sys_manager->describe_keyspace($keyspace_name); $old_replication_factor = $describe_keyspace->replication_factor; $old_replication_factor = $describe_keyspace->replication_factor; $strategy_options = $describe_keyspace->strategy_options; if ($old_replication_factor == '' && isset($strategy_options['replication_factor'])) { $old_replication_factor = $strategy_options['replication_factor']; } if ($old_replication_factor == '') { $old_replication_factor = 1; } $new_replication_factor = $replication_factor; // Display tips about the replication factor that has been increased if ($old_replication_factor < $new_replication_factor) { $vw_vars['success_message'] .= displayInfoMessage('edit_keyspace_increased_replication_factor', array()); } elseif ($old_replication_factor > $new_replication_factor) { $vw_vars['success_message'] .= displayInfoMessage('edit_keyspace_decreased_replication_factor', array()); } } catch (Exception $e) { $vw_vars['error_message'] = displayErrorMessage('edit_keyspace', array('keyspace_name' => $keyspace_name, 'message' => $e->getMessage())); } } /* Edit a keyspace */ if ($action == 'edit') { $is_valid_action = true; $keyspace_name = ''; if (isset($_GET['keyspace_name'])) { $keyspace_name = $_GET['keyspace_name']; } $current_page_title = 'Cassandra Cluster Admin > Edit Keyspace ' . $keyspace_name;
$column_family->remove($key); } $time_start = microtime(true); $column_family->insert($key, $data); $time_end = microtime(true); // Insert successful if (isset($_POST['mode']) && $_POST['mode'] == 'insert') { $vw_vars['success_message'] = displaySuccessMessage('insert_row', array('query_time' => getQueryTime($time_start, $time_end))); } else { $vw_vars['success_message'] = displaySuccessMessage('edit_row', array('key' => $key, 'query_time' => getQueryTime($time_start, $time_end))); } } else { $vw_vars['error_message'] = displayErrorMessage('insert_row_incomplete_fields'); } } else { $vw_vars['info_message'] = displayInfoMessage('insert_row_not_empty'); } } catch (Exception $e) { $vw_vars['error_message'] = displayErrormessage('insert_row', array('message' => $e->getMessage())); } } /* Insert a row */ if ($action == 'insert_row') { $is_valid_action = true; $keyspace_name = ''; if (isset($_GET['keyspace_name'])) { $keyspace_name = $_GET['keyspace_name']; } $columnfamily_name = '';