@Override public void dropTable(ConnectorSession session, ConnectorTableHandle tableHandle) { try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(classLoader)) { delegate.dropTable(session, tableHandle); } }
@Override public void dropTable(Session session, TableHandle tableHandle) { ConnectorId connectorId = tableHandle.getConnectorId(); ConnectorMetadata metadata = getMetadataForWrite(session, connectorId); metadata.dropTable(session.toConnectorSession(connectorId), tableHandle.getConnectorHandle()); }
@Override public void dropTable(Session session, TableHandle tableHandle) { ConnectorId connectorId = tableHandle.getConnectorId(); ConnectorMetadata metadata = getMetadataForWrite(session, connectorId); metadata.dropTable(session.toConnectorSession(connectorId), tableHandle.getConnectorHandle()); }
protected void dropTable(SchemaTableName table) { try (Transaction transaction = newTransaction()) { ConnectorMetadata metadata = transaction.getMetadata(); ConnectorSession session = newSession(); ConnectorTableHandle handle = metadata.getTableHandle(session, table); if (handle == null) { return; } metadata.dropTable(session, handle); try { // todo I have no idea why this is needed... maybe there is a propagation delay in the metastore? metadata.dropTable(session, handle); fail("expected NotFoundException"); } catch (TableNotFoundException expected) { } transaction.commit(); } catch (Exception e) { Logger.get(getClass()).warn(e, "failed to drop table"); } }
protected void dropTable(SchemaTableName table) { try (Transaction transaction = newTransaction()) { ConnectorMetadata metadata = transaction.getMetadata(); ConnectorSession session = newSession(); ConnectorTableHandle handle = metadata.getTableHandle(session, table); if (handle == null) { return; } metadata.dropTable(session, handle); try { // todo I have no idea why this is needed... maybe there is a propagation delay in the metastore? metadata.dropTable(session, handle); fail("expected NotFoundException"); } catch (TableNotFoundException expected) { } transaction.commit(); } catch (Exception e) { Logger.get(getClass()).warn(e, "failed to drop table"); } }
connector.getMetadata(txn1).dropTable(session, handle1); connector.commit(txn1);