Codota Logo
Connector.shutdown
Code IndexAdd Codota to your IDE (free)

How to use
shutdown
method
in
io.prestosql.spi.connector.Connector

Best Java code snippets using io.prestosql.spi.connector.Connector.shutdown (Showing top 5 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Connection c =
  • Codota IconDataSource dataSource;dataSource.getConnection()
  • Codota IconString url;DriverManager.getConnection(url)
  • Codota IconIdentityDatabaseUtil.getDBConnection()
  • Smart code suggestions by Codota
}
origin: io.prestosql/presto-main

@PreDestroy
public synchronized void stop()
{
  if (stopped.getAndSet(true)) {
    return;
  }
  for (Map.Entry<ConnectorId, MaterializedConnector> entry : connectors.entrySet()) {
    Connector connector = entry.getValue().getConnector();
    try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(connector.getClass().getClassLoader())) {
      connector.shutdown();
    }
    catch (Throwable t) {
      log.error(t, "Error shutting down connector: %s", entry.getKey());
    }
  }
}
origin: prestosql/presto

@PreDestroy
public synchronized void stop()
{
  if (stopped.getAndSet(true)) {
    return;
  }
  for (Map.Entry<ConnectorId, MaterializedConnector> entry : connectors.entrySet()) {
    Connector connector = entry.getValue().getConnector();
    try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(connector.getClass().getClassLoader())) {
      connector.shutdown();
    }
    catch (Throwable t) {
      log.error(t, "Error shutting down connector: %s", entry.getKey());
    }
  }
}
origin: prestosql/presto

@Test
public void testCreateConnector()
{
  MongoPlugin plugin = new MongoPlugin();
  ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
  Connector connector = factory.create("test", ImmutableMap.of("mongodb.seeds", seed), new TestingConnectorContext());
  Type type = getOnlyElement(plugin.getTypes());
  assertEquals(type, OBJECT_ID);
  connector.shutdown();
}
origin: prestosql/presto

private synchronized void removeConnectorInternal(ConnectorId connectorId)
{
  splitManager.removeConnectorSplitManager(connectorId);
  pageSourceManager.removeConnectorPageSourceProvider(connectorId);
  pageSinkManager.removeConnectorPageSinkProvider(connectorId);
  indexManager.removeIndexProvider(connectorId);
  nodePartitioningManager.removePartitioningProvider(connectorId);
  metadataManager.getProcedureRegistry().removeProcedures(connectorId);
  accessControlManager.removeCatalogAccessControl(connectorId);
  metadataManager.getTablePropertyManager().removeProperties(connectorId);
  metadataManager.getColumnPropertyManager().removeProperties(connectorId);
  metadataManager.getSchemaPropertyManager().removeProperties(connectorId);
  metadataManager.getSessionPropertyManager().removeConnectorSessionProperties(connectorId);
  MaterializedConnector materializedConnector = connectors.remove(connectorId);
  if (materializedConnector != null) {
    Connector connector = materializedConnector.getConnector();
    try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(connector.getClass().getClassLoader())) {
      connector.shutdown();
    }
    catch (Throwable t) {
      log.error(t, "Error shutting down connector: %s", connectorId);
    }
  }
}
origin: io.prestosql/presto-main

private synchronized void removeConnectorInternal(ConnectorId connectorId)
{
  splitManager.removeConnectorSplitManager(connectorId);
  pageSourceManager.removeConnectorPageSourceProvider(connectorId);
  pageSinkManager.removeConnectorPageSinkProvider(connectorId);
  indexManager.removeIndexProvider(connectorId);
  nodePartitioningManager.removePartitioningProvider(connectorId);
  metadataManager.getProcedureRegistry().removeProcedures(connectorId);
  accessControlManager.removeCatalogAccessControl(connectorId);
  metadataManager.getTablePropertyManager().removeProperties(connectorId);
  metadataManager.getColumnPropertyManager().removeProperties(connectorId);
  metadataManager.getSchemaPropertyManager().removeProperties(connectorId);
  metadataManager.getSessionPropertyManager().removeConnectorSessionProperties(connectorId);
  MaterializedConnector materializedConnector = connectors.remove(connectorId);
  if (materializedConnector != null) {
    Connector connector = materializedConnector.getConnector();
    try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(connector.getClass().getClassLoader())) {
      connector.shutdown();
    }
    catch (Throwable t) {
      log.error(t, "Error shutting down connector: %s", connectorId);
    }
  }
}
io.prestosql.spi.connectorConnectorshutdown

Javadoc

Shutdown the connector by releasing any held resources such as threads, sockets, etc. This method will only be called when no queries are using the connector. After this method is called, no methods will be called on the connector or any objects that have been returned from the connector.

Popular methods of Connector

  • getMetadata
  • getSplitManager
  • beginTransaction
  • commit
  • getAnalyzeProperties
  • getPageSourceProvider
  • getRecordSetProvider
  • getSystemTables
  • getAccessControl
  • getColumnProperties
  • getIndexProvider
  • getNodePartitioningProvider
  • getIndexProvider,
  • getNodePartitioningProvider,
  • getPageSinkProvider,
  • getProcedures,
  • getSchemaProperties,
  • getSessionProperties,
  • getTableProperties,
  • isSingleStatementWritesOnly,
  • rollback

Popular in Java

  • Reactive rest calls using spring rest template
  • getApplicationContext (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • setContentView (Activity)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now