Review Board 1.7.22


Review request for HIVE-2038

Review Request #581 - Created April 12, 2011 and updated

Ashutosh Chauhan
trunk
HIVE-2038
Reviewers
hive
carl, jvs, pauly
hive
Review request for HIVE-2038
Unit test with dummy listener included. Also tested with an alternate listener which sends a message on a message bus.
Posted (April 12, 2011, 3:07 a.m.)

   

  
Please add this property to hive-default.xml along with a description of what it does.
  1. Will add it in hive-default.xml.
Please run checkstyle and correct any violations included in your patch.
  1. Will run checkstyle to check for any style violations.
No need to reference "this", right?
  1. Right. Though, I think using "this" in such cases improves code readability. 
What do you think about changing the name to MetaStoreEventListener or CatalogEventListener?
  1. MetaStoreEventListener is fine too.
Please add some javadoc explaining the intended use of this interface. 

* Are the methods called before or after an action completes? What happens if a metastore operation fails?

* Are the methods allowed to block? Are they run in a separate thread?

* Are the methods allowed to modify the catalog objects that are passed in as parameters?
  1. Will also add in javadoc.
     
     * Methods are called after action completes. Only if action succeeds. They are not called if operation fails since in that case nothing has actually changed in metastore.
    
     * This is upto implementation. They can run in same thread, or they can schedule there work in separate thread and return immediately. 
    
     * I don't see a reason to disallow modification of passed in parameter objects. But, its mostly irrelevant here since methods are called after change has already been persisted on metastore. So, modifying these objects can't change any state on metastore. 
Checkstyle.
Instead of passing in raw Table/Partition/Database objects it may be better to instead wrap these objects in containers, e.g. CreateTableEvent, DropTableEvent, etc. Eventually this interface will probably include onAlterTable() and onAlterPartition(), and programmers will probably want to access both the before and after versions of a Table/Partition, etc.
  1. Whats the advantage of wrapper container objects?
Unrelated bugfix?
  1. Related bugfix, I will say : ) Without it, when drop partition returns from object store, partition object doesn't contain partition values. 
Checkstyle.