hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r575156 [2/3] - in /lucene/hadoop/trunk/src/contrib/hbase: ./ src/java/org/apache/hadoop/hbase/ src/java/org/apache/hadoop/hbase/shell/ src/java/org/apache/hadoop/hbase/shell/generated/ src/test/org/apache/hadoop/hbase/ src/test/org/apache/...
Date Thu, 13 Sep 2007 04:01:07 GMT
Modified: lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/shell/SelectCommand.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/shell/SelectCommand.java?rev=575156&r1=575155&r2=575156&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/shell/SelectCommand.java (original)
+++ lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/shell/SelectCommand.java Wed Sep 12 21:01:05 2007
@@ -20,6 +20,7 @@
 package org.apache.hadoop.hbase.shell;
 
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
@@ -35,75 +36,66 @@
 import org.apache.hadoop.io.DataInputBuffer;
 import org.apache.hadoop.io.Text;
 
+/**
+ * Selects values from tables.
+ * 
+ * TODO: INTO FILE is not yet implemented.
+ */
 public class SelectCommand extends BasicCommand {
   
-  private Text table;
+  private Text tableName;
+  private Text rowKey = new Text("");
+  private List<String> columns;
+  private long timestamp;
   private int limit;
-  private Map<String, List<String>> condition;
+  private int version;
+  private boolean whereClause = false;
 
   public ReturnMsg execute(Configuration conf) {
-    if (this.condition != null && this.condition.containsKey("error"))
+    if (this.tableName.equals("") || this.rowKey == null ||
+        this.columns.size() == 0) {
       return new ReturnMsg(0, "Syntax error : Please check 'Select' syntax.");
-
+    } 
+    
     try {
-      HTable table = new HTable(conf, this.table);
+      HTable table = new HTable(conf, this.tableName);
       HBaseAdmin admin = new HBaseAdmin(conf);
-      
-      switch (getCondition()) {
-      case 0:
-
-        HTableDescriptor[] tables = admin.listTables();
-        Text[] columns = null;
+      if (this.whereClause) {
+        compoundWherePrint(table, admin);
+      } else {
+        scanPrint(table, admin);
+      }
+      return new ReturnMsg(1, "Successfully print out the selected data.");
+    } catch (IOException e) {
+      String[] msg = e.getMessage().split("[,]");
+      return new ReturnMsg(0, msg[0]);
+    }
+  }
 
-        if (this.table.equals(HConstants.ROOT_TABLE_NAME)
-            || this.table.equals(HConstants.META_TABLE_NAME)) {
-          columns = HConstants.COLUMN_FAMILY_ARRAY;
-        } else {
-          for (int i = 0; i < tables.length; i++) {
-            if (tables[i].getName().equals(this.table)) {
-              columns = tables[i].families().keySet().toArray(new Text[] {});
-            }
+  private void compoundWherePrint(HTable table, HBaseAdmin admin) {
+    try {
+      if (this.version != 0) {
+        byte[][] result = null;
+        Text[] cols = getColumns(admin);
+        for (int i = 0; i < cols.length; i++) {
+          if (this.timestamp == 0) {
+            result = table.get(this.rowKey, cols[i], this.timestamp, this.version);
+          } else {
+            result = table.get(this.rowKey, cols[i], this.version);
           }
-        }
-
-        HScannerInterface scan = table.obtainScanner(columns, new Text(""));
-        HStoreKey key = new HStoreKey();
-        TreeMap<Text, byte[]> results = new TreeMap<Text, byte[]>();
-
-        ConsoleTable.selectHead();
-        int count = 0;
-        while (scan.next(key, results)) {
-          Text rowKey = key.getRow();
-
-          for (Text columnKey : results.keySet()) {
-            byte[] value = results.get(columnKey);
-            String cellData = new String(value, HConstants.UTF8_ENCODING);
-
-            if (columnKey.equals(HConstants.COL_REGIONINFO)) {
-              DataInputBuffer inbuf = new DataInputBuffer();
-              HRegionInfo info = new HRegionInfo();
-              inbuf.reset(value, value.length);
-              info.readFields(inbuf);
 
-              cellData = "ID : " + String.valueOf(info.getRegionId());
-            }
-            ConsoleTable.printLine(count, rowKey.toString(), columnKey.toString(),
-                cellData);
-            count++;
+          ConsoleTable.selectHead();
+          for (int ii = 0; ii < result.length; ii++) {
+            ConsoleTable.printLine(i, this.rowKey.toString(), cols[i].toString(),
+                new String(result[ii], HConstants.UTF8_ENCODING));
           }
-          results = new TreeMap<Text, byte[]>();
+          ConsoleTable.selectFoot();
         }
-        ConsoleTable.selectFoot();
-        scan.close();
-
-        break;
-
-      case 1:
-
-        count = 0;
+      } else {
+        int count = 0;
         ConsoleTable.selectHead();
-        for (Map.Entry<Text, byte[]> entry : table.getRow(new Text(getRow())).entrySet()) {
-
+        
+        for (Map.Entry<Text, byte[]> entry : table.getRow(this.rowKey).entrySet()) {
           byte[] value = entry.getValue();
           String cellData = new String(value, HConstants.UTF8_ENCODING);
 
@@ -112,138 +104,121 @@
             HRegionInfo info = new HRegionInfo();
             inbuf.reset(value, value.length);
             info.readFields(inbuf);
-
-            cellData = "ID : " + String.valueOf(info.getRegionId());
+            cellData = String.valueOf(info.getRegionId());
           }
-          ConsoleTable.printLine(count, getRow().toString(), entry.getKey().toString(),
-              cellData);
-          count++;
-        }
-        ConsoleTable.selectFoot();
-
-        break;
-
-      case 2:
-
-        Text[] column = new Text[] { new Text(getColumn()) };
-
-        HScannerInterface scanner = table.obtainScanner(column, new Text(""));
-        HStoreKey k = new HStoreKey();
-        TreeMap<Text, byte[]> r = new TreeMap<Text, byte[]>();
 
-        ConsoleTable.selectHead();
-        count = 0;
-        while (scanner.next(k, r)) {
-          Text rowKey = k.getRow();
-
-          for (Text columnKey : r.keySet()) {
-            byte[] value = r.get(columnKey);
-            String cellData = new String(value, HConstants.UTF8_ENCODING);
-            ConsoleTable.printLine(count, rowKey.toString(), columnKey.toString(),
-                cellData);
+          if (columns.contains(entry.getKey().toString()) || columns.contains("*")) {
+            ConsoleTable.printLine(count, this.rowKey.toString(), entry.getKey()
+                .toString(), cellData);
             count++;
           }
-          results = new TreeMap<Text, byte[]>();
         }
         ConsoleTable.selectFoot();
-        scanner.close();
-
-        break;
-
-      case 3:
-
-        byte[] rs1 = table.get(new Text(getRow()), new Text(getColumn()));
+      }
+    } catch (IOException e) {
+      e.printStackTrace();
+    }
+  }
 
-        ConsoleTable.selectHead();
-        ConsoleTable.printLine(0, getRow(), getColumn(),
-          new String(rs1, HConstants.UTF8_ENCODING));
-        ConsoleTable.selectFoot();
+  private void scanPrint(HTable table, HBaseAdmin admin) {
+    HScannerInterface scan = null;
+    try {
+      if (this.timestamp == 0) {
+        scan = table.obtainScanner(getColumns(admin), this.rowKey);
+      } else {
+        scan = table.obtainScanner(getColumns(admin), this.rowKey, this.timestamp);
+      }
 
-        break;
+      HStoreKey key = new HStoreKey();
+      TreeMap<Text, byte[]> results = new TreeMap<Text, byte[]>();
 
-      case 4:
+      ConsoleTable.selectHead();
+      int count = 0;
 
-        byte[][] rs2 = table.get(new Text(getRow()), new Text(getColumn()), this.limit);
+      while (scan.next(key, results) && checkLimit(count)) {
+        Text rowKey = key.getRow();
 
-        ConsoleTable.selectHead();
-        for (int i = 0; i < rs2.length; i++) {
-          ConsoleTable.printLine(i, getRow(), getColumn(),
-            new String(rs2[i], HConstants.UTF8_ENCODING));
+        for (Text columnKey : results.keySet()) {
+          String cellData = new String(results.get(columnKey), HConstants.UTF8_ENCODING);
+          ConsoleTable.printLine(count, rowKey.toString(), columnKey.toString(), cellData);
         }
-        ConsoleTable.selectFoot();
-
-        break;
-
-      case 5:
+        count++;
+      }
+      ConsoleTable.selectFoot();
+      scan.close();
+    } catch (IOException e) {
+      e.printStackTrace();
+    }
+  }
 
-        byte[][] rs3 = table.get(new Text(getRow()), new Text(getColumn()), getTime(), this.limit);
+  public Text[] getColumns(HBaseAdmin admin) {
+    Text[] cols = null;
 
-        ConsoleTable.selectHead();
-        for (int i = 0; i < rs3.length; i++) {
-          ConsoleTable.printLine(i, getRow(), getColumn(), new String(rs3[i], HConstants.UTF8_ENCODING));
+    try {
+      if (this.columns.contains("*")) {
+        HTableDescriptor[] tables = admin.listTables();
+        if (this.tableName.equals(HConstants.ROOT_TABLE_NAME)
+            || this.tableName.equals(HConstants.META_TABLE_NAME)) {
+          cols = HConstants.COLUMN_FAMILY_ARRAY;
+        } else {
+          for (int i = 0; i < tables.length; i++) {
+            if (tables[i].getName().equals(this.tableName)) {
+              cols = tables[i].families().keySet().toArray(new Text[] {});
+            }
+          }
         }
-        ConsoleTable.selectFoot();
-
-        break;
-
+      } else {
+        List<Text> tmpList = new ArrayList<Text>();
+        for (int i = 0; i < this.columns.size(); i++) {
+          Text column = null;
+          if(this.columns.get(i).contains(":"))
+            column = new Text(this.columns.get(i));
+          else
+            column = new Text(this.columns.get(i) + ":");
+          
+          tmpList.add(column);
+        }
+        cols = tmpList.toArray(new Text[] {});
       }
-
-      return new ReturnMsg(1, "Successfully print out the selected data.");
     } catch (IOException e) {
-      String[] msg = e.getMessage().split("[,]");
-      return new ReturnMsg(0, msg[0]);
+      e.printStackTrace();
     }
+    return cols;
+  }
+
+  private boolean checkLimit(int count) {
+    return (this.limit == 0)? true: (this.limit > count) ? true : false;
   }
 
   public void setTable(String table) {
-    this.table = new Text(table);
+    this.tableName = new Text(table);
   }
 
   public void setLimit(int limit) {
     this.limit = limit;
   }
 
-  public void setCondition(Map<String, List<String>> cond) {
-    this.condition = cond;
+  public void setWhere(boolean isWhereClause) {
+    if (isWhereClause)
+      this.whereClause = true;
   }
 
-  public String getRow() {
-    return this.condition.get("row").get(1);
+  public void setTimestamp(String timestamp) {
+    this.timestamp = Long.parseLong(timestamp);
   }
 
-  public String getColumn() {
-    return this.condition.get("column").get(1);
+  public void setColumns(List<String> columns) {
+    this.columns = columns;
   }
 
-  public long getTime() {
-    return Long.parseLong(this.condition.get("time").get(1));
+  public void setRowKey(String rowKey) {
+    if(rowKey == null) 
+      this.rowKey = null; 
+    else
+      this.rowKey = new Text(rowKey);
   }
 
-  public int getConditionSize() {
-    return this.condition.size();
-  }
-
-  public int getCondition() {
-    int type = 0;
-    if (this.condition == null) {
-      type = 0;
-    } else if (this.condition.containsKey("row")) {
-      if (getConditionSize() == 1) {
-        type = 1;
-      } else if (this.condition.containsKey("column")) {
-        if (getConditionSize() == 2) {
-          if (this.limit == 0) {
-            type = 3;
-          } else {
-            type = 4;
-          }
-        } else {
-          type = 5;
-        }
-      }
-    } else if (this.condition.containsKey("column")) {
-      type = 2;
-    }
-    return type;
+  public void setVersion(int version) {
+    this.version = version;
   }
 }

Modified: lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/shell/ShowCommand.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/shell/ShowCommand.java?rev=575156&r1=575155&r2=575156&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/shell/ShowCommand.java (original)
+++ lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/shell/ShowCommand.java Wed Sep 12 21:01:05 2007
@@ -25,6 +25,9 @@
 import org.apache.hadoop.hbase.HBaseAdmin;
 import org.apache.hadoop.hbase.HTableDescriptor;
 
+/**
+ * Shows all available tables.
+ */
 public class ShowCommand extends BasicCommand {
 
   private String command;
@@ -62,5 +65,4 @@
   public void setArgument(String argument) {
     this.command = argument;
   }
-
 }

Modified: lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/shell/generated/Parser.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/shell/generated/Parser.java?rev=575156&r1=575155&r2=575156&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/shell/generated/Parser.java (original)
+++ lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/shell/generated/Parser.java Wed Sep 12 21:01:05 2007
@@ -1,4 +1,6 @@
 /* Generated By:JavaCC: Do not edit this line. Parser.java */
+package org.apache.hadoop.hbase.shell.generated;
+
 /**
  * Copyright 2007 The Apache Software Foundation
  *
@@ -18,7 +20,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.hadoop.hbase.shell.generated;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -51,9 +52,11 @@
     Command statement = null;
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
     case HELP:
+    case ALTER:
     case CLEAR:
     case SHOW:
     case DESCRIBE:
+    case DESC:
     case CREATE:
     case DROP:
     case FS:
@@ -61,12 +64,16 @@
     case INSERT:
     case DELETE:
     case SELECT:
-    case 37:
+    case ENABLE:
+    case DISABLE:
+    case 61:
       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
       case HELP:
+      case ALTER:
       case CLEAR:
       case SHOW:
       case DESCRIBE:
+      case DESC:
       case CREATE:
       case DROP:
       case FS:
@@ -74,13 +81,15 @@
       case INSERT:
       case DELETE:
       case SELECT:
+      case ENABLE:
+      case DISABLE:
         statement = cmdStatement();
         break;
       default:
         jj_la1[0] = jj_gen;
         ;
       }
-      jj_consume_token(37);
+      jj_consume_token(61);
       break;
     case 0:
       jj_consume_token(0);
@@ -107,6 +116,7 @@
       cmd = showCommand();
       break;
     case DESCRIBE:
+    case DESC:
       cmd = descCommand();
       break;
     case CREATE:
@@ -115,6 +125,9 @@
     case DROP:
       cmd = dropCommand();
       break;
+    case ALTER:
+      cmd = alterCommand();
+      break;
     case INSERT:
       cmd = insertCommand();
       break;
@@ -124,6 +137,12 @@
     case SELECT:
       cmd = selectCommand();
       break;
+    case ENABLE:
+      cmd = enableCommand();
+      break;
+    case DISABLE:
+      cmd = disableCommand();
+      break;
     case CLEAR:
       cmd = clearCommand();
       break;
@@ -175,6 +194,7 @@
   String argument = "";
     jj_consume_token(HELP);
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+    case ALTER:
     case CLEAR:
     case SHOW:
     case DESCRIBE:
@@ -211,6 +231,9 @@
       case SELECT:
         t = jj_consume_token(SELECT);
         break;
+      case ALTER:
+        t = jj_consume_token(ALTER);
+        break;
       case CLEAR:
         t = jj_consume_token(CLEAR);
         break;
@@ -242,8 +265,9 @@
     jj_consume_token(SHOW);
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
     case ID:
-    case QUOTED_STRING:
-      argument = getString();
+    case QUOTED_IDENTIFIER:
+    case STRING_LITERAL:
+      argument = Identifier();
       break;
     default:
       jj_la1[6] = jj_gen;
@@ -257,314 +281,430 @@
   final public DescCommand descCommand() throws ParseException {
   DescCommand desc = new DescCommand();
   String argument = null;
-    jj_consume_token(DESCRIBE);
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-    case ID:
-    case QUOTED_STRING:
-      argument = getString();
+    case DESCRIBE:
+      jj_consume_token(DESCRIBE);
+      break;
+    case DESC:
+      jj_consume_token(DESC);
       break;
     default:
       jj_la1[7] = jj_gen;
-      ;
+      jj_consume_token(-1);
+      throw new ParseException();
+    }
+    argument = Identifier();
+    desc.setArgument(argument);
+    {if (true) return desc;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public Map<String, Object> ColumnSpec() throws ParseException {
+  Map<String, Object> columnSpec = new HashMap<String, Object>();
+  int n = -1;
+  Token t = null;
+    label_2:
+    while (true) {
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case MAX_VERSIONS:
+      case MAX_LENGTH:
+      case COMPRESSION:
+      case IN_MEMORY:
+      case BLOOMFILTER:
+      case VECTOR_SIZE:
+      case NUM_HASH:
+      case NUM_ENTRIES:
+        ;
+        break;
+      default:
+        jj_la1[8] = jj_gen;
+        break label_2;
+      }
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case MAX_VERSIONS:
+        jj_consume_token(MAX_VERSIONS);
+        jj_consume_token(EQUALS);
+        n = Number();
+      columnSpec.put("MAX_VERSIONS", n);
+        break;
+      case MAX_LENGTH:
+        jj_consume_token(MAX_LENGTH);
+        jj_consume_token(EQUALS);
+        n = Number();
+      columnSpec.put("MAX_LENGTH", n);
+        break;
+      case COMPRESSION:
+        jj_consume_token(COMPRESSION);
+        jj_consume_token(EQUALS);
+        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+        case NONE:
+          t = jj_consume_token(NONE);
+          break;
+        case BLOCK:
+          t = jj_consume_token(BLOCK);
+          break;
+        case RECORD:
+          t = jj_consume_token(RECORD);
+          break;
+        default:
+          jj_la1[9] = jj_gen;
+          jj_consume_token(-1);
+          throw new ParseException();
+        }
+      columnSpec.put("COMPRESSION", t.image.toString());
+        break;
+      case IN_MEMORY:
+        jj_consume_token(IN_MEMORY);
+      columnSpec.put("IN_MEMORY", true);
+        break;
+      case BLOOMFILTER:
+        jj_consume_token(BLOOMFILTER);
+        jj_consume_token(EQUALS);
+        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+        case BLOOMFILTER:
+          t = jj_consume_token(BLOOMFILTER);
+          break;
+        case COUNTING_BLOOMFILTER:
+          t = jj_consume_token(COUNTING_BLOOMFILTER);
+          break;
+        case RETOUCHED_BLOOMFILTER:
+          t = jj_consume_token(RETOUCHED_BLOOMFILTER);
+          break;
+        default:
+          jj_la1[10] = jj_gen;
+          jj_consume_token(-1);
+          throw new ParseException();
+        }
+      columnSpec.put("BLOOMFILTER", t.image.toString());
+        break;
+      case VECTOR_SIZE:
+        jj_consume_token(VECTOR_SIZE);
+        jj_consume_token(EQUALS);
+        n = Number();
+      columnSpec.put("VECTOR_SIZE", n);
+        break;
+      case NUM_HASH:
+        jj_consume_token(NUM_HASH);
+        jj_consume_token(EQUALS);
+        n = Number();
+      columnSpec.put("NUM_HASH", n);
+        break;
+      case NUM_ENTRIES:
+        jj_consume_token(NUM_ENTRIES);
+        jj_consume_token(EQUALS);
+        n = Number();
+      columnSpec.put("NUM_ENTRIES", n);
+        break;
+      default:
+        jj_la1[11] = jj_gen;
+        jj_consume_token(-1);
+        throw new ParseException();
+      }
     }
-      desc.setArgument(argument);
-      {if (true) return desc;}
+    {if (true) return columnSpec;}
     throw new Error("Missing return statement in function");
   }
 
   final public CreateCommand createCommand() throws ParseException {
-  CreateCommand create = new CreateCommand();
-  String argument = null;
-  List<String> columnfamilies = null;
-  int limit = 1;
+  CreateCommand createCommand = new CreateCommand();
+  String table = null;
+  Map<String, Object> columnSpec = null;
+  String column = null;
     jj_consume_token(CREATE);
-    argument = getString();
-         create.setTable(argument);
-    jj_consume_token(COLUMNFAMILIES);
-    columnfamilies = getLiteralValues();
-         create.setColumnfamilies(columnfamilies);
-    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-    case LIMIT:
-      jj_consume_token(LIMIT);
-      jj_consume_token(EQUALS);
-      limit = getInt();
-            try{
-               create.setLimit(limit);
-            }catch(ClassCastException ce) {
-               {if (true) throw generateParseException();}
+    jj_consume_token(TABLE);
+    table = Identifier();
+    createCommand.setTable(table);
+    jj_consume_token(LPAREN);
+    column = Identifier();
+    columnSpec = ColumnSpec();
+    createCommand.addColumnSpec(column, columnSpec);
+    label_3:
+    while (true) {
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case COMMA:
+        ;
+        break;
+      default:
+        jj_la1[12] = jj_gen;
+        break label_3;
+      }
+      jj_consume_token(COMMA);
+      column = Identifier();
+      columnSpec = ColumnSpec();
+        createCommand.addColumnSpec(column, columnSpec);
+    }
+    jj_consume_token(RPAREN);
+    {if (true) return createCommand;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public AlterCommand alterCommand() throws ParseException {
+  AlterCommand alterCommand = new AlterCommand();
+  String table = null;
+  String column = null;
+  Map<String, Object> columnSpec = null;
+    jj_consume_token(ALTER);
+    jj_consume_token(TABLE);
+    table = Identifier();
+    alterCommand.setTable(table);
+    if (jj_2_1(2)) {
+      jj_consume_token(ADD);
+      column = Identifier();
+      columnSpec = ColumnSpec();
+         alterCommand.setOperationType(AlterCommand.OperationType.ADD);
+         alterCommand.addColumnSpec(column, columnSpec);
+    } else {
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case ADD:
+        jj_consume_token(ADD);
+        jj_consume_token(LPAREN);
+      alterCommand.setOperationType(AlterCommand.OperationType.ADD);
+        column = Identifier();
+        columnSpec = ColumnSpec();
+      alterCommand.addColumnSpec(column, columnSpec);
+        label_4:
+        while (true) {
+          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+          case COMMA:
+            ;
+            break;
+          default:
+            jj_la1[13] = jj_gen;
+            break label_4;
+          }
+          jj_consume_token(COMMA);
+          column = Identifier();
+          columnSpec = ColumnSpec();
+          alterCommand.addColumnSpec(column, columnSpec);
         }
-      break;
-    default:
-      jj_la1[8] = jj_gen;
-      ;
+        jj_consume_token(RPAREN);
+        break;
+      case DROP:
+        jj_consume_token(DROP);
+        column = Identifier();
+      alterCommand.setOperationType(AlterCommand.OperationType.DROP);
+      alterCommand.setColumn(column);
+        break;
+      case CHANGE:
+        jj_consume_token(CHANGE);
+        column = Identifier();
+        columnSpec = ColumnSpec();
+      alterCommand.setOperationType(AlterCommand.OperationType.CHANGE);
+      alterCommand.addColumnSpec(column, columnSpec);
+        break;
+      default:
+        jj_la1[14] = jj_gen;
+        jj_consume_token(-1);
+        throw new ParseException();
+      }
     }
-    {if (true) return create;}
+    {if (true) return alterCommand;}
     throw new Error("Missing return statement in function");
   }
 
   final public DropCommand dropCommand() throws ParseException {
   DropCommand drop = new DropCommand();
-  String argument = null;
+  List<String> tableList = null;
     jj_consume_token(DROP);
-    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-    case ID:
-    case QUOTED_STRING:
-      argument = getString();
-      break;
-    default:
-      jj_la1[9] = jj_gen;
-      ;
-    }
-      drop.setArgument(argument);
-      {if (true) return drop;}
+    jj_consume_token(TABLE);
+    tableList = TableList();
+     drop.setTableList(tableList);
+     {if (true) return drop;}
     throw new Error("Missing return statement in function");
   }
 
   final public InsertCommand insertCommand() throws ParseException {
-    InsertCommand in = new InsertCommand();
-    Map<String, List<String>> cond = null;
-    List<String> columnfamilies = null;
-    List<String> values = null;
-    String table = null;
+  InsertCommand in = new InsertCommand();
+  List<String> columnfamilies = null;
+  List<String> values = null;
+  String table = null;
+  Token t = null;
     jj_consume_token(INSERT);
-    table = getString();
-         in.setTable(table);
-    columnfamilies = getLiteralValues();
-        in.setColumnfamilies(columnfamilies);
+    jj_consume_token(INTO);
+    table = Identifier();
+     in.setTable(table);
+    columnfamilies = getColumns();
+     in.setColumnfamilies(columnfamilies);
     jj_consume_token(VALUES);
     values = getLiteralValues();
-        in.setValues(values);
+     in.setValues(values);
     jj_consume_token(WHERE);
-    cond = WhereClause();
-        try{
-           in.setCondition(cond);
-        }catch(ClassCastException ce) {
-           {if (true) throw generateParseException();}
-        }
-       {if (true) return in;}
-    throw new Error("Missing return statement in function");
-  }
-
-  final public DeleteCommand deleteCommand() throws ParseException {
-    DeleteCommand del = new DeleteCommand();
-    Map<String, List<String>> cond = null;
-    String argument = null;
-    jj_consume_token(DELETE);
-    argument = getString();
-         del.setTable(argument);
-    jj_consume_token(WHERE);
-    cond = WhereClause();
-        try{
-           del.setCondition(cond);
-        }catch(ClassCastException ce) {
-            {if (true) throw generateParseException();}
-       }
-       {if (true) return del;}
-    throw new Error("Missing return statement in function");
-  }
-
-  final public SelectCommand selectCommand() throws ParseException {
-    SelectCommand select = new SelectCommand();
-    Map<String, List<String>> cond = null;
-    String argument = null;
-    int limit;
-    jj_consume_token(SELECT);
-    argument = getString();
-         select.setTable(argument);
+    jj_consume_token(ROW);
+    jj_consume_token(EQUALS);
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-    case WHERE:
-      jj_consume_token(WHERE);
-      cond = WhereClause();
-        try{
-           select.setCondition(cond);
-        }catch(ClassCastException ce) {
-            {if (true) throw generateParseException();}
-        }
+    case STRING_LITERAL:
+      t = jj_consume_token(STRING_LITERAL);
       break;
-    default:
-      jj_la1[10] = jj_gen;
-      ;
-    }
-    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-    case LIMIT:
-      jj_consume_token(LIMIT);
-      jj_consume_token(EQUALS);
-      limit = getInt();
-            try{
-               select.setLimit(limit);
-            }catch(ClassCastException ce) {
-               {if (true) throw generateParseException();}
-        }
+    case QUOTED_IDENTIFIER:
+      t = jj_consume_token(QUOTED_IDENTIFIER);
       break;
     default:
-      jj_la1[11] = jj_gen;
-      ;
+      jj_la1[15] = jj_gen;
+      jj_consume_token(-1);
+      throw new ParseException();
     }
-    {if (true) return select;}
+     in.setRow(t.image.substring(1, t.image.length()-1));
+    {if (true) return in;}
     throw new Error("Missing return statement in function");
   }
 
-  final public ClearCommand clearCommand() throws ParseException {
-  ClearCommand clear = new ClearCommand();
-    jj_consume_token(CLEAR);
-              {if (true) return clear;}
-    throw new Error("Missing return statement in function");
-  }
-
-/**
-* TODO : expressions codes need more love.
-*/
-  final public String getString() throws ParseException {
+  final public DeleteCommand deleteCommand() throws ParseException {
+  DeleteCommand deleteCommand = new DeleteCommand();
+  List<String> columnList = null;
   Token t = null;
+  String table = null;
+    jj_consume_token(DELETE);
+    columnList = ColumnList();
+    deleteCommand.setColumnList(columnList);
+    jj_consume_token(FROM);
+    table = Identifier();
+    deleteCommand.setTable(table);
+    jj_consume_token(WHERE);
+    jj_consume_token(ROW);
+    jj_consume_token(EQUALS);
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-    case ID:
-      t = jj_consume_token(ID);
+    case STRING_LITERAL:
+      t = jj_consume_token(STRING_LITERAL);
       break;
-    case QUOTED_STRING:
-      t = jj_consume_token(QUOTED_STRING);
+    case QUOTED_IDENTIFIER:
+      t = jj_consume_token(QUOTED_IDENTIFIER);
       break;
     default:
-      jj_la1[12] = jj_gen;
+      jj_la1[16] = jj_gen;
       jj_consume_token(-1);
       throw new ParseException();
     }
-      {if (true) return t.image.toString();}
-    throw new Error("Missing return statement in function");
-  }
-
-  final public int getInt() throws ParseException {
-  Token t = null;
-    t = jj_consume_token(NUM);
-     {if (true) return Integer.parseInt(t.image.toString());}
+    deleteCommand.setRow(t.image.substring(1, t.image.length()-1));
+    {if (true) return deleteCommand;}
     throw new Error("Missing return statement in function");
   }
 
-  final public Map<String, List<String>> WhereClause() throws ParseException {
-    Map<String, List<String>> result =
-               new HashMap<String, List<String>>();
-    List<String> exception =
-               new ArrayList<String>();
-      try{
-        result.putAll(ConditionExpression());
-      }catch(ParseException pe) {
-        exception.add(pe.toString());
-        result.put("error", exception);
-      }
-    label_2:
-    while (true) {
+  final public SelectCommand selectCommand() throws ParseException {
+  SelectCommand select = new SelectCommand();
+  List<String> columns = null;
+  String rowKey = "";
+  String timestamp = null;
+  int numVersion = 0;
+  String tableName = null;
+  int limit;
+    jj_consume_token(SELECT);
+    columns = ColumnList();
+    jj_consume_token(FROM);
+    tableName = Identifier();
+     select.setColumns(columns);
+     select.setTable(tableName);
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+    case STARTING:
+    case WHERE:
       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-      case AND:
-        ;
+      case WHERE:
+        jj_consume_token(WHERE);
+        jj_consume_token(ROW);
+        jj_consume_token(EQUALS);
+       select.setWhere(true);
+        break;
+      case STARTING:
+        jj_consume_token(STARTING);
+        jj_consume_token(FROM);
         break;
       default:
-        jj_la1[13] = jj_gen;
-        break label_2;
-      }
-      jj_consume_token(AND);
-      try{
-        result.putAll(ConditionExpression());
-      }catch(ParseException pe) {
-        exception.add(pe.toString());
-        result.put("error", exception);
+        jj_la1[17] = jj_gen;
+        jj_consume_token(-1);
+        throw new ParseException();
       }
-    }
-   {if (true) return result;}
-    throw new Error("Missing return statement in function");
-  }
-
-  final public Map<String, List<String>> ConditionExpression() throws ParseException {
-    Token tSearchName, tComparator, tComparand;
-    Map<String, List<String>> tmp =
-               new HashMap<String, List<String>>();
-    List<String> values =
-               new ArrayList<String>();
-    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-    case ROW:
-      tSearchName = jj_consume_token(ROW);
-      break;
-    case COLUMN:
-      tSearchName = jj_consume_token(COLUMN);
-      break;
-    case TIME:
-      tSearchName = jj_consume_token(TIME);
-      break;
-    case ID:
-      tSearchName = jj_consume_token(ID);
-      break;
-    case VALUES:
-      tSearchName = jj_consume_token(VALUES);
-      break;
-    case COLUMNFAMILIES:
-      tSearchName = jj_consume_token(COLUMNFAMILIES);
+      rowKey = getStringLiteral();
+       select.setRowKey(rowKey);
       break;
     default:
-      jj_la1[14] = jj_gen;
-      jj_consume_token(-1);
-      throw new ParseException();
+      jj_la1[18] = jj_gen;
+      ;
     }
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-    case EQUALS:
-      tComparator = jj_consume_token(EQUALS);
-      break;
-    case NOTEQUAL:
-      tComparator = jj_consume_token(NOTEQUAL);
+    case TIMESTAMP:
+      jj_consume_token(TIMESTAMP);
+      timestamp = getStringLiteral();
+       select.setTimestamp(timestamp);
       break;
     default:
-      jj_la1[15] = jj_gen;
-      jj_consume_token(-1);
-      throw new ParseException();
+      jj_la1[19] = jj_gen;
+      ;
     }
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-    case QUOTED_STRING:
-      tComparand = jj_consume_token(QUOTED_STRING);
-          values.add("quoted string");
-          tmp.put("error", values);
-          {if (true) return tmp;}
+    case NUM_VERSIONS:
+      jj_consume_token(NUM_VERSIONS);
+      numVersion = Number();
+        select.setVersion(numVersion);
       break;
-    case STRING_LITERAL:
-      tComparand = jj_consume_token(STRING_LITERAL);
-    values.add(tComparator.image);
-    values.add(tComparand.image.substring(1,tComparand.image.length() - 1));
-
-  if(tSearchName.image.toString().equals("row") ||
-  tSearchName.image.toString().equals("column") ||
-  tSearchName.image.toString().equals("time"))
-    { tmp.put(tSearchName.image, values); }
-  else
-    {
-    values.add(tSearchName.image.toString());
-    tmp.put("error", values);
+    default:
+      jj_la1[20] = jj_gen;
+      ;
     }
-
-    {if (true) return tmp;}
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+    case LIMIT:
+      jj_consume_token(LIMIT);
+      jj_consume_token(EQUALS);
+      limit = Number();
+      try{
+        select.setLimit(limit);
+      }catch(ClassCastException ce) {
+        {if (true) throw generateParseException();}
+      }
       break;
     default:
-      jj_la1[16] = jj_gen;
-      jj_consume_token(-1);
-      throw new ParseException();
+      jj_la1[21] = jj_gen;
+      ;
     }
+    {if (true) return select;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public EnableCommand enableCommand() throws ParseException {
+  EnableCommand enableCommand = new EnableCommand();
+  String table = null;
+    jj_consume_token(ENABLE);
+    table = Identifier();
+    enableCommand.setTable(table);
+    {if (true) return enableCommand;}
     throw new Error("Missing return statement in function");
   }
 
+  final public DisableCommand disableCommand() throws ParseException {
+  DisableCommand disableCommand = new DisableCommand();
+  String table = null;
+    jj_consume_token(DISABLE);
+    table = Identifier();
+    disableCommand.setTable(table);
+    {if (true) return disableCommand;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public ClearCommand clearCommand() throws ParseException {
+  ClearCommand clear = new ClearCommand();
+    jj_consume_token(CLEAR);
+     {if (true) return clear;}
+    throw new Error("Missing return statement in function");
+  }
+
+////////////////////////////////////////////////
+// Utility expansion units...
   final public List<String> getLiteralValues() throws ParseException {
-    List<String> values = new ArrayList<String>();
-    String literal = null;
+  List<String> values = new ArrayList<String>();
+  String literal = null;
     jj_consume_token(LPAREN);
    literal = getStringLiteral();
  if(literal != null) values.add(literal);
-    label_3:
+    label_5:
     while (true) {
       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
       case COMMA:
       case ID:
-      case STRING:
-      case QUOTED_STRING:
+      case QUOTED_IDENTIFIER:
       case STRING_LITERAL:
         ;
         break;
       default:
-        jj_la1[17] = jj_gen;
-        break label_3;
+        jj_la1[22] = jj_gen;
+        break label_5;
       }
       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
       case COMMA:
@@ -573,8 +713,7 @@
    if(literal != null) values.add(literal);
         break;
       case ID:
-      case STRING:
-      case QUOTED_STRING:
+      case QUOTED_IDENTIFIER:
       case STRING_LITERAL:
         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
         case ID:
@@ -583,21 +722,18 @@
         case STRING_LITERAL:
           jj_consume_token(STRING_LITERAL);
           break;
-        case QUOTED_STRING:
-          jj_consume_token(QUOTED_STRING);
-          break;
-        case STRING:
-          jj_consume_token(STRING);
+        case QUOTED_IDENTIFIER:
+          jj_consume_token(QUOTED_IDENTIFIER);
           break;
         default:
-          jj_la1[18] = jj_gen;
+          jj_la1[23] = jj_gen;
           jj_consume_token(-1);
           throw new ParseException();
         }
        values.removeAll(values);
         break;
       default:
-        jj_la1[19] = jj_gen;
+        jj_la1[24] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
       }
@@ -608,30 +744,228 @@
   }
 
   final public String getStringLiteral() throws ParseException {
-    Token stringLiteral;
+  Token s;
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
     case STRING_LITERAL:
-      stringLiteral = jj_consume_token(STRING_LITERAL);
-   {if (true) return stringLiteral.image.substring(1,stringLiteral.image.length() - 1);}
+      s = jj_consume_token(STRING_LITERAL);
       break;
-    case QUOTED_STRING:
-      jj_consume_token(QUOTED_STRING);
-                     {if (true) return null;}
+    case QUOTED_IDENTIFIER:
+      s = jj_consume_token(QUOTED_IDENTIFIER);
       break;
     default:
-      jj_la1[20] = jj_gen;
+      jj_la1[25] = jj_gen;
+      jj_consume_token(-1);
+      throw new ParseException();
+    }
+   String value = s.image.toString();
+   {if (true) return value.substring(1,value.length() - 1);}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public List<String> getColumns() throws ParseException {
+  List<String> values = new ArrayList<String>();
+  String literal = null;
+    jj_consume_token(LPAREN);
+   literal = getColumn();
+ if(literal != null) values.add(literal);
+    label_6:
+    while (true) {
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case COMMA:
+        ;
+        break;
+      default:
+        jj_la1[26] = jj_gen;
+        break label_6;
+      }
+      jj_consume_token(COMMA);
+        literal = getColumn();
+        if(literal != null) values.add(literal);
+    }
+    jj_consume_token(RPAREN);
+     {if (true) return values;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public String getColumn() throws ParseException {
+  Token col;
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+    case ASTERISK:
+    case ID:
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case ID:
+        col = jj_consume_token(ID);
+        break;
+      case ASTERISK:
+        col = jj_consume_token(ASTERISK);
+        break;
+      default:
+        jj_la1[27] = jj_gen;
+        jj_consume_token(-1);
+        throw new ParseException();
+      }
+        {if (true) return col.image.toString();}
+      break;
+    case QUOTED_IDENTIFIER:
+    case STRING_LITERAL:
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case QUOTED_IDENTIFIER:
+        col = jj_consume_token(QUOTED_IDENTIFIER);
+        break;
+      case STRING_LITERAL:
+        col = jj_consume_token(STRING_LITERAL);
+        break;
+      default:
+        jj_la1[28] = jj_gen;
+        jj_consume_token(-1);
+        throw new ParseException();
+      }
+        {if (true) return col.image.substring(1,col.image.toString().length() - 1);}
+      break;
+    default:
+      jj_la1[29] = jj_gen;
       jj_consume_token(-1);
       throw new ParseException();
     }
     throw new Error("Missing return statement in function");
   }
 
+  final public List<String> TableList() throws ParseException {
+  List<String> tableList = new ArrayList<String>();
+  String table = null;
+    table = Identifier();
+                         tableList.add(table);
+    label_7:
+    while (true) {
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case COMMA:
+        ;
+        break;
+      default:
+        jj_la1[30] = jj_gen;
+        break label_7;
+      }
+      jj_consume_token(COMMA);
+      table = Identifier();
+      tableList.add(table);
+    }
+    {if (true) return tableList;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public List<String> ColumnList() throws ParseException {
+  List<String> columnList = new ArrayList<String>();
+  String column = null;
+    column = getColumn();
+      if(column != null) {
+        columnList.add(column);
+      } else {
+        {if (true) return columnList;}
+      }
+    label_8:
+    while (true) {
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case COMMA:
+        ;
+        break;
+      default:
+        jj_la1[31] = jj_gen;
+        break label_8;
+      }
+      jj_consume_token(COMMA);
+      column = getColumn();
+      columnList.add(column);
+    }
+    {if (true) return columnList;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public int Number() throws ParseException {
+  Token t = null;
+    t = jj_consume_token(INTEGER_LITERAL);
+    {if (true) return Integer.parseInt(t.image.toString());}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public String Identifier() throws ParseException {
+  Token t = null;
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+    case ID:
+      t = jj_consume_token(ID);
+       {if (true) return t.image.toString();}
+      break;
+    case QUOTED_IDENTIFIER:
+    case STRING_LITERAL:
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case QUOTED_IDENTIFIER:
+        t = jj_consume_token(QUOTED_IDENTIFIER);
+        break;
+      case STRING_LITERAL:
+        t = jj_consume_token(STRING_LITERAL);
+        break;
+      default:
+        jj_la1[32] = jj_gen;
+        jj_consume_token(-1);
+        throw new ParseException();
+      }
+       {if (true) return t.image.substring(1,t.image.toString().length() - 1);}
+      break;
+    default:
+      jj_la1[33] = jj_gen;
+      jj_consume_token(-1);
+      throw new ParseException();
+    }
+    throw new Error("Missing return statement in function");
+  }
+
+  final private boolean jj_2_1(int xla) {
+    jj_la = xla; jj_lastpos = jj_scanpos = token;
+    try { return !jj_3_1(); }
+    catch(LookaheadSuccess ls) { return true; }
+    finally { jj_save(0, xla); }
+  }
+
+  final private boolean jj_3R_9() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_10()) {
+    jj_scanpos = xsp;
+    if (jj_3R_11()) return true;
+    }
+    return false;
+  }
+
+  final private boolean jj_3_1() {
+    if (jj_scan_token(ADD)) return true;
+    if (jj_3R_9()) return true;
+    return false;
+  }
+
+  final private boolean jj_3R_11() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_scan_token(59)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(60)) return true;
+    }
+    return false;
+  }
+
+  final private boolean jj_3R_10() {
+    if (jj_scan_token(ID)) return true;
+    return false;
+  }
+
   public ParserTokenManager token_source;
   SimpleCharStream jj_input_stream;
   public Token token, jj_nt;
   private int jj_ntk;
+  private Token jj_scanpos, jj_lastpos;
+  private int jj_la;
+  public boolean lookingAhead = false;
+  private boolean jj_semLA;
   private int jj_gen;
-  final private int[] jj_la1 = new int[21];
+  final private int[] jj_la1 = new int[34];
   static private int[] jj_la1_0;
   static private int[] jj_la1_1;
   static {
@@ -639,11 +973,14 @@
       jj_la1_1();
    }
    private static void jj_la1_0() {
-      jj_la1_0 = new int[] {0xffe0,0xffe1,0xffe0,0x0,0xffc0,0xffc0,0x0,0x0,0x400000,0x0,0x200000,0x400000,0x0,0x800000,0x1f0000,0x60000000,0x0,0x2000000,0x0,0x2000000,0x0,};
+      jj_la1_0 = new int[] {0x3cffe0,0x3cffe1,0x3cffe0,0x0,0xcfbc0,0xcfbc0,0x0,0x600,0x0,0x0,0x0,0x0,0x0,0x0,0x1000,0x0,0x0,0xc00000,0xc00000,0x10000000,0x20000000,0x40000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,};
    }
    private static void jj_la1_1() {
-      jj_la1_1 = new int[] {0x0,0x20,0x0,0x1,0x1,0x1,0x9,0x9,0x0,0x9,0x0,0x0,0x9,0x0,0x1,0x0,0x18,0x1d,0x1d,0x1d,0x18,};
+      jj_la1_1 = new int[] {0x0,0x20000000,0x0,0x800000,0x800000,0x800000,0x18800000,0x0,0x1cc700,0x3800,0x38000,0x1cc700,0x2,0x2,0x600000,0x18000000,0x18000000,0x0,0x0,0x0,0x0,0x0,0x18800002,0x18800000,0x18800002,0x18000000,0x2,0x800080,0x18000000,0x18800080,0x2,0x2,0x18000000,0x18800000,};
    }
+  final private JJCalls[] jj_2_rtns = new JJCalls[1];
+  private boolean jj_rescan = false;
+  private int jj_gc = 0;
 
   public Parser(java.io.InputStream stream) {
      this(stream, null);
@@ -654,7 +991,8 @@
     token = new Token();
     jj_ntk = -1;
     jj_gen = 0;
-    for (int i = 0; i < 21; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 34; i++) jj_la1[i] = -1;
+    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
   }
 
   public void ReInit(java.io.InputStream stream) {
@@ -666,7 +1004,8 @@
     token = new Token();
     jj_ntk = -1;
     jj_gen = 0;
-    for (int i = 0; i < 21; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 34; i++) jj_la1[i] = -1;
+    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
   }
 
   public Parser(java.io.Reader stream) {
@@ -675,7 +1014,8 @@
     token = new Token();
     jj_ntk = -1;
     jj_gen = 0;
-    for (int i = 0; i < 21; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 34; i++) jj_la1[i] = -1;
+    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
   }
 
   public void ReInit(java.io.Reader stream) {
@@ -684,7 +1024,8 @@
     token = new Token();
     jj_ntk = -1;
     jj_gen = 0;
-    for (int i = 0; i < 21; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 34; i++) jj_la1[i] = -1;
+    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
   }
 
   public Parser(ParserTokenManager tm) {
@@ -692,7 +1033,8 @@
     token = new Token();
     jj_ntk = -1;
     jj_gen = 0;
-    for (int i = 0; i < 21; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 34; i++) jj_la1[i] = -1;
+    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
   }
 
   public void ReInit(ParserTokenManager tm) {
@@ -700,7 +1042,8 @@
     token = new Token();
     jj_ntk = -1;
     jj_gen = 0;
-    for (int i = 0; i < 21; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 34; i++) jj_la1[i] = -1;
+    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
   }
 
   final private Token jj_consume_token(int kind) throws ParseException {
@@ -710,6 +1053,16 @@
     jj_ntk = -1;
     if (token.kind == kind) {
       jj_gen++;
+      if (++jj_gc > 100) {
+        jj_gc = 0;
+        for (int i = 0; i < jj_2_rtns.length; i++) {
+          JJCalls c = jj_2_rtns[i];
+          while (c != null) {
+            if (c.gen < jj_gen) c.first = null;
+            c = c.next;
+          }
+        }
+      }
       return token;
     }
     token = oldToken;
@@ -717,6 +1070,29 @@
     throw generateParseException();
   }
 
+  static private final class LookaheadSuccess extends java.lang.Error { }
+  final private LookaheadSuccess jj_ls = new LookaheadSuccess();
+  final private boolean jj_scan_token(int kind) {
+    if (jj_scanpos == jj_lastpos) {
+      jj_la--;
+      if (jj_scanpos.next == null) {
+        jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
+      } else {
+        jj_lastpos = jj_scanpos = jj_scanpos.next;
+      }
+    } else {
+      jj_scanpos = jj_scanpos.next;
+    }
+    if (jj_rescan) {
+      int i = 0; Token tok = token;
+      while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }
+      if (tok != null) jj_add_error_token(kind, i);
+    }
+    if (jj_scanpos.kind != kind) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;
+    return false;
+  }
+
   final public Token getNextToken() {
     if (token.next != null) token = token.next;
     else token = token.next = token_source.getNextToken();
@@ -726,7 +1102,7 @@
   }
 
   final public Token getToken(int index) {
-    Token t = token;
+    Token t = lookingAhead ? jj_scanpos : token;
     for (int i = 0; i < index; i++) {
       if (t.next != null) t = t.next;
       else t = t.next = token_source.getNextToken();
@@ -744,18 +1120,48 @@
   private java.util.Vector jj_expentries = new java.util.Vector();
   private int[] jj_expentry;
   private int jj_kind = -1;
+  private int[] jj_lasttokens = new int[100];
+  private int jj_endpos;
+
+  private void jj_add_error_token(int kind, int pos) {
+    if (pos >= 100) return;
+    if (pos == jj_endpos + 1) {
+      jj_lasttokens[jj_endpos++] = kind;
+    } else if (jj_endpos != 0) {
+      jj_expentry = new int[jj_endpos];
+      for (int i = 0; i < jj_endpos; i++) {
+        jj_expentry[i] = jj_lasttokens[i];
+      }
+      boolean exists = false;
+      for (java.util.Enumeration e = jj_expentries.elements(); e.hasMoreElements();) {
+        int[] oldentry = (int[])(e.nextElement());
+        if (oldentry.length == jj_expentry.length) {
+          exists = true;
+          for (int i = 0; i < jj_expentry.length; i++) {
+            if (oldentry[i] != jj_expentry[i]) {
+              exists = false;
+              break;
+            }
+          }
+          if (exists) break;
+        }
+      }
+      if (!exists) jj_expentries.addElement(jj_expentry);
+      if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;
+    }
+  }
 
   public ParseException generateParseException() {
     jj_expentries.removeAllElements();
-    boolean[] la1tokens = new boolean[38];
-    for (int i = 0; i < 38; i++) {
+    boolean[] la1tokens = new boolean[62];
+    for (int i = 0; i < 62; i++) {
       la1tokens[i] = false;
     }
     if (jj_kind >= 0) {
       la1tokens[jj_kind] = true;
       jj_kind = -1;
     }
-    for (int i = 0; i < 21; i++) {
+    for (int i = 0; i < 34; i++) {
       if (jj_la1[i] == jj_gen) {
         for (int j = 0; j < 32; j++) {
           if ((jj_la1_0[i] & (1<<j)) != 0) {
@@ -767,13 +1173,16 @@
         }
       }
     }
-    for (int i = 0; i < 38; i++) {
+    for (int i = 0; i < 62; i++) {
       if (la1tokens[i]) {
         jj_expentry = new int[1];
         jj_expentry[0] = i;
         jj_expentries.addElement(jj_expentry);
       }
     }
+    jj_endpos = 0;
+    jj_rescan_token();
+    jj_add_error_token(0, 0);
     int[][] exptokseq = new int[jj_expentries.size()][];
     for (int i = 0; i < jj_expentries.size(); i++) {
       exptokseq[i] = (int[])jj_expentries.elementAt(i);
@@ -785,6 +1194,41 @@
   }
 
   final public void disable_tracing() {
+  }
+
+  final private void jj_rescan_token() {
+    jj_rescan = true;
+    for (int i = 0; i < 1; i++) {
+    try {
+      JJCalls p = jj_2_rtns[i];
+      do {
+        if (p.gen > jj_gen) {
+          jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
+          switch (i) {
+            case 0: jj_3_1(); break;
+          }
+        }
+        p = p.next;
+      } while (p != null);
+      } catch(LookaheadSuccess ls) { }
+    }
+    jj_rescan = false;
+  }
+
+  final private void jj_save(int index, int xla) {
+    JJCalls p = jj_2_rtns[index];
+    while (p.gen > jj_gen) {
+      if (p.next == null) { p = p.next = new JJCalls(); break; }
+      p = p.next;
+    }
+    p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;
+  }
+
+  static final class JJCalls {
+    int gen;
+    Token first;
+    int arg;
+    JJCalls next;
   }
 
 }

Modified: lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/shell/generated/ParserConstants.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/shell/generated/ParserConstants.java?rev=575156&r1=575155&r2=575156&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/shell/generated/ParserConstants.java (original)
+++ lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/shell/generated/ParserConstants.java Wed Sep 12 21:01:05 2007
@@ -1,60 +1,65 @@
 /* Generated By:JavaCC: Do not edit this line. ParserConstants.java */
-/**
- * Copyright 2007 The Apache Software Foundation
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
 package org.apache.hadoop.hbase.shell.generated;
 
 public interface ParserConstants {
 
   int EOF = 0;
   int HELP = 5;
-  int CLEAR = 6;
-  int SHOW = 7;
-  int DESCRIBE = 8;
-  int CREATE = 9;
-  int DROP = 10;
-  int FS = 11;
-  int EXIT = 12;
-  int INSERT = 13;
-  int DELETE = 14;
-  int SELECT = 15;
-  int ROW = 16;
-  int COLUMN = 17;
-  int TIME = 18;
-  int VALUES = 19;
-  int COLUMNFAMILIES = 20;
-  int WHERE = 21;
-  int LIMIT = 22;
-  int AND = 23;
-  int OR = 24;
-  int COMMA = 25;
-  int DOT = 26;
-  int LPAREN = 27;
-  int RPAREN = 28;
-  int EQUALS = 29;
-  int NOTEQUAL = 30;
-  int OPTIONS = 31;
-  int ID = 32;
-  int NUM = 33;
-  int STRING = 34;
-  int QUOTED_STRING = 35;
-  int STRING_LITERAL = 36;
+  int ALTER = 6;
+  int CLEAR = 7;
+  int SHOW = 8;
+  int DESCRIBE = 9;
+  int DESC = 10;
+  int CREATE = 11;
+  int DROP = 12;
+  int FS = 13;
+  int EXIT = 14;
+  int INSERT = 15;
+  int INTO = 16;
+  int TABLE = 17;
+  int DELETE = 18;
+  int SELECT = 19;
+  int ENABLE = 20;
+  int DISABLE = 21;
+  int STARTING = 22;
+  int WHERE = 23;
+  int FROM = 24;
+  int ROW = 25;
+  int VALUES = 26;
+  int COLUMNFAMILIES = 27;
+  int TIMESTAMP = 28;
+  int NUM_VERSIONS = 29;
+  int LIMIT = 30;
+  int AND = 31;
+  int OR = 32;
+  int COMMA = 33;
+  int DOT = 34;
+  int LPAREN = 35;
+  int RPAREN = 36;
+  int EQUALS = 37;
+  int NOTEQUAL = 38;
+  int ASTERISK = 39;
+  int MAX_VERSIONS = 40;
+  int MAX_LENGTH = 41;
+  int COMPRESSION = 42;
+  int NONE = 43;
+  int BLOCK = 44;
+  int RECORD = 45;
+  int IN_MEMORY = 46;
+  int BLOOMFILTER = 47;
+  int COUNTING_BLOOMFILTER = 48;
+  int RETOUCHED_BLOOMFILTER = 49;
+  int VECTOR_SIZE = 50;
+  int NUM_HASH = 51;
+  int NUM_ENTRIES = 52;
+  int ADD = 53;
+  int CHANGE = 54;
+  int ID = 55;
+  int INTEGER_LITERAL = 56;
+  int FLOATING_POINT_LITERAL = 57;
+  int EXPONENT = 58;
+  int QUOTED_IDENTIFIER = 59;
+  int STRING_LITERAL = 60;
 
   int DEFAULT = 0;
 
@@ -65,22 +70,30 @@
     "\"\\r\"",
     "\"\\n\"",
     "\"help\"",
+    "\"alter\"",
     "\"clear\"",
     "\"show\"",
     "\"describe\"",
+    "\"desc\"",
     "\"create\"",
     "\"drop\"",
     "\"fs\"",
     "\"exit\"",
     "\"insert\"",
+    "\"into\"",
+    "\"table\"",
     "\"delete\"",
     "\"select\"",
+    "\"enable\"",
+    "\"disable\"",
+    "\"starting\"",
+    "\"where\"",
+    "\"from\"",
     "\"row\"",
-    "\"column\"",
-    "\"time\"",
     "\"values\"",
     "\"columnfamilies\"",
-    "\"where\"",
+    "\"timestamp\"",
+    "\"num_versions\"",
     "\"limit\"",
     "\"and\"",
     "\"or\"",
@@ -90,11 +103,27 @@
     "\")\"",
     "\"=\"",
     "\"<>\"",
-    "\"-\"",
+    "\"*\"",
+    "\"max_versions\"",
+    "\"max_length\"",
+    "\"compression\"",
+    "\"none\"",
+    "\"block\"",
+    "\"record\"",
+    "\"in_memory\"",
+    "\"bloomfilter\"",
+    "\"counting_bloomfilter\"",
+    "\"retouched_bloomfilter\"",
+    "\"vector_size\"",
+    "\"num_hash\"",
+    "\"num_entries\"",
+    "\"add\"",
+    "\"change\"",
     "<ID>",
-    "<NUM>",
-    "<STRING>",
-    "<QUOTED_STRING>",
+    "<INTEGER_LITERAL>",
+    "<FLOATING_POINT_LITERAL>",
+    "<EXPONENT>",
+    "<QUOTED_IDENTIFIER>",
     "<STRING_LITERAL>",
     "\";\"",
   };



Mime
View raw message