Search in sources :

Example 1 with HiveTableName

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;
}
Also used : HiveTableName(com.facebook.presto.hive.metastore.HiveTableName)

Example 2 with HiveTableName

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);
}
Also used : HiveTableName(com.facebook.presto.hive.metastore.HiveTableName)

Aggregations

HiveTableName (com.facebook.presto.hive.metastore.HiveTableName)2