org.apache.hadoop.hive.metastore
Class ObjectStore

java.lang.Object
  extended by org.apache.hadoop.hive.metastore.ObjectStore
All Implemented Interfaces:
org.apache.hadoop.conf.Configurable, RawStore

public class ObjectStore
extends Object
implements RawStore, org.apache.hadoop.conf.Configurable

This class is the interface between the application logic and the database store that contains the objects. Refrain putting any logic in mode.M* objects or in this file as former could be auto generated and this class would need to be made into a interface that can read both from a database and a filestore.


Constructor Summary
ObjectStore()
           
 
Method Summary
 boolean addIndex(Index index)
           
 boolean addPartition(Partition part)
           
 boolean addRole(String roleName, String ownerName)
           
 boolean alterDatabase(String dbName, Database db)
          Alter the database object in metastore.
 void alterIndex(String dbname, String baseTblName, String name, Index newIndex)
           
 void alterPartition(String dbname, String name, List<String> part_vals, Partition newPart)
           
 void alterTable(String dbname, String name, Table newTable)
           
 long cleanupEvents()
           
 boolean commitTransaction()
          if this is the commit of the first open call then an actual commit is called.
 void createDatabase(Database db)
           
 void createTable(Table tbl)
           
 boolean createType(Type type)
           
 boolean dropDatabase(String dbname)
           
 boolean dropIndex(String dbName, String origTableName, String indexName)
           
 boolean dropPartition(String dbName, String tableName, List<String> part_vals)
           
 boolean dropTable(String dbName, String tableName)
           
 boolean dropType(String typeName)
           
 List<String> getAllDatabases()
           
 List<String> getAllTables(String dbName)
           
 PrincipalPrivilegeSet getColumnPrivilegeSet(String dbName, String tableName, String partitionName, String columnName, String userName, List<String> groupNames)
           
 org.apache.hadoop.conf.Configuration getConf()
           
 Database getDatabase(String name)
           
 List<String> getDatabases(String pattern)
           
 List<PrivilegeGrantInfo> getDBPrivilege(String dbName, String principalName, PrincipalType principalType)
           
 PrincipalPrivilegeSet getDBPrivilegeSet(String dbName, String userName, List<String> groupNames)
           
 Index getIndex(String dbName, String origTableName, String indexName)
           
 List<Index> getIndexes(String dbName, String origTableName, int max)
           
 Partition getPartition(String dbName, String tableName, List<String> part_vals)
           
 PrincipalPrivilegeSet getPartitionPrivilegeSet(String dbName, String tableName, String partition, String userName, List<String> groupNames)
           
 List<Partition> getPartitions(String dbName, String tableName, int max)
           
 List<Partition> getPartitionsByFilter(String dbName, String tblName, String filter, short maxParts)
           
 List<Partition> getPartitionsByNames(String dbName, String tblName, List<String> partNames)
           
 List<Partition> getPartitionsWithAuth(String dbName, String tblName, short maxParts, String userName, List<String> groupNames)
           
 Partition getPartitionWithAuth(String dbName, String tblName, List<String> partVals, String user_name, List<String> group_names)
           
 javax.jdo.PersistenceManager getPersistenceManager()
           
 Role getRole(String roleName)
           
 Table getTable(String dbName, String tableName)
           
 List<Table> getTableObjectsByName(String db, List<String> tbl_names)
           
 PrincipalPrivilegeSet getTablePrivilegeSet(String dbName, String tableName, String userName, List<String> groupNames)
           
 List<String> getTables(String dbName, String pattern)
           
 Type getType(String typeName)
           
 PrincipalPrivilegeSet getUserPrivilegeSet(String userName, List<String> groupNames)
           
 boolean grantPrivileges(PrivilegeBag privileges)
           
 boolean grantRole(Role role, String userName, PrincipalType principalType, String grantor, PrincipalType grantorType, boolean grantOption)
           
 boolean isActiveTransaction()
           
 boolean isPartitionMarkedForEvent(String dbName, String tblName, Map<String,String> partName, PartitionEventType evtType)
           
 List<MTablePrivilege> listAllTableGrants(String principalName, PrincipalType principalType, String dbName, String tableName)
           
 List<MTablePrivilege> listAllTableGrants(String dbName, String tableName)
           
 List<String> listIndexNames(String dbName, String origTableName, short max)
           
 List<MPartitionColumnPrivilege> listPartitionAllColumnGrants(String dbName, String tableName, String partName)
           
 List<String> listPartitionNames(String dbName, String tableName, short max)
           
 List<String> listPartitionNamesByFilter(String dbName, String tableName, String filter, short maxParts)
           
 List<String> listPartitionNamesPs(String dbName, String tableName, List<String> part_vals, short max_parts)
          Lists partition names that match a given partial specification
 List<Partition> listPartitionsPsWithAuth(String db_name, String tbl_name, List<String> part_vals, short max_parts, String userName, List<String> groupNames)
          Lists partitions that match a given partial specification and sets their auth privileges.
 List<MDBPrivilege> listPrincipalDBGrants(String principalName, PrincipalType principalType, String dbName)
           
 List<MGlobalPrivilege> listPrincipalGlobalGrants(String principalName, PrincipalType principalType)
           
 List<MPartitionColumnPrivilege> listPrincipalPartitionColumnGrants(String principalName, PrincipalType principalType, String dbName, String tableName, String partitionName, String columnName)
           
 List<MPartitionPrivilege> listPrincipalPartitionGrants(String principalName, PrincipalType principalType, String dbName, String tableName, String partName)
           
 List<MTableColumnPrivilege> listPrincipalTableColumnGrants(String principalName, PrincipalType principalType, String dbName, String tableName, String columnName)
           
 List<String> listRoleNames()
           
 List<MRoleMap> listRoles(String principalName, PrincipalType principalType)
           
 List<MTableColumnPrivilege> listTableAllColumnGrants(String dbName, String tableName)
           
 List<MPartitionColumnPrivilege> listTableAllPartitionColumnGrants(String dbName, String tableName)
           
 List<MPartitionPrivilege> listTableAllPartitionGrants(String dbName, String tableName)
           
 List<String> listTableNamesByFilter(String dbName, String filter, short maxTables)
          Gets a list of tables based on a filter string and filter type.
 Table markPartitionForEvent(String dbName, String tblName, Map<String,String> partName, PartitionEventType evtType)
           
 boolean openTransaction()
          Opens a new one or the one already created Every call of this function must have corresponding commit or rollback function call
 boolean removeRole(String roleName)
           
 boolean revokePrivileges(PrivilegeBag privileges)
           
 boolean revokeRole(Role role, String userName, PrincipalType principalType)
           
 void rollbackTransaction()
          Rolls back the current transaction if it is active
 void setConf(org.apache.hadoop.conf.Configuration conf)
          Called whenever this object is instantiated using ReflectionUils, and also on connection retries.
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectStore

