summaryrefslogtreecommitdiff
path: root/ndb
diff options
context:
space:
mode:
authorunknown <magnus@neptunus.(none)>2004-04-14 12:13:54 +0200
committerunknown <magnus@neptunus.(none)>2004-04-14 12:13:54 +0200
commit3b789f7ccb0d55657feac95901602ef291d771b9 (patch)
treeb9b18570c6d04283899e66fe26a9fecbaaa30e80 /ndb
parentf4adc50ea0044f4e330ffbaa712ca38c0fd74ce7 (diff)
downloadmariadb-git-3b789f7ccb0d55657feac95901602ef291d771b9.tar.gz
Added more files for NDB Cluster
Diffstat (limited to 'ndb')
-rw-r--r--ndb/home/bin/parseConfigFile.awk98
1 files changed, 98 insertions, 0 deletions
diff --git a/ndb/home/bin/parseConfigFile.awk b/ndb/home/bin/parseConfigFile.awk
new file mode 100644
index 00000000000..6903949156c
--- /dev/null
+++ b/ndb/home/bin/parseConfigFile.awk
@@ -0,0 +1,98 @@
+BEGIN{
+ where=0;
+ n_hosts=0;
+ n_api=0;
+ n_ndb=0;
+ n_mgm=0;
+ n_ports=0;
+}
+/COMPUTERS/ {
+ where=1;
+}
+/\[[ \t]*COMPUTER[ \t]*\]/ {
+ where=1;
+}
+/PROCESSES/ {
+ where=2;
+}
+/Type: MGMT/ {
+ if(where!=1){
+ where=2;
+ n_mgm++;
+ }
+}
+/\[[ \t]*MGM[ \t]*\]/ {
+ where=2;
+ n_mgm++;
+}
+/Type: DB/ {
+ if(where!=1){
+ where=3;
+ n_ndb++;
+ }
+}
+/\[[ \t]*DB[ \t]*\]/ {
+ where=3;
+ n_ndb++;
+}
+/Type: API/ {
+ if(where!=1){
+ where=4;
+ n_api++;
+ }
+}
+/\[[ \t]*API[ \t]*\]/ {
+ where=4;
+ n_api++;
+}
+/HostName:/ {
+ host_names[host_ids[n_hosts]]=$2;
+}
+
+/FileSystemPath:/ {
+ if (where==3){
+ ndb_fs[ndb_ids[n_ndb]]=$2;
+ }
+}
+
+/Id:/{
+ if(where==1){
+ n_hosts++;
+ host_ids[n_hosts]=$2;
+ }
+ if(where==2){
+ mgm_ids[n_mgm]=$2;
+ }
+ if(where==3){
+ ndb_ids[n_ndb]=$2;
+ }
+ if(where==4){
+ api_ids[n_api]=$2;
+ }
+}
+/ExecuteOnComputer:/{
+ if(where==2){
+ mgm_hosts[mgm_ids[n_mgm]]=host_names[$2];
+ }
+ if(where==3){
+ ndb_hosts[ndb_ids[n_ndb]]=host_names[$2];
+ }
+ if(where==4){
+ api_hosts[api_ids[n_api]]=host_names[$2];
+ }
+}
+END {
+ for(i=1; i<=n_mgm; i++){
+ printf("mgm_%d=%s\n", mgm_ids[i], mgm_hosts[mgm_ids[i]]);
+ }
+ for(i=1; i<=n_ndb; i++){
+ printf("ndb_%d=%s\n", ndb_ids[i], ndb_hosts[ndb_ids[i]]);
+ printf("ndbfs_%d=%s\n", ndb_ids[i], ndb_fs[ndb_ids[i]]);
+ }
+ for(i=1; i<=n_api; i++){
+ printf("api_%d=%s\n", api_ids[i], api_hosts[api_ids[i]]);
+ }
+ printf("mgm_nodes=%d\n", n_mgm);
+ printf("ndb_nodes=%d\n", n_ndb);
+ printf("api_nodes=%d\n", n_api);
+}