-
Notifications
You must be signed in to change notification settings - Fork 383
/
Copy pathGravitinoSplitManager.java
41 lines (36 loc) · 1.55 KB
/
GravitinoSplitManager.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* Copyright 2023 Datastrato Pvt Ltd.
* This software is licensed under the Apache License version 2.
*/
package com.datastrato.gravitino.trino.connector;
import io.trino.spi.connector.ConnectorSession;
import io.trino.spi.connector.ConnectorSplitManager;
import io.trino.spi.connector.ConnectorSplitSource;
import io.trino.spi.connector.ConnectorTableHandle;
import io.trino.spi.connector.ConnectorTransactionHandle;
import io.trino.spi.connector.Constraint;
import io.trino.spi.connector.DynamicFilter;
/** This class delegates the retrieval of split data sources to optimize query performance. */
public class GravitinoSplitManager implements ConnectorSplitManager {
private final ConnectorSplitManager internalSplitManager;
public GravitinoSplitManager(ConnectorSplitManager internalSplitManager) {
this.internalSplitManager = internalSplitManager;
}
public ConnectorSplitSource getSplits(
ConnectorTransactionHandle transaction,
ConnectorSession session,
ConnectorTableHandle connectorTableHandle,
DynamicFilter dynamicFilter,
Constraint constraint) {
GravitinoTableHandle gravitinoTableHandle = (GravitinoTableHandle) connectorTableHandle;
GravitinoTransactionHandle gravitinoTransactionHandle =
(GravitinoTransactionHandle) transaction;
// TODO(yuhui) add dynamic filter
return internalSplitManager.getSplits(
gravitinoTransactionHandle.getInternalTransactionHandle(),
session,
gravitinoTableHandle.getInternalTableHandle(),
DynamicFilter.EMPTY,
constraint);
}
}