public ObjectStore()
Method Detail

getConf

public org.apache.hadoop.conf.Configuration getConf()
Specified by:
getConf in interface org.apache.hadoop.conf.Configurable

setConf

public void setConf(org.apache.hadoop.conf.Configuration conf)
Called whenever this object is instantiated using ReflectionUils, and also on connection retries. In cases of connection retries, conf will usually contain modified values.

Specified by:
setConf in interface org.apache.hadoop.conf.Configurable

getPersistenceManager

@InterfaceAudience.LimitedPrivate(value="HCATALOG")
@InterfaceStability.Evolving
public javax.jdo.PersistenceManager getPersistenceManager()

shutdown

public void shutdown()
Specified by:
shutdown in interface RawStore

openTransaction

public boolean openTransaction()
Opens a new one or the one already created Every call of this function must have corresponding commit or rollback function call

Specified by:
openTransaction in interface RawStore
Returns:
an active transaction

commitTransaction

public boolean commitTransaction()
if this is the commit of the first open call then an actual commit is called.

Specified by:
commitTransaction in interface RawStore
Returns:
Always returns true

isActiveTransaction

public boolean isActiveTransaction()
Returns:
true if there is an active transaction. If the current transaction is either committed or rolled back it returns false

rollbackTransaction

public void rollbackTransaction()
Rolls back the current transaction if it is active

Specified by:
rollbackTransaction in interface RawStore

createDatabase

public void createDatabase(Database db)
                    throws InvalidObjectException,
                           MetaException
Specified by:
createDatabase in interface RawStore
Throws:
InvalidObjectException
MetaException

