Search in sources :

Example 1 with ForMetadata

use of com.facebook.presto.raptor.metadata.ForMetadata in project presto by prestodb.

the class RaptorModule method createDBI.

@ForMetadata
@Singleton
@Provides
public IDBI createDBI(@ForMetadata ConnectionFactory connectionFactory, TypeManager typeManager) {
    DBI dbi = new DBI(connectionFactory);
    dbi.registerMapper(new TableColumn.Mapper(typeManager));
    dbi.registerMapper(new Distribution.Mapper(typeManager));
    createTablesWithRetry(dbi);
    return dbi;
}
Also used : Distribution(com.facebook.presto.raptor.metadata.Distribution) IDBI(org.skife.jdbi.v2.IDBI) DBI(org.skife.jdbi.v2.DBI) TableColumn(com.facebook.presto.raptor.metadata.TableColumn) Singleton(javax.inject.Singleton) ForMetadata(com.facebook.presto.raptor.metadata.ForMetadata) Provides(com.google.inject.Provides)

Aggregations

Distribution (com.facebook.presto.raptor.metadata.Distribution)1 ForMetadata (com.facebook.presto.raptor.metadata.ForMetadata)1 TableColumn (com.facebook.presto.raptor.metadata.TableColumn)1 Provides (com.google.inject.Provides)1 Singleton (javax.inject.Singleton)1 DBI (org.skife.jdbi.v2.DBI)1 IDBI (org.skife.jdbi.v2.IDBI)1