Skip to content

Commit

Permalink
Rename classes
Browse files Browse the repository at this point in the history
  • Loading branch information
lidavidm committed Aug 30, 2022
1 parent fa507f0 commit f1e0019
Show file tree
Hide file tree
Showing 88 changed files with 1,269 additions and 1,250 deletions.
8 changes: 4 additions & 4 deletions java/flight/flight-sql-jdbc-driver/jdbc-spotbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="org.apache.arrow.driver.jdbc.client.ArrowFlightSqlClientHandler"/>
<Class name="org.apache.arrow.driver.jdbc.client.FlightSqlClientHandler"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="org.apache.arrow.driver.jdbc.utils.ConnectionWrapper"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="org.apache.arrow.driver.jdbc.ArrowFlightJdbcDataSource"/>
<Class name="org.apache.arrow.driver.jdbc.FlightSqlJdbcDataSource"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="org.apache.arrow.driver.jdbc.ArrowFlightJdbcCursor"/>
<Class name="org.apache.arrow.driver.jdbc.FlightSqlJdbcCursor"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>

<Match>
<Class name="org.apache.arrow.driver.jdbc.ArrowFlightJdbcDataSource"/>
<Class name="org.apache.arrow.driver.jdbc.FlightSqlJdbcDataSource"/>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
</FindBugsFilter>
4 changes: 2 additions & 2 deletions java/flight/flight-sql-jdbc-driver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>flight-jdbc-driver</artifactId>
<artifactId>flight-sql-jdbc-driver</artifactId>
<name>Arrow Flight SQL JDBC Driver</name>
<description>(Contrib/Experimental) A JDBC driver based on Arrow Flight SQL.</description>
<packaging>jar</packaging>
Expand Down Expand Up @@ -299,7 +299,7 @@
<rule>
<element>CLASS</element>
<excludes>
<exclude>org.apache.arrow.driver.jdbc.utils.ArrowFlightConnectionConfigImpl</exclude>
<exclude>org.apache.arrow.driver.jdbc.utils.FlightSqlConnectionConfigImpl</exclude>
<!-- The uncovered branch is unreachable -->
<exclude>org.apache.arrow.driver.jdbc.utils.UrlParser</exclude>
</excludes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.Arrays;
import java.util.Map;

