Skip to content

Commit

Permalink
Reorder method parameters to be consistent in ThriftHiveMetastore
Browse files Browse the repository at this point in the history
  • Loading branch information
dain committed Mar 15, 2022
1 parent a690d4a commit 5187a3d
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1661,16 +1661,23 @@ public void sendTransactionHeartbeat(HiveIdentity identity, long transactionId)
@Override
public void acquireSharedReadLock(HiveIdentity identity, String queryId, long transactionId, List<SchemaTableName> fullTables, List<HivePartition> partitions)
{
acquireSharedLock(DataOperationType.SELECT, false, identity, queryId, transactionId, fullTables, partitions);
acquireSharedLock(identity, queryId, transactionId, fullTables, partitions, DataOperationType.SELECT, false);
}

@Override
public void acquireTableWriteLock(HiveIdentity identity, String queryId, long transactionId, String dbName, String tableName, DataOperationType operation, boolean isDynamicPartitionWrite)
{
acquireSharedLock(operation, isDynamicPartitionWrite, identity, queryId, transactionId, ImmutableList.of(new SchemaTableName(dbName, tableName)), Collections.emptyList());
acquireSharedLock(identity, queryId, transactionId, ImmutableList.of(new SchemaTableName(dbName, tableName)), Collections.emptyList(), operation, isDynamicPartitionWrite);
}

private void acquireSharedLock(DataOperationType operation, boolean isDynamicPartitionWrite, HiveIdentity identity, String queryId, long transactionId, List<SchemaTableName> fullTables, List<HivePartition> partitions)
private void acquireSharedLock(
HiveIdentity identity,
String queryId,
long transactionId,
List<SchemaTableName> fullTables,
List<HivePartition> partitions,
DataOperationType operation,
boolean isDynamicPartitionWrite)
{
requireNonNull(operation, "operation is null");
checkArgument(!identity.getUsername().map(String::isEmpty).orElse(true), "User should be provided to acquire locks");
Expand Down

0 comments on commit 5187a3d

Please sign in to comment.