Java源码示例:org.apache.calcite.avatica.AvaticaFactory
示例1
protected QuarkConnectionImpl(QuarkDriver driver, AvaticaFactory factory, String url,
Properties info, CalciteRootSchema rootSchema,
JavaTypeFactory typeFactory) throws SQLException {
super(driver, factory, url, info);
CalciteConnectionConfig cfg = new CalciteConnectionConfigImpl(info);
if (typeFactory != null) {
this.typeFactory = typeFactory;
} else {
final RelDataTypeSystem typeSystem =
cfg.typeSystem(RelDataTypeSystem.class, RelDataTypeSystem.DEFAULT);
this.typeFactory = new JavaTypeFactoryImpl(typeSystem);
}
this.properties.put(InternalProperty.CASE_SENSITIVE, cfg.caseSensitive());
this.properties.put(InternalProperty.UNQUOTED_CASING, cfg.unquotedCasing());
this.properties.put(InternalProperty.QUOTED_CASING, cfg.quotedCasing());
this.properties.put(InternalProperty.QUOTING, cfg.quoting());
}
示例2
public final AvaticaConnection newConnection(
UnregisteredDriver driver,
AvaticaFactory factory,
String url,
Properties info) {
return newConnection(driver, factory, url, info, null, null);
}
示例3
/**
* Creates a CalciteConnectionImpl.
*
* <p>Not public; method is called only from the driver.</p>
*
* @param driver Driver
* @param factory Factory for JDBC objects
* @param url Server URL
* @param info Other connection properties
* @param rootSchema Root schema, or null
* @param typeFactory Type factory, or null
*/
protected CalciteConnectionImpl(Driver driver, AvaticaFactory factory,
String url, Properties info, CalciteSchema rootSchema,
JavaTypeFactory typeFactory) {
super(driver, factory, url, info);
CalciteConnectionConfig cfg = new CalciteConnectionConfigImpl(info);
this.prepareFactory = driver.prepareFactory;
if (typeFactory != null) {
this.typeFactory = typeFactory;
} else {
RelDataTypeSystem typeSystem =
cfg.typeSystem(RelDataTypeSystem.class, RelDataTypeSystem.DEFAULT);
if (cfg.conformance().shouldConvertRaggedUnionTypesToVarying()) {
typeSystem =
new DelegatingTypeSystem(typeSystem) {
@Override public boolean
shouldConvertRaggedUnionTypesToVarying() {
return true;
}
};
}
this.typeFactory = new JavaTypeFactoryImpl(typeSystem);
}
this.rootSchema =
Objects.requireNonNull(rootSchema != null
? rootSchema
: CalciteSchema.createRootSchema(true));
Preconditions.checkArgument(this.rootSchema.isRoot(), "must be root schema");
this.properties.put(InternalProperty.CASE_SENSITIVE, cfg.caseSensitive());
this.properties.put(InternalProperty.UNQUOTED_CASING, cfg.unquotedCasing());
this.properties.put(InternalProperty.QUOTED_CASING, cfg.quotedCasing());
this.properties.put(InternalProperty.QUOTING, cfg.quoting());
}
示例4
/**
* Creates a Dremio connection for Avatica (in terms of Avatica types).
* <p>
* This implementation delegates to
* {@link #newDremioConnection(DriverImpl, DremioFactory, String, Properties)}.
* </p>
*/
@Override
public final AvaticaConnection newConnection(UnregisteredDriver driver,
AvaticaFactory factory,
String url,
Properties info) throws SQLException {
return newConnection((DriverImpl) driver, (DremioFactory) factory, url, info);
}
示例5
/**
* Creates a Quark connection for Avatica (in terms of Avatica types).
* <p>
* This implementation delegates to
* {@link #newConnection(QuarkDriver, QuarkJdbcFactory, String, Properties, CalciteRootSchema,
* JavaTypeFactory)}.
* </p>
*/
@Override
public final AvaticaConnection newConnection(UnregisteredDriver driver,
AvaticaFactory factory,
String url,
Properties info) throws SQLException {
return newConnection((QuarkDriver) driver, (QuarkJdbcFactory) factory, url, info,
null, null);
}
示例6
public final AvaticaConnection newConnection(
UnregisteredDriver driver,
AvaticaFactory factory,
String url,
Properties info) {
return newConnection(driver, factory, url, info, null, null);
}
示例7
/** Creates a connection with a root schema. */
public abstract AvaticaConnection newConnection(UnregisteredDriver driver,
AvaticaFactory factory, String url, Properties info,
CalciteSchema rootSchema, JavaTypeFactory typeFactory);
示例8
public CalciteJdbc41Connection newConnection(UnregisteredDriver driver,
AvaticaFactory factory, String url, Properties info,
CalciteSchema rootSchema, JavaTypeFactory typeFactory) {
return new CalciteJdbc41Connection(
(Driver) driver, factory, url, info, rootSchema, typeFactory);
}
示例9
CalciteJdbc41Connection(Driver driver, AvaticaFactory factory, String url,
Properties info, CalciteSchema rootSchema,
JavaTypeFactory typeFactory) {
super(driver, factory, url, info, rootSchema, typeFactory);
}
示例10
AvaticaFactory getFactory() {
return factory;
}
示例11
public QuickSqlJdbc41Connection newConnection(UnregisteredDriver driver,
AvaticaFactory factory, String url, Properties info) {
return new QuickSqlJdbc41Connection(driver, factory, url, info);
}
示例12
QuickSqlJdbc41Connection(UnregisteredDriver driver, AvaticaFactory factory, String url,
Properties info) {
super(driver, factory, url, info);
}
示例13
/** Creates a connection with a root schema. */
public abstract AvaticaConnection newConnection(UnregisteredDriver driver,
AvaticaFactory factory, String url, Properties info);
示例14
@Override
public AvaticaConnection newConnection(UnregisteredDriver driver, AvaticaFactory factory, String url, Properties info) throws SQLException {
return new KylinConnection(driver, (KylinJdbcFactory) factory, url, info);
}
示例15
private AvaticaFactory factory() {
return factory;
}
示例16
AvaticaFactory getFactory() {
return factory;
}
示例17
@Override
public AvaticaConnection newConnection(UnregisteredDriver driver, AvaticaFactory factory, String url, Properties info) throws SQLException {
return new KylinConnection(driver, (KylinJdbcFactory) factory, url, info);
}
示例18
private AvaticaFactory factory() {
return factory;
}
示例19
/** Creates a connection with a root schema. */
public abstract AvaticaConnection newConnection(UnregisteredDriver driver,
AvaticaFactory factory, String url, Properties info,
CalciteSchema rootSchema, JavaTypeFactory typeFactory);
示例20
public CalciteJdbc41Connection newConnection(UnregisteredDriver driver,
AvaticaFactory factory, String url, Properties info,
CalciteSchema rootSchema, JavaTypeFactory typeFactory) {
return new CalciteJdbc41Connection(
(Driver) driver, factory, url, info, rootSchema, typeFactory);
}
示例21
CalciteJdbc41Connection(Driver driver, AvaticaFactory factory, String url,
Properties info, CalciteSchema rootSchema,
JavaTypeFactory typeFactory) {
super(driver, factory, url, info, rootSchema, typeFactory);
}
示例22
AvaticaFactory getFactory() {
return factory;
}
示例23
/**
* Creates a QuicksqlConnectionImpl.
*
* <p>Not public; method is called only from the driver.</p>
*
* @param driver Driver
* @param factory Factory for JDBC objects
* @param url Server URL
* @param info Other connection properties
*/
protected QuicksqlConnectionImpl(UnregisteredDriver driver, AvaticaFactory factory,
String url, Properties info) {
super(driver, factory, url, info);
}