import org.apache.arrow.driver.jdbc.accessor.impl.complex.AbstractArrowFlightJdbcListVectorAccessor;
import org.apache.arrow.driver.jdbc.accessor.impl.complex.AbstractArrowJdbcListVectorAccessor;
import org.apache.arrow.driver.jdbc.utils.SqlTypes;
import org.apache.arrow.memory.util.LargeMemoryUtil;
import org.apache.arrow.vector.FieldVector;
Expand All @@ -37,9 +37,9 @@
/**
* Implementation of {@link Array} using an underlying {@link FieldVector}.
*
* @see AbstractArrowFlightJdbcListVectorAccessor
* @see AbstractArrowJdbcListVectorAccessor
*/
public class ArrowFlightJdbcArray implements Array {
public class FieldVectorJdbcArray implements Array {

private final FieldVector dataVector;
private final long startOffset;
Expand All @@ -52,7 +52,7 @@ public class ArrowFlightJdbcArray implements Array {
* @param startOffset offset from FieldVector pointing to this Array's first value.
* @param valuesCount how many items this Array contains.
*/
public ArrowFlightJdbcArray(FieldVector dataVector, long startOffset, long valuesCount) {
public FieldVectorJdbcArray(FieldVector dataVector, long startOffset, long valuesCount) {
this.dataVector = dataVector;
this.startOffset = startOffset;
this.valuesCount = valuesCount;
Expand Down Expand Up @@ -143,7 +143,7 @@ private static ResultSet getResultSetNoBoundariesCheck(ValueVector dataVector, l
FieldVector vectorSlice = (FieldVector) transferPair.getTo();

VectorSchemaRoot vectorSchemaRoot = VectorSchemaRoot.of(vectorSlice);
return ArrowFlightJdbcVectorSchemaRootResultSet.fromVectorSchemaRoot(vectorSchemaRoot);
return VectorSchemaRootResultSet.fromVectorSchemaRoot(vectorSchemaRoot);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import java.sql.PreparedStatement;
import java.sql.SQLException;

import org.apache.arrow.driver.jdbc.client.ArrowFlightSqlClientHandler;
import org.apache.arrow.driver.jdbc.client.FlightSqlClientHandler;
import org.apache.arrow.driver.jdbc.utils.ConvertUtils;
import org.apache.arrow.flight.FlightInfo;
import org.apache.arrow.util.Preconditions;
Expand All @@ -32,26 +32,26 @@


/**
* Arrow Flight JBCS's implementation {@link PreparedStatement}.
* Arrow Flight SQL JDBC's implementation of {@link PreparedStatement}.
*/
public class ArrowFlightPreparedStatement extends AvaticaPreparedStatement
implements ArrowFlightInfoStatement {
public class FlightInfoPreparedStatement extends AvaticaPreparedStatement
implements FlightInfoStatement {

private final ArrowFlightSqlClientHandler.PreparedStatement preparedStatement;
private final FlightSqlClientHandler.PreparedStatement preparedStatement;

private ArrowFlightPreparedStatement(final ArrowFlightConnection connection,
final ArrowFlightSqlClientHandler.PreparedStatement preparedStatement,
final StatementHandle handle,
final Signature signature, final int resultSetType,
final int resultSetConcurrency,
final int resultSetHoldability)
private FlightInfoPreparedStatement(final FlightSqlConnection connection,
final FlightSqlClientHandler.PreparedStatement preparedStatement,
final StatementHandle handle,
final Signature signature, final int resultSetType,
final int resultSetConcurrency,
final int resultSetHoldability)
throws SQLException {
super(connection, handle, signature, resultSetType, resultSetConcurrency, resultSetHoldability);
this.preparedStatement = Preconditions.checkNotNull(preparedStatement);
}

/**
* Creates a new {@link ArrowFlightPreparedStatement} from the provided information.
* Creates a new {@link FlightInfoPreparedStatement} from the provided information.
*
* @param connection the {@link Connection} to use.
* @param statementHandle the {@link StatementHandle} to use.
Expand All @@ -62,27 +62,27 @@ private ArrowFlightPreparedStatement(final ArrowFlightConnection connection,
* @return a new {@link PreparedStatement}.
* @throws SQLException on error.
*/
static ArrowFlightPreparedStatement createNewPreparedStatement(
final ArrowFlightConnection connection,
static FlightInfoPreparedStatement createNewPreparedStatement(
final FlightSqlConnection connection,
final StatementHandle statementHandle,
final Signature signature,
final int resultSetType,
final int resultSetConcurrency,
final int resultSetHoldability) throws SQLException {

final ArrowFlightSqlClientHandler.PreparedStatement prepare = connection.getClientHandler().prepare(signature.sql);
final FlightSqlClientHandler.PreparedStatement prepare = connection.getClientHandler().prepare(signature.sql);
final Schema resultSetSchema = prepare.getDataSetSchema();

signature.columns.addAll(ConvertUtils.convertArrowFieldsToColumnMetaDataList(resultSetSchema.getFields()));

return new ArrowFlightPreparedStatement(
return new FlightInfoPreparedStatement(
connection, prepare, statementHandle,
signature, resultSetType, resultSetConcurrency, resultSetHoldability);
}

@Override
public ArrowFlightConnection getConnection() throws SQLException {
return (ArrowFlightConnection) super.getConnection();
public FlightSqlConnection getConnection() throws SQLException {
return (FlightSqlConnection) super.getConnection();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
/**
* A {@link Statement} that deals with {@link FlightInfo}.
*/
public interface ArrowFlightInfoStatement extends Statement {
public interface FlightInfoStatement extends Statement {

@Override
ArrowFlightConnection getConnection() throws SQLException;
FlightSqlConnection getConnection() throws SQLException;

/**
* Executes the query this {@link Statement} is holding.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@

package org.apache.arrow.driver.jdbc;

import static org.apache.arrow.driver.jdbc.utils.ArrowFlightConnectionConfigImpl.ArrowFlightConnectionProperty.replaceSemiColons;
import static org.apache.arrow.driver.jdbc.utils.FlightSqlConnectionConfigImpl.ArrowFlightConnectionProperty.replaceSemiColons;

import java.sql.SQLException;
import java.util.Properties;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import org.apache.arrow.driver.jdbc.client.ArrowFlightSqlClientHandler;
import org.apache.arrow.driver.jdbc.utils.ArrowFlightConnectionConfigImpl;
import org.apache.arrow.driver.jdbc.client.FlightSqlClientHandler;
import org.apache.arrow.driver.jdbc.utils.FlightSqlConnectionConfigImpl;
import org.apache.arrow.flight.FlightClient;
import org.apache.arrow.memory.BufferAllocator;
import org.apache.arrow.util.AutoCloseables;
Expand All @@ -36,64 +36,64 @@
import io.netty.util.concurrent.DefaultThreadFactory;

/**
* Connection to the Arrow Flight server.
* Connection to the Flight SQL server.
*/
public final class ArrowFlightConnection extends AvaticaConnection {
public final class FlightSqlConnection extends AvaticaConnection {

private final BufferAllocator allocator;
private final ArrowFlightSqlClientHandler clientHandler;
private final ArrowFlightConnectionConfigImpl config;
private final FlightSqlClientHandler clientHandler;
private final FlightSqlConnectionConfigImpl config;
private ExecutorService executorService;

/**
* Creates a new {@link ArrowFlightConnection}.
* Creates a new {@link FlightSqlConnection}.
*
* @param driver the {@link ArrowFlightJdbcDriver} to use.
* @param driver the {@link FlightSqlJdbcDriver} to use.
* @param factory the {@link AvaticaFactory} to use.
* @param url the URL to use.
* @param properties the {@link Properties} to use.
* @param config the {@link ArrowFlightConnectionConfigImpl} to use.
* @param config the {@link FlightSqlConnectionConfigImpl} to use.
* @param allocator the {@link BufferAllocator} to use.
* @param clientHandler the {@link ArrowFlightSqlClientHandler} to use.
* @param clientHandler the {@link FlightSqlClientHandler} to use.
*/
private ArrowFlightConnection(final ArrowFlightJdbcDriver driver, final AvaticaFactory factory,
final String url, final Properties properties,
final ArrowFlightConnectionConfigImpl config,
final BufferAllocator allocator,
final ArrowFlightSqlClientHandler clientHandler) {
private FlightSqlConnection(final FlightSqlJdbcDriver driver, final AvaticaFactory factory,
final String url, final Properties properties,
final FlightSqlConnectionConfigImpl config,
final BufferAllocator allocator,
final FlightSqlClientHandler clientHandler) {
super(driver, factory, url, properties);
this.config = Preconditions.checkNotNull(config, "Config cannot be null.");
this.allocator = Preconditions.checkNotNull(allocator, "Allocator cannot be null.");
this.clientHandler = Preconditions.checkNotNull(clientHandler, "Handler cannot be null.");
}

/**
* Creates a new {@link ArrowFlightConnection} to a {@link FlightClient}.
* Creates a new {@link FlightSqlConnection} to a {@link FlightClient}.
*
* @param driver the {@link ArrowFlightJdbcDriver} to use.
* @param driver the {@link FlightSqlJdbcDriver} to use.
* @param factory the {@link AvaticaFactory} to use.
* @param url the URL to establish the connection to.
* @param properties the {@link Properties} to use for this session.
* @param allocator the {@link BufferAllocator} to use.
* @return a new {@link ArrowFlightConnection}.
* @return a new {@link FlightSqlConnection}.
* @throws SQLException on error.
*/
static ArrowFlightConnection createNewConnection(final ArrowFlightJdbcDriver driver,
final AvaticaFactory factory,
String url, final Properties properties,
final BufferAllocator allocator)
static FlightSqlConnection createNewConnection(final FlightSqlJdbcDriver driver,
final AvaticaFactory factory,
String url, final Properties properties,
final BufferAllocator allocator)
throws SQLException {
url = replaceSemiColons(url);
final ArrowFlightConnectionConfigImpl config = new ArrowFlightConnectionConfigImpl(properties);
final ArrowFlightSqlClientHandler clientHandler = createNewClientHandler(config, allocator);
return new ArrowFlightConnection(driver, factory, url, properties, config, allocator, clientHandler);
final FlightSqlConnectionConfigImpl config = new FlightSqlConnectionConfigImpl(properties);
final FlightSqlClientHandler clientHandler = createNewClientHandler(config, allocator);
return new FlightSqlConnection(driver, factory, url, properties, config, allocator, clientHandler);
}

private static ArrowFlightSqlClientHandler createNewClientHandler(
final ArrowFlightConnectionConfigImpl config,
private static FlightSqlClientHandler createNewClientHandler(
final FlightSqlConnectionConfigImpl config,
final BufferAllocator allocator) throws SQLException {
try {
return new ArrowFlightSqlClientHandler.Builder()
return new FlightSqlClientHandler.Builder()
.withHost(config.getHost())
.withPort(config.getPort())
.withUsername(config.getUser())
Expand Down Expand Up @@ -131,15 +131,15 @@ void reset() throws SQLException {
this.setHoldability(this.metaData.getResultSetHoldability());

// Reset Meta
((ArrowFlightMetaImpl) this.meta).setDefaultConnectionProperties();
((FlightSqlMetaImpl) this.meta).setDefaultConnectionProperties();
}

/**
* Gets the client {@link #clientHandler} backing this connection.
*
* @return the handler.
*/
ArrowFlightSqlClientHandler getClientHandler() throws SQLException {
FlightSqlClientHandler getClientHandler() throws SQLException {
return clientHandler;
}

Expand Down Expand Up @@ -183,7 +183,7 @@ BufferAllocator getBufferAllocator() {
return allocator;
}

public ArrowFlightMetaImpl getMeta() {
return (ArrowFlightMetaImpl) this.meta;
public FlightSqlMetaImpl getMeta() {
return (FlightSqlMetaImpl) this.meta;
}
}
Loading

0 comments on commit f1e0019

Please sign in to comment.