private static boolean needsLock(Entity entity) { switch (entity.getType()) { case TABLE: return isLockableTable(entity.getTable()); case PARTITION: return isLockableTable(entity.getPartition().getTable()); default: return true; } }
private void addTableFromEntity(Entity entity, Collection<String> tableList) { Table tbl; switch (entity.getType()) { case TABLE: { tbl = entity.getTable(); break; } case PARTITION: case DUMMYPARTITION: { tbl = entity.getPartition().getTable(); break; } default: { return; } } if (!AcidUtils.isTransactionalTable(tbl)) { return; } String fullTableName = AcidUtils.getFullTableName(tbl.getDbName(), tbl.getTableName()); tableList.add(fullTableName); }
break; case PARTITION: partitions.add(e.getPartition().getTPartition()); partitionNames.put(e.getPartition().getTPartition(), e.getPartition().getName()); break; case DUMMYPARTITION: dummyPartitions.add(e.getPartition().getTPartition()); partitionNames.put(e.getPartition().getTPartition(), e.getPartition().getName()); break; case LOCAL_DIR:
break; case PARTITION: partitions.add(e.getPartition().getTPartition()); partitionNames.put(e.getPartition().getTPartition(), e.getPartition().getName()); break; case DUMMYPARTITION: dummyPartitions.add(e.getPartition().getTPartition()); partitionNames.put(e.getPartition().getTPartition(), e.getPartition().getName()); break; case LOCAL_DIR:
case DUMMYPARTITION: return String.format("%s.%s/%s", entity.getPartition().getTPartition().getDbName(), entity.getPartition().getTPartition().getTableName(), entity.getPartition().getName()); case LOCAL_DIR: case DFS_DIR:
case DUMMYPARTITION: return String.format("%s.%s/%s", entity.getPartition().getTPartition().getDbName(), entity.getPartition().getTPartition().getTableName(), entity.getPartition().getName()); case LOCAL_DIR: case DFS_DIR:
case PARTITION: case DUMMYPARTITION: objectHierarchy.add(new Database(entity.getPartition().getTable().getDbName())); objectHierarchy.add(new Table(entity.getPartition().getTable().getTableName())); break; case DFS_DIR:
|| entity.getType() == Entity.Type.DUMMYPARTITION) { tableForPartition.add( entity.getPartition().getTable());
|| entity.getType() == Entity.Type.DUMMYPARTITION) { tableForPartition.add( entity.getPartition().getTable());
partition = entity.getPartition(); table = partition.getTable(); db = dgiBridge.hiveClient.getDatabase(table.getDbName());
case DUMMYPARTITION: Partition partitionWithLocation = new Partition( entity.getPartition().getTPartition()); partitionWithLocation.getSd().setLocation( entity.getPartition().getDataLocation().toString()); return serializer.toString(entity.getPartition().getTPartition()); case LOCAL_DIR: case DFS_DIR:
case DUMMYPARTITION: Partition partitionWithLocation = new Partition( entity.getPartition().getTPartition()); partitionWithLocation.getSd().setLocation( entity.getPartition().getDataLocation().toString()); return serializer.toString(entity.getPartition().getTPartition()); case LOCAL_DIR: case DFS_DIR: