private HiveObjectRef getObjToRefresh(HiveObjectType type, String dbName, String objectName) throws Exception {
    HiveObjectRef objToRefresh = null;
    switch (type) {
    case DATACONNECTOR:
      objToRefresh = new HiveObjectRef(HiveObjectType.DATACONNECTOR, null, objectName, null, null);
      break;
    case DATABASE:
      objToRefresh = new HiveObjectRef(HiveObjectType.DATABASE, dbName, null, null, null);
      break;
    case TABLE:
      objToRefresh = new HiveObjectRef(HiveObjectType.TABLE, dbName, objectName, null, null);
      break;
    case COLUMN:
      objToRefresh = new HiveObjectRef(HiveObjectType.COLUMN, dbName, objectName, null, null);
      break;
    default:
      throw new RuntimeException("Get unknown object type " + type);
    }
    return objToRefresh;
  }
PrivilegeSynchronizer defines a thread to synchronize privileges from
external authorizer to Hive metastore.
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/PrivilegeSynchronizer.java