getDatabase

public Database getDatabase(String name)
                     throws NoSuchObjectException
Specified by:
getDatabase in interface RawStore
Throws:
NoSuchObjectException

alterDatabase

public boolean alterDatabase(String dbName,
                             Database db)
                      throws MetaException,
                             NoSuchObjectException
Alter the database object in metastore. Currently only the parameters of the database can be changed.

Specified by:
alterDatabase in interface RawStore
Parameters:
dbName - the database name
db - the Hive Database object
Throws:
MetaException
NoSuchObjectException

dropDatabase

public boolean dropDatabase(String dbname)
                     throws NoSuchObjectException,
                            MetaException
Specified by:
dropDatabase in interface RawStore
Throws:
NoSuchObjectException
MetaException

getDatabases

public List<String> getDatabases(String pattern)
                          throws MetaException
Specified by:
getDatabases in interface RawStore
Throws:
MetaException

getAllDatabases

public List<String> getAllDatabases()
                             throws MetaException
Specified by:
getAllDatabases in interface RawStore
Throws:
MetaException

createType

public boolean createType(Type type)
Specified by:
createType in interface RawStore

getType

public Type getType(String typeName)
Specified by:
getType in interface RawStore

dropType

public boolean dropType(String typeName)
Specified by:
dropType in interface RawStore

createTable

public void createTable(Table tbl)
                 throws InvalidObjectException,
                        MetaException
Specified by:
createTable in interface RawStore
Throws:
InvalidObjectException
MetaException

dropTable

public boolean dropTable(String dbName,
                         String tableName)
                  throws MetaException
Specified by:
dropTable in interface RawStore
Throws:
MetaException

getTable

public Table getTable(String dbName,
                      String tableName)
               throws MetaException
Specified by:
getTable in interface RawStore
Throws:
MetaException

getTables

public List<String> getTables(String dbName,
                              String pattern)
                       throws MetaException
Specified by:
getTables in interface RawStore
Throws:
MetaException

getAllTables

public List<String> getAllTables(String dbName)
                          throws MetaException
Specified by:
getAllTables in interface RawStore
Throws:
MetaException

getTableObjectsByName

public List<Table> getTableObjectsByName(String db,
                                         List<String> tbl_names)
                                  throws MetaException,
                                         UnknownDBException
Specified by:
getTableObjectsByName in interface RawStore
Parameters:
db - The name of the database from which to retrieve the tables
tbl_names - The names of the tables to retrieve.
Returns:
A list of the tables retrievable from the database whose names are in the list tableNames. If there are duplicate names, only one instance of the table will be returned
Throws:
MetaException
UnknownDBException

addPartition

public boolean addPartition(Partition part)
                     throws InvalidObjectException,
                            MetaException
Specified by:
addPartition in interface RawStore
Throws:
InvalidObjectException
MetaException

getPartition

public Partition getPartition(String dbName,
                              String tableName,
                              List<String> part_vals)
                       throws NoSuchObjectException,
                              MetaException
Specified by:
getPartition in interface RawStore
Throws:
NoSuchObjectException
MetaException

dropPartition

public boolean dropPartition(String dbName,
                             String tableName,
                             List<String> part_vals)
                      throws MetaException
Specified by:
dropPartition in interface RawStore
Throws:
MetaException

getPartitions

public List<Partition> getPartitions(String dbName,
                                     String tableName,
                                     int max)
                              throws MetaException
Specified by:
getPartitions in interface RawStore
Throws:
MetaException

getPartitionsWithAuth

public List<Partition> getPartitionsWithAuth(String dbName,
                                             String tblName,
                                             short maxParts,
                                             String userName,
                                             List<String> groupNames)
                                      throws MetaException,
                                             NoSuchObjectException,
                                             InvalidObjectException
Specified by:
getPartitionsWithAuth in interface RawStore
Throws:
MetaException
NoSuchObjectException
InvalidObjectException

getPartitionWithAuth

public Partition getPartitionWithAuth(String dbName,
                                      String tblName,
                                      List<String> partVals,
                                      String user_name,
                                      List<String> group_names)
                               throws NoSuchObjectException,
                                      MetaException,
                                      InvalidObjectException
Specified by:
getPartitionWithAuth in interface RawStore
Throws:
NoSuchObjectException
MetaException
InvalidObjectException

