diff --git a/java/core/src/main/java/module-info.java b/java/core/src/main/java/module-info.java new file mode 100644 index 0000000000..0ba4e4efcf --- /dev/null +++ b/java/core/src/main/java/module-info.java @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module adbc.core { + requires org.apache.arrow.vector; + requires org.checkerframework.checker.qual; + + exports org.apache.arrow.adbc.core; +} diff --git a/java/driver-manager/src/main/java/module-info.java b/java/driver-manager/src/main/java/module-info.java new file mode 100644 index 0000000000..b28bd0525c --- /dev/null +++ b/java/driver-manager/src/main/java/module-info.java @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module adbc.driver.manager { + requires adbc.core; + requires org.apache.arrow.memory.core; + requires org.checkerframework.checker.qual; + + uses org.apache.arrow.adbc.drivermanager.AdbcDriverFactory; + + exports org.apache.arrow.adbc.drivermanager; +} diff --git a/java/driver-manager/src/main/java/org/apache/arrow/adbc/drivermanager/AdbcDriverManager.java b/java/driver-manager/src/main/java/org/apache/arrow/adbc/drivermanager/AdbcDriverManager.java index 83ce0884f4..acc77748f6 100644 --- a/java/driver-manager/src/main/java/org/apache/arrow/adbc/drivermanager/AdbcDriverManager.java +++ b/java/driver-manager/src/main/java/org/apache/arrow/adbc/drivermanager/AdbcDriverManager.java @@ -81,7 +81,7 @@ public AdbcDatabase connect( * fully-qualified class name of an AdbcDriverFactory class. * @return A function to construct an AdbcDriver from a BufferAllocator, or null if not found. */ - @Nullable Function lookupDriver(String driverFactoryName) { + public @Nullable Function lookupDriver(String driverFactoryName) { return driverFactoryFunctions.get(driverFactoryName); } diff --git a/java/driver-manager/src/main/java/org/apache/arrow/adbc/drivermanager/package-info.java b/java/driver-manager/src/main/java/org/apache/arrow/adbc/drivermanager/package-info.java new file mode 100644 index 0000000000..668040741b --- /dev/null +++ b/java/driver-manager/src/main/java/org/apache/arrow/adbc/drivermanager/package-info.java @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * The ADBC driver manager, analogously to the JDBC driver manager, manages dynamic discovery and + * loading of ADBC drivers. It is not required to use ADBC; you can always directly reference a + * {@link org.apache.arrow.adbc.core.AdbcDriver} implementation. + */ +package org.apache.arrow.adbc.drivermanager; diff --git a/java/driver-manager/src/test/java/module-info.java b/java/driver-manager/src/test/java/module-info.java new file mode 100644 index 0000000000..9633ab51e3 --- /dev/null +++ b/java/driver-manager/src/test/java/module-info.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module adbc.driver.manager.tests { + requires adbc.core; + requires adbc.driver.manager; + requires org.apache.arrow.memory.core; + requires org.assertj.core; + requires org.junit.jupiter.api; + + uses org.apache.arrow.adbc.drivermanager.AdbcDriverFactory; + + exports org.apache.arrow.adbc.drivermanagertest; + + provides org.apache.arrow.adbc.drivermanager.AdbcDriverFactory with + org.apache.arrow.adbc.test.TestDriverFactory; +} diff --git a/java/driver-manager/src/test/java/org/apache/arrow/adbc/drivermanager/AdbcDriverManagerTest.java b/java/driver-manager/src/test/java/org/apache/arrow/adbc/drivermanagertest/AdbcDriverManagerTest.java similarity index 91% rename from java/driver-manager/src/test/java/org/apache/arrow/adbc/drivermanager/AdbcDriverManagerTest.java rename to java/driver-manager/src/test/java/org/apache/arrow/adbc/drivermanagertest/AdbcDriverManagerTest.java index 5963bcafeb..25130366f0 100644 --- a/java/driver-manager/src/test/java/org/apache/arrow/adbc/drivermanager/AdbcDriverManagerTest.java +++ b/java/driver-manager/src/test/java/org/apache/arrow/adbc/drivermanagertest/AdbcDriverManagerTest.java @@ -15,12 +15,13 @@ * limitations under the License. */ -package org.apache.arrow.adbc.drivermanager; +package org.apache.arrow.adbc.drivermanagertest; import static org.assertj.core.api.Assertions.assertThat; import java.util.function.Function; import org.apache.arrow.adbc.core.AdbcDriver; +import org.apache.arrow.adbc.drivermanager.AdbcDriverManager; import org.apache.arrow.adbc.test.TestDriver; import org.apache.arrow.adbc.test.TestDriverFactory; import org.apache.arrow.memory.BufferAllocator; @@ -34,6 +35,8 @@ public void testDriverFromServiceLoader() { final Function driverFactoryFunction = AdbcDriverManager.getInstance().lookupDriver(TestDriverFactory.class.getCanonicalName()); + assertThat(driverFactoryFunction).isNotNull(); + try (BufferAllocator allocator = new RootAllocator()) { final AdbcDriver driverInstance = driverFactoryFunction.apply(allocator); assertThat(driverInstance.getClass()).isEqualTo(TestDriver.class); diff --git a/java/driver/flight-sql/src/main/java/module-info.java b/java/driver/flight-sql/src/main/java/module-info.java new file mode 100644 index 0000000000..1336958d00 --- /dev/null +++ b/java/driver/flight-sql/src/main/java/module-info.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module adbc.driver.flight.sql { + requires adbc.core; + requires adbc.driver.manager; + requires adbc.sql; + requires com.github.benmanes.caffeine; + requires flight.sql.jdbc.core; + requires java.sql; + requires org.apache.arrow.flight.core; + requires org.apache.arrow.flight.sql; + requires org.apache.arrow.memory.core; + requires org.apache.arrow.vector; + requires org.checkerframework.checker.qual; + + exports org.apache.arrow.adbc.driver.flightsql; +} diff --git a/java/driver/flight-sql/src/main/java/org/apache/arrow/adbc/driver/flightsql/package-info.java b/java/driver/flight-sql/src/main/java/org/apache/arrow/adbc/driver/flightsql/package-info.java new file mode 100644 index 0000000000..72135d0454 --- /dev/null +++ b/java/driver/flight-sql/src/main/java/org/apache/arrow/adbc/driver/flightsql/package-info.java @@ -0,0 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** A Flight SQL driver for ADBC. */ +package org.apache.arrow.adbc.driver.flightsql; diff --git a/java/driver/jdbc/src/main/java/module-info.java b/java/driver/jdbc/src/main/java/module-info.java new file mode 100644 index 0000000000..1a18670f00 --- /dev/null +++ b/java/driver/jdbc/src/main/java/module-info.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module adbc.driver.jdbc { + requires adbc.core; + requires adbc.driver.manager; + requires adbc.sql; + requires java.sql; + requires org.apache.arrow.adapter.jdbc; + requires org.apache.arrow.memory.core; + requires org.apache.arrow.vector; + requires org.checkerframework.checker.qual; + + exports org.apache.arrow.adbc.driver.jdbc; +} diff --git a/java/driver/jdbc/src/main/java/org/apache/arrow/adbc/driver/jdbc/package-info.java b/java/driver/jdbc/src/main/java/org/apache/arrow/adbc/driver/jdbc/package-info.java new file mode 100644 index 0000000000..bf77f31b31 --- /dev/null +++ b/java/driver/jdbc/src/main/java/org/apache/arrow/adbc/driver/jdbc/package-info.java @@ -0,0 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** An adapter that enables use of JDBC drivers through the ADBC interface. */ +package org.apache.arrow.adbc.driver.jdbc; diff --git a/java/driver/validation/src/main/java/module-info.java b/java/driver/validation/src/main/java/module-info.java new file mode 100644 index 0000000000..3ecdfbc776 --- /dev/null +++ b/java/driver/validation/src/main/java/module-info.java @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module adbc.driver.validation { + requires adbc.core; + requires org.apache.arrow.vector; + requires org.assertj.core; + requires org.junit.jupiter.api; + + exports org.apache.arrow.adbc.driver.testsuite; +} diff --git a/java/driver/validation/src/main/java/org/apache/arrow/adbc/driver/testsuite/package-info.java b/java/driver/validation/src/main/java/org/apache/arrow/adbc/driver/testsuite/package-info.java new file mode 100644 index 0000000000..6aa4d17175 --- /dev/null +++ b/java/driver/validation/src/main/java/org/apache/arrow/adbc/driver/testsuite/package-info.java @@ -0,0 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** A common base testsuite for ADBC drivers. */ +package org.apache.arrow.adbc.driver.testsuite; diff --git a/java/pom.xml b/java/pom.xml index 6b80751167..54500f5b50 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -187,7 +187,7 @@ org.apache.maven.plugins maven-surefire-plugin - --add-opens=java.base/java.nio=ALL-UNNAMED + --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED diff --git a/java/sql/src/main/java/module-info.java b/java/sql/src/main/java/module-info.java new file mode 100644 index 0000000000..4589fea8bd --- /dev/null +++ b/java/sql/src/main/java/module-info.java @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module adbc.sql { + requires org.apache.arrow.vector; + requires org.checkerframework.checker.qual; + + exports org.apache.arrow.adbc.sql; +}