org.apache.hadoop.hbase.hql
Class BasicCommand

java.lang.Object
  extended by org.apache.hadoop.hbase.hql.BasicCommand
All Implemented Interfaces:
Command, CommandFactory
Direct Known Subclasses:
ClearCommand, DeleteCommand, DescCommand, DisableCommand, DropCommand, EnableCommand, ExitCommand, FsCommand, HelpCommand, InsertCommand, JarCommand, SchemaModificationCommand, SelectCommand, ShowCommand, TruncateCommand

public abstract class BasicCommand
extends Object
implements Command, CommandFactory

Takes the lowest-common-denominator Writer doing its own printlns, etc.

See Also:
HBaseShell

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.hql.Command
Command.CommandType
 
Field Summary
 String LINE_SEPARATOR
           
 String TABLE_NOT_FOUND
           
 
Fields inherited from interface org.apache.hadoop.hbase.hql.Command
FAMILY_INDICATOR
 
Constructor Summary
BasicCommand(Writer o)
          Constructor
 
Method Summary
protected  String appendDelimiter(String column)
          Appends, if it does not exist, a delimiter (colon) at the end of the column name.
protected  String extractErrMsg(Exception e)
           
protected  String extractErrMsg(String msg)
           
 BasicCommand getBasicCommand()
           
 Command getCommand()
          basic commands are their own factories.
 Command.CommandType getCommandType()
           
 Writer getOut()
           
 void print(String msg)
           
 void println(String msg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.hbase.hql.Command
execute
 

Field Detail

LINE_SEPARATOR

public final String LINE_SEPARATOR

TABLE_NOT_FOUND

public final String TABLE_NOT_FOUND
See Also:
Constant Field Values
Constructor Detail

BasicCommand

public BasicCommand(Writer o)
Constructor

Parameters:
o - A Writer.
Method Detail

getBasicCommand

public BasicCommand getBasicCommand()

getCommand

public Command getCommand()
basic commands are their own factories.

Specified by:
getCommand in interface CommandFactory

extractErrMsg

protected String extractErrMsg(String msg)

extractErrMsg

protected String extractErrMsg(Exception e)

appendDelimiter

protected String appendDelimiter(String column)
Appends, if it does not exist, a delimiter (colon) at the end of the column name.


getOut

public Writer getOut()
Returns:
Writer to use outputting.

print

public void print(String msg)
           throws IOException
Throws:
IOException

println

public void println(String msg)
             throws IOException
Throws:
IOException

getCommandType

public Command.CommandType getCommandType()
Specified by:
getCommandType in interface Command
Returns:
Type of this command whether DDL, SELECT, INSERT, UPDATE, DELETE, or SHELL.


Copyright © 2008 The Apache Software Foundation