listPartitionNames

public List<String> listPartitionNames(String dbName,
                                       String tableName,
                                       short max)
                                throws MetaException
Specified by:
listPartitionNames in interface RawStore
Throws:
MetaException

listPartitionsPsWithAuth

public List<Partition> listPartitionsPsWithAuth(String db_name,
                                                String tbl_name,
                                                List<String> part_vals,
                                                short max_parts,
                                                String userName,
                                                List<String> groupNames)
                                         throws MetaException,
                                                InvalidObjectException,
                                                NoSuchObjectException
Description copied from interface: RawStore
Lists partitions that match a given partial specification and sets their auth privileges. If userName and groupNames null, then no auth privileges are set.

Specified by:
listPartitionsPsWithAuth in interface RawStore
Parameters:
db_name - The name of the database which has the partitions
tbl_name - The name of the table which has the partitions
part_vals - A partial list of values for partitions in order of the table's partition keys Entries can be empty if you need to specify latter partitions.
max_parts - The maximum number of partitions to return
userName - The user name for the partition for authentication privileges
groupNames - The groupNames for the partition for authentication privileges
Returns:
A list of partitions that match the partial spec.
Throws:
MetaException
InvalidObjectException
NoSuchObjectException

listPartitionNamesPs

public List<String> listPartitionNamesPs(String dbName,
                                         String tableName,
                                         List<String> part_vals,
                                         short max_parts)
                                  throws MetaException,
                                         NoSuchObjectException
Description copied from interface: RawStore
Lists partition names that match a given partial specification

Specified by:
listPartitionNamesPs in interface RawStore
Parameters:
dbName - The name of the database which has the partitions
tableName - The name of the table which has the partitions
part_vals - A partial list of values for partitions in order of the table's partition keys. Entries can be empty if you only want to specify latter partitions.
max_parts - The maximum number of partitions to return
Returns:
A list of partition names that match the partial spec.
Throws:
MetaException
NoSuchObjectException

getPartitionsByNames

public List<Partition> getPartitionsByNames(String dbName,
                                            String tblName,
                                            List<String> partNames)
                                     throws MetaException,
                                            NoSuchObjectException
Specified by:
getPartitionsByNames in interface RawStore
Throws:
MetaException
NoSuchObjectException

getPartitionsByFilter

public List<Partition> getPartitionsByFilter(String dbName,
                                             String tblName,
                                             String filter,
                                             short maxParts)
                                      throws MetaException,
                                             NoSuchObjectException
Specified by:
getPartitionsByFilter in interface RawStore
Throws:
MetaException
NoSuchObjectException

listTableNamesByFilter

public List<String> listTableNamesByFilter(String dbName,
                                           String filter,
                                           short maxTables)
                                    throws MetaException
Description copied from interface: RawStore
Gets a list of tables based on a filter string and filter type.

Specified by:
listTableNamesByFilter in interface RawStore
Parameters:
dbName - The name of the database from which you will retrieve the table names
filter - The filter string
maxTables - The maximum number of tables returned
Returns:
A list of table names that match the desired filter
Throws:
MetaException

listPartitionNamesByFilter

public List<String> listPartitionNamesByFilter(String dbName,
                                               String tableName,
                                               String filter,
                                               short maxParts)
                                        throws MetaException
Specified by:
listPartitionNamesByFilter in interface RawStore
Throws:
MetaException

alterTable

public void alterTable(String dbname,
                       String name,
                       Table newTable)
                throws InvalidObjectException,
                       MetaException
Specified by:
alterTable in interface RawStore
Throws:
InvalidObjectException
MetaException

alterIndex

public void alterIndex(String dbname,
                       String baseTblName,
                       String name,
                       Index newIndex)
                throws InvalidObjectException,
                       MetaException
Specified by:
alterIndex in interface RawStore
Throws:
InvalidObjectException
MetaException

alterPartition

public void alterPartition(String dbname,
                           String name,
                           List<String> part_vals,
                           Partition newPart)
                    throws InvalidObjectException,
                           MetaException
Specified by:
alterPartition in interface RawStore
Throws:
InvalidObjectException
MetaException

addIndex

public boolean addIndex(Index index)
                 throws InvalidObjectException,
                        MetaException
