org.apache.hadoop.hbase.hql
Class AlterCommand

java.lang.Object
  extended by org.apache.hadoop.hbase.hql.BasicCommand
      extended by org.apache.hadoop.hbase.hql.SchemaModificationCommand
          extended by org.apache.hadoop.hbase.hql.AlterCommand
All Implemented Interfaces:
Command, CommandFactory

public class AlterCommand
extends SchemaModificationCommand

Alters tables.


Nested Class Summary
static class AlterCommand.OperationType
           
 
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.hql.Command
Command.CommandType
 
Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.hql.SchemaModificationCommand
bloomFilterDesc, bloomFilterType, compression, inMemory, maxLength, maxVersions, numEntries, numHash, vectorSize
 
Fields inherited from class org.apache.hadoop.hbase.hql.BasicCommand
LINE_SEPARATOR, TABLE_NOT_FOUND
 
Fields inherited from interface org.apache.hadoop.hbase.hql.Command
FAMILY_INDICATOR
 
Constructor Summary
AlterCommand(Writer o)
           
 
Method Summary
 void addColumnSpec(String c, Map<String,Object> columnSpec)
          Adds a column specification.
 ReturnMsg execute(HBaseConfiguration conf)
          Execute a command
protected  HColumnDescriptor getColumnDescriptor(String column, Map<String,Object> columnSpec, HColumnDescriptor original)
          Given a column name, column spec, and original descriptor, returns an instance of HColumnDescriptor representing the column spec, with empty values drawn from the original as defaults
 Command.CommandType getCommandType()
           
 void setColumn(String c)
          Sets the column to be dropped.
 void setOperationType(AlterCommand.OperationType operationType)
          Sets the operation type of this alteration.
 void setTable(String t)
          Sets the table to be altered.
 
Methods inherited from class org.apache.hadoop.hbase.hql.SchemaModificationCommand
getColumnDescriptor, initOptions
 
Methods inherited from class org.apache.hadoop.hbase.hql.BasicCommand
appendDelimiter, extractErrMsg, extractErrMsg, getBasicCommand, getCommand, getOut, print, println
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlterCommand

public AlterCommand(Writer o)
Method Detail

execute

public ReturnMsg execute(HBaseConfiguration conf)
Description copied from interface: Command
Execute a command

Parameters:
conf - Configuration
Returns:
Result of command execution

setTable

public void setTable(String t)
Sets the table to be altered.

Parameters:
t - Table to be altered.

addColumnSpec

public void addColumnSpec(String c,
                          Map<String,Object> columnSpec)
Adds a column specification.

Parameters:
columnSpec - Column specification

setColumn

public void setColumn(String c)
Sets the column to be dropped. Only applicable to the DROP operation.

Parameters:
c - Column to be dropped.

setOperationType

public void setOperationType(AlterCommand.OperationType operationType)
Sets the operation type of this alteration.

Parameters:
operationType - Operation type
See Also:
AlterCommand.OperationType

getCommandType

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

getColumnDescriptor

protected HColumnDescriptor getColumnDescriptor(String column,
                                                Map<String,Object> columnSpec,
                                                HColumnDescriptor original)
                                         throws IllegalArgumentException
Given a column name, column spec, and original descriptor, returns an instance of HColumnDescriptor representing the column spec, with empty values drawn from the original as defaults

Throws:
IllegalArgumentException


Copyright © 2006 The Apache Software Foundation