use of io.trino.plugin.raptor.legacy.RaptorMetadata in project trino by trinodb.
the class TestRaptorMetadata method setupDatabase.
@BeforeMethod
public void setupDatabase() {
dbi = createTestingJdbi();
dummyHandle = dbi.open();
createTablesWithRetry(dbi);
NodeManager nodeManager = new TestingNodeManager();
NodeSupplier nodeSupplier = nodeManager::getWorkerNodes;
shardManager = createShardManager(dbi, nodeSupplier, systemTicker());
metadata = new RaptorMetadata(dbi, shardManager);
}
use of io.trino.plugin.raptor.legacy.RaptorMetadata in project trino by trinodb.
the class TestShardOrganizerUtil method setup.
@BeforeMethod
public void setup() {
dbi = createTestingJdbi();
dummyHandle = dbi.open();
createTablesWithRetry(dbi);
dataDir = Files.createTempDir();
metadata = new RaptorMetadata(dbi, createShardManager(dbi));
metadataDao = dbi.onDemand(MetadataDao.class);
shardManager = createShardManager(dbi);
}
use of io.trino.plugin.raptor.legacy.RaptorMetadata in project trino by trinodb.
the class TestShardMetadataRecordCursor method setup.
@BeforeMethod
public void setup() {
dbi = createTestingJdbi();
this.dummyHandle = dbi.open();
createTablesWithRetry(dbi);
this.metadata = new RaptorMetadata(dbi, createShardManager(dbi));
// Create table
ConnectorTableMetadata table = tableMetadataBuilder(DEFAULT_TEST_ORDERS).column("orderkey", BIGINT).column("orderdate", DATE).property("temporal_column", "orderdate").build();
createTable(table);
}
use of io.trino.plugin.raptor.legacy.RaptorMetadata in project trino by trinodb.
the class TestRaptorSplitManager method setup.
@BeforeMethod
public void setup() throws Exception {
Jdbi dbi = createTestingJdbi();
dummyHandle = dbi.open();
createTablesWithRetry(dbi);
temporary = createTempDirectory(null);
AssignmentLimiter assignmentLimiter = new AssignmentLimiter(ImmutableSet::of, systemTicker(), new MetadataConfig());
shardManager = new DatabaseShardManager(dbi, new DaoSupplier<>(dbi, ShardDao.class), ImmutableSet::of, assignmentLimiter, systemTicker(), new Duration(0, MINUTES));
TestingNodeManager nodeManager = new TestingNodeManager();
NodeSupplier nodeSupplier = nodeManager::getWorkerNodes;
String nodeName = UUID.randomUUID().toString();
nodeManager.addNode(new InternalNode(nodeName, new URI("http://127.0.0.1/"), NodeVersion.UNKNOWN, false));
CatalogName connectorId = new CatalogName("raptor");
metadata = new RaptorMetadata(dbi, shardManager);
metadata.createTable(SESSION, TEST_TABLE, false);
tableHandle = metadata.getTableHandle(SESSION, TEST_TABLE.getTable());
List<ShardInfo> shards = ImmutableList.<ShardInfo>builder().add(shardInfo(UUID.randomUUID(), nodeName)).add(shardInfo(UUID.randomUUID(), nodeName)).add(shardInfo(UUID.randomUUID(), nodeName)).add(shardInfo(UUID.randomUUID(), nodeName)).build();
tableId = ((RaptorTableHandle) tableHandle).getTableId();
List<ColumnInfo> columns = metadata.getColumnHandles(SESSION, tableHandle).values().stream().map(RaptorColumnHandle.class::cast).map(ColumnInfo::fromHandle).collect(toList());
long transactionId = shardManager.beginTransaction();
shardManager.commitShards(transactionId, tableId, columns, shards, Optional.empty(), 0);
raptorSplitManager = new RaptorSplitManager(connectorId, nodeSupplier, shardManager, false);
}
Aggregations