Specified by:
addIndex in interface RawStore
Throws:
InvalidObjectException
MetaException

dropIndex

public boolean dropIndex(String dbName,
                         String origTableName,
                         String indexName)
                  throws MetaException
Specified by:
dropIndex in interface RawStore
Throws:
MetaException

getIndex

public Index getIndex(String dbName,
                      String origTableName,
                      String indexName)
               throws MetaException
Specified by:
getIndex in interface RawStore
Throws:
MetaException

getIndexes

public List<Index> getIndexes(String dbName,
                              String origTableName,
                              int max)
                       throws MetaException
Specified by:
getIndexes in interface RawStore
Throws:
MetaException

listIndexNames

public List<String> listIndexNames(String dbName,
                                   String origTableName,
                                   short max)
                            throws MetaException
Specified by:
listIndexNames in interface RawStore
Throws:
MetaException

addRole

public boolean addRole(String roleName,
                       String ownerName)
                throws InvalidObjectException,
                       MetaException,
                       NoSuchObjectException
Specified by:
addRole in interface RawStore
Throws:
InvalidObjectException
MetaException
NoSuchObjectException

grantRole

public boolean grantRole(Role role,
                         String userName,
                         PrincipalType principalType,
                         String grantor,
                         PrincipalType grantorType,
                         boolean grantOption)
                  throws MetaException,
                         NoSuchObjectException,
                         InvalidObjectException
Specified by:
grantRole in interface RawStore
Throws:
MetaException
NoSuchObjectException
InvalidObjectException

revokeRole

public boolean revokeRole(Role role,
                          String userName,
                          PrincipalType principalType)
                   throws MetaException,
                          NoSuchObjectException
Specified by:
revokeRole in interface RawStore
Throws:
MetaException
NoSuchObjectException

removeRole

public boolean removeRole(String roleName)
                   throws MetaException,
                          NoSuchObjectException
Specified by:
removeRole in interface RawStore
Throws:
MetaException
NoSuchObjectException

listRoles

public List<MRoleMap> listRoles(String principalName,
                                PrincipalType principalType)
Specified by:
listRoles in interface RawStore

getRole

public Role getRole(String roleName)
             throws NoSuchObjectException
Specified by:
getRole in interface RawStore
Throws:
NoSuchObjectException

listRoleNames

public List<String> listRoleNames()
Specified by:
listRoleNames in interface RawStore

getUserPrivilegeSet

public PrincipalPrivilegeSet getUserPrivilegeSet(String userName,
                                                 List<String> groupNames)
                                          throws InvalidObjectException,
                                                 MetaException
Specified by:
getUserPrivilegeSet in interface RawStore
Throws:
InvalidObjectException
MetaException

getDBPrivilege

public List<PrivilegeGrantInfo> getDBPrivilege(String dbName,
                                               String principalName,
                                               PrincipalType principalType)
                                        throws InvalidObjectException,
                                               MetaException
Throws:
InvalidObjectException
MetaException

getDBPrivilegeSet

public PrincipalPrivilegeSet getDBPrivilegeSet(String dbName,
                                               String userName,
                                               List<String> groupNames)
                                        throws InvalidObjectException,
                                               MetaException
Specified by:
getDBPrivilegeSet in interface RawStore
Throws:
InvalidObjectException
MetaException

getPartitionPrivilegeSet

public PrincipalPrivilegeSet getPartitionPrivilegeSet(String dbName,
                                                      String tableName,
                                                      String partition,
                                                      String userName,
                                                      List<String> groupNames)
                                               throws InvalidObjectException,
                                                      MetaException
Specified by:
getPartitionPrivilegeSet in interface RawStore
Throws:
InvalidObjectException
MetaException

getTablePrivilegeSet

public PrincipalPrivilegeSet getTablePrivilegeSet(String dbName,
                                                  String tableName,
                                                  String userName,
                                                  List<String> groupNames)
                                           throws InvalidObjectException,
                                                  MetaException
Specified by:
getTablePrivilegeSet in interface RawStore
Throws:
InvalidObjectException
MetaException

getColumnPrivilegeSet

public PrincipalPrivilegeSet getColumnPrivilegeSet(String dbName,
                                                   String tableName,
                                                   String partitionName,
                                                   String columnName,
                                                   String userName,
                                                   List<String> groupNames)
                                            throws InvalidObjectException,
                                                   MetaException
