public ConnectorId getConnectorId() { return handle.getConnectorId(); }
public ConnectorId getConnectorId() { return handle.getConnectorId(); }
public Optional<TablePartitioning> getTablePartitioning() { return layout.getTablePartitioning() .map(nodePartitioning -> new TablePartitioning( new PartitioningHandle( Optional.of(handle.getConnectorId()), Optional.of(handle.getTransactionHandle()), nodePartitioning.getPartitioningHandle()), nodePartitioning.getPartitioningColumns())); }
public Optional<TablePartitioning> getTablePartitioning() { return layout.getTablePartitioning() .map(nodePartitioning -> new TablePartitioning( new PartitioningHandle( Optional.of(handle.getConnectorId()), Optional.of(handle.getTransactionHandle()), nodePartitioning.getPartitioningHandle()), nodePartitioning.getPartitioningColumns())); }
@Override public TableLayoutHandle getAlternativeLayoutHandle(Session session, TableLayoutHandle tableLayoutHandle, PartitioningHandle partitioningHandle) { checkArgument(partitioningHandle.getConnectorId().isPresent(), "Expect partitioning handle from connector, got system partitioning handle"); ConnectorId connectorId = partitioningHandle.getConnectorId().get(); checkArgument(connectorId.equals(tableLayoutHandle.getConnectorId()), "ConnectorId of tableLayoutHandle and partitioningHandle does not match"); CatalogMetadata catalogMetadata = getCatalogMetadata(session, connectorId); ConnectorMetadata metadata = catalogMetadata.getMetadataFor(connectorId); ConnectorTransactionHandle transaction = catalogMetadata.getTransactionHandleFor(connectorId); ConnectorTableLayoutHandle newTableLayoutHandle = metadata.getAlternativeLayoutHandle(session.toConnectorSession(connectorId), tableLayoutHandle.getConnectorHandle(), partitioningHandle.getConnectorHandle()); return new TableLayoutHandle(connectorId, transaction, newTableLayoutHandle); }
@Override public TableLayoutHandle getAlternativeLayoutHandle(Session session, TableLayoutHandle tableLayoutHandle, PartitioningHandle partitioningHandle) { checkArgument(partitioningHandle.getConnectorId().isPresent(), "Expect partitioning handle from connector, got system partitioning handle"); ConnectorId connectorId = partitioningHandle.getConnectorId().get(); checkArgument(connectorId.equals(tableLayoutHandle.getConnectorId()), "ConnectorId of tableLayoutHandle and partitioningHandle does not match"); CatalogMetadata catalogMetadata = getCatalogMetadata(session, connectorId); ConnectorMetadata metadata = catalogMetadata.getMetadataFor(connectorId); ConnectorTransactionHandle transaction = catalogMetadata.getTransactionHandleFor(connectorId); ConnectorTableLayoutHandle newTableLayoutHandle = metadata.getAlternativeLayoutHandle(session.toConnectorSession(connectorId), tableLayoutHandle.getConnectorHandle(), partitioningHandle.getConnectorHandle()); return new TableLayoutHandle(connectorId, transaction, newTableLayoutHandle); }
@Override public Optional<Object> getInfo(Session session, TableLayoutHandle handle) { ConnectorId connectorId = handle.getConnectorId(); ConnectorMetadata metadata = getMetadata(session, connectorId); ConnectorTableLayout tableLayout = metadata.getTableLayout(session.toConnectorSession(connectorId), handle.getConnectorHandle()); return metadata.getInfo(tableLayout.getHandle()); }
@Override public Optional<Object> getInfo(Session session, TableLayoutHandle handle) { ConnectorId connectorId = handle.getConnectorId(); ConnectorMetadata metadata = getMetadata(session, connectorId); ConnectorTableLayout tableLayout = metadata.getTableLayout(session.toConnectorSession(connectorId), handle.getConnectorHandle()); return metadata.getInfo(tableLayout.getHandle()); }
@Override public TableLayout getLayout(Session session, TableLayoutHandle handle) { ConnectorId connectorId = handle.getConnectorId(); CatalogMetadata catalogMetadata = getCatalogMetadata(session, connectorId); ConnectorMetadata metadata = catalogMetadata.getMetadataFor(connectorId); ConnectorTransactionHandle transaction = catalogMetadata.getTransactionHandleFor(connectorId); return fromConnectorLayout(connectorId, transaction, metadata.getTableLayout(session.toConnectorSession(connectorId), handle.getConnectorHandle())); }
@Override public TableLayout getLayout(Session session, TableLayoutHandle handle) { ConnectorId connectorId = handle.getConnectorId(); CatalogMetadata catalogMetadata = getCatalogMetadata(session, connectorId); ConnectorMetadata metadata = catalogMetadata.getMetadataFor(connectorId); ConnectorTransactionHandle transaction = catalogMetadata.getTransactionHandleFor(connectorId); return fromConnectorLayout(connectorId, transaction, metadata.getTableLayout(session.toConnectorSession(connectorId), handle.getConnectorHandle())); }
public SplitSource getSplits(Session session, TableLayoutHandle layout, SplitSchedulingStrategy splitSchedulingStrategy) { ConnectorId connectorId = layout.getConnectorId(); ConnectorSplitManager splitManager = getConnectorSplitManager(connectorId); ConnectorSession connectorSession = session.toConnectorSession(connectorId); ConnectorSplitSource source = splitManager.getSplits( layout.getTransactionHandle(), connectorSession, layout.getConnectorHandle(), splitSchedulingStrategy); SplitSource splitSource = new ConnectorAwareSplitSource(connectorId, layout.getTransactionHandle(), source); if (minScheduleSplitBatchSize > 1) { splitSource = new BufferingSplitSource(splitSource, minScheduleSplitBatchSize); } return splitSource; }
public SplitSource getSplits(Session session, TableLayoutHandle layout, SplitSchedulingStrategy splitSchedulingStrategy) { ConnectorId connectorId = layout.getConnectorId(); ConnectorSplitManager splitManager = getConnectorSplitManager(connectorId); ConnectorSession connectorSession = session.toConnectorSession(connectorId); ConnectorSplitSource source = splitManager.getSplits( layout.getTransactionHandle(), connectorSession, layout.getConnectorHandle(), splitSchedulingStrategy); SplitSource splitSource = new ConnectorAwareSplitSource(connectorId, layout.getTransactionHandle(), source); if (minScheduleSplitBatchSize > 1) { splitSource = new BufferingSplitSource(splitSource, minScheduleSplitBatchSize); } return splitSource; }