/** * Returns fresh PalantirSqlConnection. It is the responsibility of the consumer of this method * to close the returned connection when done. */ public SqlConnection getFresh() { close(); return delegate.get(); }
private <T> T runDdl(TableReference tableRef, Function<DbDdlTable, T> runner) { ConnectionSupplier conns = new ConnectionSupplier(connections); try { /* The ddl actions can used both the fully qualified name and the internal name */ return runner.apply(dbTables.createDdl(tableRef, conns)); } finally { conns.close(); } }
private <T> T runWrite(TableReference tableRef, Function<DbWriteTable, T> runner) { ConnectionSupplier conns = new ConnectionSupplier(connections); try { return runner.apply(dbTables.createWrite(tableRef, conns)); } finally { conns.close(); } }
private <T> T runRead(TableReference tableRef, Function<DbReadTable, T> runner) { ConnectionSupplier conns = new ConnectionSupplier(connections); try { return runner.apply(dbTables.createRead(tableRef, conns)); } finally { conns.close(); } }
private <T> T runMetadata(TableReference tableRef, Function<DbMetadataTable, T> runner) { ConnectionSupplier conns = new ConnectionSupplier(connections); try { /* The metadata table operates only on the fully qualified table reference */ return runner.apply(dbTables.createMetadata(tableRef, conns)); } finally { conns.close(); } }
private <T> T runInitialization(Function<DbTableInitializer, T> runner) { ConnectionSupplier conns = new ConnectionSupplier(connections); try { return runner.apply(dbTables.createInitializer(conns)); } finally { conns.close(); } }
private <T> T runReadWrite(TableReference tableRef, ReadWriteTask<T> runner) { ConnectionSupplier conns = new ConnectionSupplier(connections); try { return runner.run( dbTables.createRead(tableRef, conns), dbTables.createWrite(tableRef, conns)); } finally { conns.close(); } }
/** * Returns fresh PalantirSqlConnection. It is the responsibility of the consumer of this method * to close the returned connection when done. */ public SqlConnection getFresh() { close(); return delegate.get(); }
private <T> T runDdl(TableReference tableRef, Function<DbDdlTable, T> runner) { ConnectionSupplier conns = new ConnectionSupplier(connections); try { /* The ddl actions can used both the fully qualified name and the internal name */ return runner.apply(dbTables.createDdl(tableRef, conns)); } finally { conns.close(); } }
private <T> T runInitialization(Function<DbTableInitializer, T> runner) { ConnectionSupplier conns = new ConnectionSupplier(connections); try { return runner.apply(dbTables.createInitializer(conns)); } finally { conns.close(); } }
private <T> T runRead(TableReference tableRef, Function<DbReadTable, T> runner) { ConnectionSupplier conns = new ConnectionSupplier(connections); try { return runner.apply(dbTables.createRead(tableRef, conns)); } finally { conns.close(); } }
private <T> T runMetadata(TableReference tableRef, Function<DbMetadataTable, T> runner) { ConnectionSupplier conns = new ConnectionSupplier(connections); try { /* The metadata table operates only on the fully qualified table reference */ return runner.apply(dbTables.createMetadata(tableRef, conns)); } finally { conns.close(); } }
private <T> T runWrite(TableReference tableRef, Function<DbWriteTable, T> runner) { ConnectionSupplier conns = new ConnectionSupplier(connections); try { return runner.apply(dbTables.createWrite(tableRef, conns)); } finally { conns.close(); } }
private <T> T runReadWrite(TableReference tableRef, ReadWriteTask<T> runner) { ConnectionSupplier conns = new ConnectionSupplier(connections); try { return runner.run( dbTables.createRead(tableRef, conns), dbTables.createWrite(tableRef, conns)); } finally { conns.close(); } }