use of com.facebook.presto.hive.metastore.HiveTableName in project presto by prestodb.
the class FileHiveMetastore method lock.
@Override
public synchronized long lock(MetastoreContext metastoreContext, String databaseName, String tableName) {
HiveTableName hiveTableName = hiveTableName(databaseName, tableName);
while (lockedHiveTables.containsValue(hiveTableName)) {
try {
Thread.sleep(10);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException("Waiting for lock interrupted");
}
}
long lockId = ++currentLockId;
lockedHiveTables.put(lockId, hiveTableName);
return lockId;
}
use of com.facebook.presto.hive.metastore.HiveTableName in project presto by prestodb.
the class TestingSemiTransactionalHiveMetastore method addTable.
public void addTable(String database, String tableName, Table table, List<String> partitions) {
HiveTableName hiveTableName = new HiveTableName(database, tableName);
tablesMap.put(hiveTableName, table);
partitionsMap.put(hiveTableName, partitions);
}
Aggregations