Skip to content

Commit 40790c3

Browse files
committed
HIVE-29280: Drop deprecated methods from Metastore
1 parent 82e2d61 commit 40790c3

File tree

15 files changed

+149
-1330
lines changed

15 files changed

+149
-1330
lines changed

hcatalog/server-extensions/src/main/java/org/apache/hive/hcatalog/listener/NotificationListener.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import javax.naming.NamingException;
3535

3636
import org.apache.hadoop.conf.Configuration;
37+
import org.apache.hadoop.hive.common.TableName;
3738
import org.apache.hadoop.hive.metastore.IHMSHandler;
3839
import org.apache.hadoop.hive.metastore.MetaStoreEventListener;
3940
import org.apache.hadoop.hive.metastore.api.MetaException;
@@ -55,6 +56,8 @@
5556
import org.slf4j.Logger;
5657
import org.slf4j.LoggerFactory;
5758

59+
import static org.apache.hadoop.hive.metastore.utils.MetaStoreServerUtils.newGetTableReq;
60+
5861
/**
5962
* Implementation of
6063
* {@link org.apache.hadoop.hive.metastore.MetaStoreEventListener} It sends
@@ -208,7 +211,7 @@ public void onCreateTable(CreateTableEvent tableEvent) throws MetaException {
208211
Configuration conf = handler.getConf();
209212
Table newTbl;
210213
try {
211-
newTbl = handler.get_table_core(tbl.getCatName(), tbl.getDbName(), tbl.getTableName())
214+
newTbl = handler.get_table_core(newGetTableReq(new TableName(tbl.getCatName(), tbl.getDbName(), tbl.getTableName()), null))
212215
.deepCopy();
213216
newTbl.getParameters().put(
214217
HCatConstants.HCAT_MSGBUS_TOPIC_NAME,

itests/hcatalog-unit/src/test/java/org/apache/hive/hcatalog/listener/DummyRawStoreFailEvent.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -103,17 +103,6 @@ public boolean dropTable(String catName, String dbName, String tableName)
103103
}
104104
}
105105

106-
@Override
107-
public boolean dropPartition(String catName, String dbName, String tableName, List<String> partVals)
108-
throws MetaException, NoSuchObjectException,
109-
InvalidObjectException, InvalidInputException {
110-
if (shouldEventSucceed) {
111-
return super.dropPartition(catName, dbName, tableName, partVals);
112-
} else {
113-
throw new RuntimeException("Event failed.");
114-
}
115-
}
116-
117106
@Override
118107
public boolean dropPartition(String catName, String dbName, String tableName, String partName)
119108
throws MetaException, NoSuchObjectException,

ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationPreEventListener.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323

2424
import com.google.common.base.Function;
2525
import com.google.common.collect.Iterators;
26+
27+
import org.apache.hadoop.hive.common.TableName;
28+
import org.apache.hadoop.hive.metastore.utils.MetaStoreServerUtils;
2629
import org.apache.hadoop.hive.metastore.utils.MetaStoreUtils;
2730
import org.slf4j.Logger;
2831
import org.slf4j.LoggerFactory;
@@ -467,7 +470,7 @@ public PartitionWrapper(org.apache.hadoop.hive.metastore.api.Partition mapiPart,
467470
String catName = mapiPart.isSetCatName() ? mapiPart.getCatName() :
468471
MetaStoreUtils.getDefaultCatalog(context.getHandler().getConf());
469472
org.apache.hadoop.hive.metastore.api.Table t = context.getHandler().get_table_core(
470-
catName, mapiPart.getDbName(), mapiPart.getTableName());
473+
MetaStoreServerUtils.newGetTableReq(new TableName(catName, mapiPart.getDbName(), mapiPart.getTableName()), null));
471474
if (wrapperApiPart.getSd() == null){
472475
// In the cases of create partition, by the time this event fires, the partition
473476
// object has not yet come into existence, and thus will not yet have a

standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/AlterHandler.java

Lines changed: 0 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -34,39 +34,6 @@
3434
*/
3535
public interface AlterHandler extends Configurable {
3636

37-
/**
38-
* @deprecated As of release 2.2.0. Replaced by {@link #alterTable(RawStore, Warehouse, String,
39-
* String, String, Table, EnvironmentContext, IHMSHandler, String)}
40-
*
41-
* handles alter table, the changes could be cascaded to partitions if applicable
42-
*
43-
* @param msdb
44-
* object to get metadata
45-
* @param wh
46-
* Hive Warehouse where table data is stored
47-
* @param catName
48-
* catalog of the table being altered
49-
* @param dbname
50-
* database of the table being altered
51-
* @param name
52-
* original name of the table being altered. same as
53-
* <i>newTable.tableName</i> if alter op is not a rename.
54-
* @param newTable
55-
* new table object
56-
* @param envContext
57-
* environment context variable
58-
* @throws InvalidOperationException
59-
* thrown if the newTable object is invalid
60-
* @throws MetaException
61-
* thrown if there is any other error
62-
*/
63-
@Deprecated
64-
default void alterTable(RawStore msdb, Warehouse wh, String catName, String dbname,
65-
String name, Table newTable, EnvironmentContext envContext)
66-
throws InvalidOperationException, MetaException {
67-
alterTable(msdb, wh, catName, dbname, name, newTable, envContext, null, null);
68-
}
69-
7037
/**
7138
* handles alter table, the changes could be cascaded to partitions if applicable
7239
*
@@ -96,37 +63,6 @@ void alterTable(RawStore msdb, Warehouse wh, String catName, String dbname,
9663
IHMSHandler handler, String writeIdList)
9764
throws InvalidOperationException, MetaException;
9865

99-
/**
100-
* @deprecated As of release 2.2.0. Replaced by {@link #alterPartitions(RawStore, Warehouse, String,
101-
* String, String, List, EnvironmentContext, String, long, IHMSHandler)}
102-
*
103-
* handles alter partition
104-
*
105-
* @param msdb
106-
* object to get metadata
107-
* @param wh
108-
* physical warehouse class
109-
* @param dbname
110-
* database of the partition being altered
111-
* @param name
112-
* table of the partition being altered
113-
* @param part_vals
114-
* original values of the partition being altered
115-
* @param new_part
116-
* new partition object
117-
* @return the altered partition
118-
* @throws InvalidOperationException thrown if the operation is invalid
119-
* @throws InvalidObjectException thrown if the new_part object is invalid
120-
* @throws AlreadyExistsException thrown if the new_part object already exists
121-
* @throws MetaException thrown if there is any other error
122-
* @throws NoSuchObjectException thrown if there is no such object
123-
*/
124-
@Deprecated
125-
Partition alterPartition(final RawStore msdb, Warehouse wh, final String dbname,
126-
final String name, final List<String> part_vals, final Partition new_part,
127-
EnvironmentContext environmentContext)
128-
throws InvalidOperationException, InvalidObjectException, AlreadyExistsException, MetaException, NoSuchObjectException;
129-
13066
/**
13167
* handles alter partition
13268
*
@@ -159,34 +95,6 @@ Partition alterPartition(final RawStore msdb, Warehouse wh, final String catName
15995
IHMSHandler handler, String validWriteIds)
16096
throws InvalidOperationException, InvalidObjectException, AlreadyExistsException, MetaException, NoSuchObjectException;
16197

162-
/**
163-
* @deprecated As of release 3.0.0. Replaced by {@link #alterPartitions(RawStore, Warehouse, String,
164-
* String, String, List, EnvironmentContext, String, long, IHMSHandler)}
165-
*
166-
* handles alter partitions
167-
*
168-
* @param msdb
169-
* object to get metadata
170-
* @param wh physical warehouse class
171-
* @param dbname
172-
* database of the partition being altered
173-
* @param name
174-
* table of the partition being altered
175-
* @param new_parts
176-
* new partition list
177-
* @param environmentContext environment context variable
178-
* @return the altered partition list
179-
* @throws InvalidOperationException thrown if the operation is invalid
180-
* @throws InvalidObjectException thrown if the new_parts object is invalid
181-
* @throws AlreadyExistsException thrown if the new_part object already exists
182-
* @throws MetaException thrown if there is any other error
183-
*/
184-
@Deprecated
185-
List<Partition> alterPartitions(final RawStore msdb, Warehouse wh,
186-
final String dbname, final String name, final List<Partition> new_parts,
187-
EnvironmentContext environmentContext)
188-
throws InvalidOperationException, InvalidObjectException, AlreadyExistsException, MetaException;
189-
19098
/**
19199
* handles alter partitions
192100
* @param msdb object to get metadata

0 commit comments

Comments
 (0)