Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Sort the column families alpha-numericall on index and Keyspace displays

  • Loading branch information...
commit 44fe7da1d232210690e35a41e40f7c67ba58caa3 1 parent 0b12afa
@rtconner rtconner authored
View
6 describe_keyspace.php
@@ -24,7 +24,11 @@
}
else {
try {
- $describe_keyspace = $sys_manager->describe_keyspace($keyspace_name);
+ $describe_keyspace = $sys_manager->describe_keyspace($keyspace_name);
+
+ if(defined('CF_AUTOSORT') && CF_AUTOSORT) {
+ usort($describe_keyspace->cf_defs, array('ColumnFamilyHelper', 'sortCfDefsCallable'));
+ }
// CF created successfully
$vw_vars['added_cf'] = '';
View
8 helper/ColumnFamilyHelper.php
@@ -57,6 +57,10 @@ public static function getKeyspacesAndColumnFamiliesDetails() {
$columnfamilies_name[] = $columnfamily->name;
}
+ if(defined('CF_AUTOSORT') && CF_AUTOSORT) {
+ sort($columnfamilies_name);
+ }
+
$keyspaces_details[] = array('columnfamilies_name' => $columnfamilies_name);
}
@@ -111,5 +115,9 @@ public static function displaySCFRow($row_key,$keyspace_name,$columnfamily_name,
return $output;
}
+
+ public static function sortCfDefsCallable($a, $b) {
+ return strcmp($a->name, $b->name);
+ }
}
?>
View
2  include/conf.inc.php
@@ -39,4 +39,6 @@
define('CCA_PASSWORD','');
define('MX4J_HTTP_ADAPTOR_PORT',8081);
+
+ define('CF_AUTOSORT', true); // column family autosort alpha-numerically
?>
Please sign in to comment.
Something went wrong with that request. Please try again.