private static void registerBogusConnector(TransactionManager transactionManager, String connectorId) { transactionManager.addConnector(connectorId, new Connector() { @Override public ConnectorTransactionHandle beginTransaction(IsolationLevel isolationLevel, boolean readOnly) { // Just return something return new ConnectorTransactionHandle() {}; } @Override public ConnectorMetadata getMetadata(ConnectorTransactionHandle transactionHandle) { throw new UnsupportedOperationException(); } @Override public ConnectorSplitManager getSplitManager() { throw new UnsupportedOperationException(); } }); }
@Override public Connector create(String connectorId, Map<String, String> properties) { return new Connector() { @Override public ConnectorTransactionHandle beginTransaction(IsolationLevel isolationLevel, boolean readOnly) { checkConnectorSupports(READ_COMMITTED, isolationLevel); return JmxTransactionHandle.INSTANCE; } @Override public ConnectorMetadata getMetadata(ConnectorTransactionHandle transactionHandle) { return new JmxMetadata(connectorId, mbeanServer); } @Override public ConnectorSplitManager getSplitManager() { return new JmxSplitManager(connectorId, nodeManager); } @Override public ConnectorRecordSetProvider getRecordSetProvider() { return new JmxRecordSetProvider(mbeanServer, nodeManager.getCurrentNode().getNodeIdentifier()); } }; }
public SplitSource getSplits(Session session, TableLayoutHandle layout) { String connectorId = layout.getConnectorId(); ConnectorSplitManager splitManager = getConnectorSplitManager(connectorId); // assumes connectorId and catalog are the same ConnectorSession connectorSession = session.toConnectorSession(connectorId); ConnectorSplitSource source = splitManager.getSplits(layout.getTransactionHandle(), connectorSession, layout.getConnectorHandle()); return new ConnectorAwareSplitSource(connectorId, layout.getTransactionHandle(), source); }
@Override public Connector create(String connectorId, Map<String, String> properties) { int splitsPerNode = getSplitsPerNode(properties); return new Connector() { @Override public ConnectorTransactionHandle beginTransaction(IsolationLevel isolationLevel, boolean readOnly) { return TpchTransactionHandle.INSTANCE; } @Override public ConnectorMetadata getMetadata(ConnectorTransactionHandle transaction) { return new TpchMetadata(connectorId); } @Override public ConnectorSplitManager getSplitManager() { return new TpchSplitManager(connectorId, nodeManager, splitsPerNode); } @Override public ConnectorRecordSetProvider getRecordSetProvider() { return new TpchRecordSetProvider(); } }; }
@Override public Connector create(String connectorId, Map<String, String> properties) { requireNonNull(properties, "properties is null"); int splitsPerNode = getSplitsPerNode(properties); return new Connector() { @Override public ConnectorTransactionHandle beginTransaction(IsolationLevel isolationLevel, boolean readOnly) { return TpchTransactionHandle.INSTANCE; } @Override public ConnectorMetadata getMetadata(ConnectorTransactionHandle transaction) { return new SampledTpchMetadata(connectorId); } @Override public ConnectorSplitManager getSplitManager() { return new TpchSplitManager(connectorId, nodeManager, splitsPerNode); } @Override public ConnectorRecordSetProvider getRecordSetProvider() { return new SampledTpchRecordSetProvider(connectorId, sampleWeight); } }; }
@Override public ConnectorSplitManager getSplitManager() { return hdfsSplitManager; }
@Override public ConnectorSplitManager getSplitManager() { return new RestSplitManager(nodeManager); }
@Override public ConnectorSplitManager getSplitManager() { return splitManager; }
@Override public Connector create(String connectorId, Map<String, String> properties) { int splitsPerNode = getSplitsPerNode(properties); TpchIndexedData indexedData = new TpchIndexedData(connectorId, indexSpec); return new Connector() { @Override public ConnectorTransactionHandle beginTransaction(IsolationLevel isolationLevel, boolean readOnly) { return TpchTransactionHandle.INSTANCE; } @Override public ConnectorMetadata getMetadata(ConnectorTransactionHandle transactionHandle) { return new TpchIndexMetadata(connectorId, indexedData); } @Override public ConnectorSplitManager getSplitManager() { return new TpchSplitManager(connectorId, nodeManager, splitsPerNode); } @Override public ConnectorRecordSetProvider getRecordSetProvider() { return new TpchRecordSetProvider(); } @Override public ConnectorIndexProvider getIndexProvider() { return new TpchIndexProvider(indexedData); } @Override public Set<SystemTable> getSystemTables() { return ImmutableSet.of(new ExampleSystemTable()); } }; }
@Override public ConnectorSplitManager getSplitManager() { return new LegacyConnectorSplitManager(connector.getSplitManager()); }
public LegacyConnectorSplitManager(com.facebook.presto.spi.ConnectorSplitManager splitManager) { this.splitManager = requireNonNull(splitManager, "splitManager is null"); }
@Override public ConnectorSplitManager getSplitManager() { return new ConnectorSplitManager() {}; }
public void addConnectorSplitManager(String connectorId, ConnectorSplitManager connectorSplitManager) { checkState(splitManagers.putIfAbsent(connectorId, connectorSplitManager) == null, "SplitManager for connector '%s' is already registered", connectorId); }
private ConnectorSplitManager getConnectorSplitManager(String connectorId) { ConnectorSplitManager result = splitManagers.get(connectorId); checkArgument(result != null, "No split manager for connector '%s'", connectorId); return result; }
@Override public ConnectorSplitManager getSplitManager() { return _splitManager; }