Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hive.metastore.IHMSHandler;
import org.apache.hadoop.hive.metastore.MetaStoreEventListener;
import org.apache.hadoop.hive.metastore.api.GetTableRequest;
import org.apache.hadoop.hive.metastore.api.MetaException;
import org.apache.hadoop.hive.metastore.api.Partition;
import org.apache.hadoop.hive.metastore.api.Table;
Expand Down Expand Up @@ -208,8 +209,9 @@ public void onCreateTable(CreateTableEvent tableEvent) throws MetaException {
Configuration conf = handler.getConf();
Table newTbl;
try {
newTbl = handler.get_table_core(tbl.getCatName(), tbl.getDbName(), tbl.getTableName())
.deepCopy();
GetTableRequest getTableRequest = new GetTableRequest(tbl.getDbName(), tbl.getTableName());
getTableRequest.setCatName(tbl.getCatName());
newTbl = handler.get_table_core(getTableRequest).deepCopy();
newTbl.getParameters().put(
HCatConstants.HCAT_MSGBUS_TOPIC_NAME,
getTopicPrefix(conf) + "." + newTbl.getDbName().toLowerCase() + "."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,6 @@ public boolean dropTable(String catName, String dbName, String tableName)
}
}

@Override
public boolean dropPartition(String catName, String dbName, String tableName, List<String> partVals)
throws MetaException, NoSuchObjectException,
InvalidObjectException, InvalidInputException {
if (shouldEventSucceed) {
return super.dropPartition(catName, dbName, tableName, partVals);
} else {
throw new RuntimeException("Event failed.");
}
}

@Override
public boolean dropPartition(String catName, String dbName, String tableName, String partName)
throws MetaException, NoSuchObjectException,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

import com.google.common.base.Function;
import com.google.common.collect.Iterators;

import org.apache.hadoop.hive.metastore.api.GetTableRequest;
import org.apache.hadoop.hive.metastore.utils.MetaStoreUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -466,8 +468,9 @@ public PartitionWrapper(org.apache.hadoop.hive.metastore.api.Partition mapiPart,
org.apache.hadoop.hive.metastore.api.Partition wrapperApiPart = mapiPart.deepCopy();
String catName = mapiPart.isSetCatName() ? mapiPart.getCatName() :
MetaStoreUtils.getDefaultCatalog(context.getHandler().getConf());
org.apache.hadoop.hive.metastore.api.Table t = context.getHandler().get_table_core(
catName, mapiPart.getDbName(), mapiPart.getTableName());
GetTableRequest getTableRequest = new GetTableRequest(mapiPart.getDbName(), mapiPart.getTableName());
getTableRequest.setCatName(catName);
org.apache.hadoop.hive.metastore.api.Table t = context.getHandler().get_table_core(getTableRequest);
if (wrapperApiPart.getSd() == null){
// In the cases of create partition, by the time this event fires, the partition
// object has not yet come into existence, and thus will not yet have a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,39 +34,6 @@
*/
public interface AlterHandler extends Configurable {

/**
* @deprecated As of release 2.2.0. Replaced by {@link #alterTable(RawStore, Warehouse, String,
* String, String, Table, EnvironmentContext, IHMSHandler, String)}
*
* handles alter table, the changes could be cascaded to partitions if applicable
*
* @param msdb
* object to get metadata
* @param wh
* Hive Warehouse where table data is stored
* @param catName
* catalog of the table being altered
* @param dbname
* database of the table being altered
* @param name
* original name of the table being altered. same as
* <i>newTable.tableName</i> if alter op is not a rename.
* @param newTable
* new table object
* @param envContext
* environment context variable
* @throws InvalidOperationException
* thrown if the newTable object is invalid
* @throws MetaException
* thrown if there is any other error
*/
@Deprecated
default void alterTable(RawStore msdb, Warehouse wh, String catName, String dbname,
String name, Table newTable, EnvironmentContext envContext)
throws InvalidOperationException, MetaException {
alterTable(msdb, wh, catName, dbname, name, newTable, envContext, null, null);
}

/**
* handles alter table, the changes could be cascaded to partitions if applicable
*
Expand Down Expand Up @@ -96,37 +63,6 @@ void alterTable(RawStore msdb, Warehouse wh, String catName, String dbname,
IHMSHandler handler, String writeIdList)
throws InvalidOperationException, MetaException;

/**
* @deprecated As of release 2.2.0. Replaced by {@link #alterPartitions(RawStore, Warehouse, String,
* String, String, List, EnvironmentContext, String, long, IHMSHandler)}
*
* handles alter partition
*
* @param msdb
* object to get metadata
* @param wh
* physical warehouse class
* @param dbname
* database of the partition being altered
* @param name
* table of the partition being altered
* @param part_vals
* original values of the partition being altered
* @param new_part
* new partition object
* @return the altered partition
* @throws InvalidOperationException thrown if the operation is invalid
* @throws InvalidObjectException thrown if the new_part object is invalid
* @throws AlreadyExistsException thrown if the new_part object already exists
* @throws MetaException thrown if there is any other error
* @throws NoSuchObjectException thrown if there is no such object
*/
@Deprecated
Partition alterPartition(final RawStore msdb, Warehouse wh, final String dbname,
final String name, final List<String> part_vals, final Partition new_part,
EnvironmentContext environmentContext)
throws InvalidOperationException, InvalidObjectException, AlreadyExistsException, MetaException, NoSuchObjectException;

/**
* handles alter partition
*
Expand Down Expand Up @@ -159,34 +95,6 @@ Partition alterPartition(final RawStore msdb, Warehouse wh, final String catName
IHMSHandler handler, String validWriteIds)
throws InvalidOperationException, InvalidObjectException, AlreadyExistsException, MetaException, NoSuchObjectException;

/**
* @deprecated As of release 3.0.0. Replaced by {@link #alterPartitions(RawStore, Warehouse, String,
* String, String, List, EnvironmentContext, String, long, IHMSHandler)}
*
* handles alter partitions
*
* @param msdb
* object to get metadata
* @param wh physical warehouse class
* @param dbname
* database of the partition being altered
* @param name
* table of the partition being altered
* @param new_parts
* new partition list
* @param environmentContext environment context variable
* @return the altered partition list
* @throws InvalidOperationException thrown if the operation is invalid
* @throws InvalidObjectException thrown if the new_parts object is invalid
* @throws AlreadyExistsException thrown if the new_part object already exists
* @throws MetaException thrown if there is any other error
*/
@Deprecated
List<Partition> alterPartitions(final RawStore msdb, Warehouse wh,
final String dbname, final String name, final List<Partition> new_parts,
EnvironmentContext environmentContext)
throws InvalidOperationException, InvalidObjectException, AlreadyExistsException, MetaException;

/**
* handles alter partitions
* @param msdb object to get metadata
Expand Down
Loading