Specified by:
getColumnPrivilegeSet in interface RawStore
Throws:
InvalidObjectException
MetaException

grantPrivileges

public boolean grantPrivileges(PrivilegeBag privileges)
                        throws InvalidObjectException,
                               MetaException,
                               NoSuchObjectException
Specified by:
grantPrivileges in interface RawStore
Throws:
InvalidObjectException
MetaException
NoSuchObjectException

revokePrivileges

public boolean revokePrivileges(PrivilegeBag privileges)
                         throws InvalidObjectException,
                                MetaException,
                                NoSuchObjectException
Specified by:
revokePrivileges in interface RawStore
Throws:
InvalidObjectException
MetaException
NoSuchObjectException

listPrincipalGlobalGrants

public List<MGlobalPrivilege> listPrincipalGlobalGrants(String principalName,
                                                        PrincipalType principalType)
Specified by:
listPrincipalGlobalGrants in interface RawStore

listPrincipalDBGrants

public List<MDBPrivilege> listPrincipalDBGrants(String principalName,
                                                PrincipalType principalType,
                                                String dbName)
Specified by:
listPrincipalDBGrants in interface RawStore

listAllTableGrants

public List<MTablePrivilege> listAllTableGrants(String dbName,
                                                String tableName)

listTableAllPartitionGrants

public List<MPartitionPrivilege> listTableAllPartitionGrants(String dbName,
                                                             String tableName)

listTableAllColumnGrants

public List<MTableColumnPrivilege> listTableAllColumnGrants(String dbName,
                                                            String tableName)

listTableAllPartitionColumnGrants

public List<MPartitionColumnPrivilege> listTableAllPartitionColumnGrants(String dbName,
                                                                         String tableName)

listPartitionAllColumnGrants

public List<MPartitionColumnPrivilege> listPartitionAllColumnGrants(String dbName,
                                                                    String tableName,
                                                                    String partName)

listAllTableGrants

public List<MTablePrivilege> listAllTableGrants(String principalName,
                                                PrincipalType principalType,
                                                String dbName,
                                                String tableName)
Specified by:
listAllTableGrants in interface RawStore

listPrincipalPartitionGrants

public List<MPartitionPrivilege> listPrincipalPartitionGrants(String principalName,
                                                              PrincipalType principalType,
                                                              String dbName,
                                                              String tableName,
                                                              String partName)
Specified by:
listPrincipalPartitionGrants in interface RawStore

listPrincipalTableColumnGrants

public List<MTableColumnPrivilege> listPrincipalTableColumnGrants(String principalName,
                                                                  PrincipalType principalType,
                                                                  String dbName,
                                                                  String tableName,
                                                                  String columnName)
Specified by:
listPrincipalTableColumnGrants in interface RawStore

listPrincipalPartitionColumnGrants

public List<MPartitionColumnPrivilege> listPrincipalPartitionColumnGrants(String principalName,
                                                                          PrincipalType principalType,
                                                                          String dbName,
                                                                          String tableName,
                                                                          String partitionName,
                                                                          String columnName)
Specified by:
listPrincipalPartitionColumnGrants in interface RawStore

isPartitionMarkedForEvent

public boolean isPartitionMarkedForEvent(String dbName,
                                         String tblName,
                                         Map<String,String> partName,
                                         PartitionEventType evtType)
                                  throws UnknownTableException,
                                         MetaException,
                                         InvalidPartitionException,
                                         UnknownPartitionException
Specified by:
isPartitionMarkedForEvent in interface RawStore
Throws:
UnknownTableException
MetaException
InvalidPartitionException
UnknownPartitionException

markPartitionForEvent

public Table markPartitionForEvent(String dbName,
                                   String tblName,
                                   Map<String,String> partName,
                                   PartitionEventType evtType)
                            throws MetaException,
                                   UnknownTableException,
                                   InvalidPartitionException,
                                   UnknownPartitionException
Specified by:
markPartitionForEvent in interface RawStore
Throws:
MetaException
UnknownTableException
InvalidPartitionException
UnknownPartitionException

cleanupEvents

public long cleanupEvents()
Specified by:
cleanupEvents in interface RawStore


Copyright © 2011 The Apache Software Foundation