diff --git a/pom.xml b/pom.xml index 99979eaf6e..e27981b6df 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ trino-root io.trino - 405 + 411 trino-tiledb @@ -151,7 +151,7 @@ io.trino trino-testing - 405 + 411 test @@ -184,7 +184,12 @@ org.assertj assertj-core - 3.18.1 + test + + + + org.gaul + modernizer-maven-annotations test @@ -197,21 +202,17 @@ org.testng testng - 7.3.0 + 7.7.1 test - - org.gaul - modernizer-maven-plugin - 2.6.0 - org.apache.maven.plugins maven-surefire-plugin + 3.0.0-M6 false diff --git a/src/main/java/io/trino/plugin/tiledb/TileDBClient.java b/src/main/java/io/trino/plugin/tiledb/TileDBClient.java index 817c7a9fb1..96b28d1843 100644 --- a/src/main/java/io/trino/plugin/tiledb/TileDBClient.java +++ b/src/main/java/io/trino/plugin/tiledb/TileDBClient.java @@ -107,6 +107,7 @@ public HardwareAbstractionLayer getHardwareAbstractionLayer() /** * Get plugin configuration + * * @return TileDB plugin configuration */ public TileDBConfig getConfig() @@ -146,7 +147,8 @@ public TileDBTable addTableFromURI(Context localCtx, String schema, URI arrayUri /** * Return list of schema's. Since we don't have true discovery this is a static map which we return the keys - * @return List of tiledb schema names (currently just "tiledb") + * + * @return List of tiledb schema names (currently just "TileDB") */ public Set getSchemaNames() { @@ -155,7 +157,8 @@ public Set getSchemaNames() /** * Return all "tables" in a schema - * @param schema + * + * @param schema the schema * @return Set of table names */ public Set getTableNames(String schema) @@ -170,10 +173,11 @@ public Set getTableNames(String schema) /** * Fetches a table object given a schema and a table name - * @param schema - * @param tableName - * @param encryptionType - * @param encryptionKey + * + * @param schema the schema + * @param tableName the table name + * @param encryptionType the encryption type + * @param encryptionKey the encryption key * @return table object */ public TileDBTable getTable(ConnectorSession session, String schema, String tableName, @@ -200,8 +204,9 @@ public TileDBTable getTable(ConnectorSession session, String schema, String tabl /** * Fetches a table object given a schema and a table name - * @param schema - * @param tableName + * + * @param schema the schema + * @param tableName the table name * @return table object */ public TileDBTable getTable(ConnectorSession session, String schema, String tableName) @@ -222,7 +227,8 @@ public Context getCtx() /** * Rollback a create table statement, this just drops the array - * @param handle tiledb table handler + * + * @param handle TileDB table handler */ public void rollbackCreateTable(TileDBOutputTableHandle handle) { diff --git a/src/main/java/io/trino/plugin/tiledb/TileDBMetadata.java b/src/main/java/io/trino/plugin/tiledb/TileDBMetadata.java index c473e5c9be..c8a3fbe09f 100644 --- a/src/main/java/io/trino/plugin/tiledb/TileDBMetadata.java +++ b/src/main/java/io/trino/plugin/tiledb/TileDBMetadata.java @@ -226,7 +226,8 @@ public ColumnMetadata getColumnMetadata(ConnectorSession session, ConnectorTable } /** - * Create table creates a table without any data + * Create table creates a table without any data + * * @param session connector session * @param tableMetadata metadata for new table * @param ignoreExisting ignore existing tables? Currently not supported @@ -239,6 +240,7 @@ public void createTable(ConnectorSession session, ConnectorTableMetadata tableMe /** * beginCreateTable creates a table with data + * * @param session connector sessions * @param tableMetadata metadata for table * @param layout layout of new table @@ -254,6 +256,7 @@ public ConnectorOutputTableHandle beginCreateTable(ConnectorSession session, Con /** * Finish/commit creating a table with data + * * @param session connector session * @param tableHandle table handle * @param fragments any fragements (ignored) @@ -270,8 +273,9 @@ public Optional finishCreateTable(ConnectorSession sess } /** - * Set a rollback for a method to run some function at the rollback of a presto trasnaction - * @param action + * Set a rollback for a method to run some function at the rollback of a presto transaction + * + * @param action the action */ private void setRollback(Runnable action) { @@ -295,7 +299,8 @@ public void rollback() } /** - * Allow dropping of a table/tiledb array + * Allow dropping of a table/TileDB array + * * @param session connector session * @param tableHandle handle of table to be dropped */ @@ -352,6 +357,7 @@ public Optional finishInsert(ConnectorSession session, /** * Create an array given a presto table layout/schema + * * @param tableMetadata metadata about table * @return Output table handler */ diff --git a/src/main/java/io/trino/plugin/tiledb/TileDBModule.java b/src/main/java/io/trino/plugin/tiledb/TileDBModule.java index 4985d8a387..325f641682 100644 --- a/src/main/java/io/trino/plugin/tiledb/TileDBModule.java +++ b/src/main/java/io/trino/plugin/tiledb/TileDBModule.java @@ -196,6 +196,7 @@ else if (type.equals(TIMESTAMP_MILLIS)) { /** * This is a helper function to create an ArrayList for a given type + * * @param type datatype to create list of * @param isVariableLength if its variable length we will create a list of arrays * @return List diff --git a/src/main/java/io/trino/plugin/tiledb/TileDBPageSink.java b/src/main/java/io/trino/plugin/tiledb/TileDBPageSink.java index 4ecfc633fe..fb22402904 100644 --- a/src/main/java/io/trino/plugin/tiledb/TileDBPageSink.java +++ b/src/main/java/io/trino/plugin/tiledb/TileDBPageSink.java @@ -104,9 +104,10 @@ public class TileDBPageSink /** * Initialize an instance of page sink preparing for inserts + * * @param handle table handler * @param tileDBClient client (for context) - * @param session + * @param session the session */ public TileDBPageSink(TileDBOutputTableHandle handle, TileDBClient tileDBClient, ConnectorSession session) { @@ -144,8 +145,9 @@ public TileDBPageSink(TileDBOutputTableHandle handle, TileDBClient tileDBClient, /** * Reset query, as of TileDB 2.0 a query object should not be reused for writing unless in global order - * @param buffers - * @throws TileDBError + * + * @param buffers the buffers + * @throws TileDBError TileDBError */ private void resetQuery(Map> buffers) throws TileDBError { @@ -159,8 +161,9 @@ private void resetQuery(Map> buffers) thr /** * Reset query buffers by closing and re-allocating - * @param buffers - * @throws TileDBError + * + * @param buffers the buffers + * @throws TileDBError TileDBError */ private void resetBuffers(Map> buffers) throws TileDBError { @@ -212,6 +215,7 @@ private void resetBuffers(Map> buffers) t /** * appendPage adds the rows + * * @param page rows/columns to insert * @return Future not currently used, but could be for async writing. It does not support nullable attributes for now. */ @@ -285,7 +289,8 @@ public CompletableFuture appendPage(Page page) /** * Initialize the map holding the effective buffer sizes - * @param bufferEffectiveSizes + * + * @param bufferEffectiveSizes the buffer sizes */ private void initBufferEffectiveSizes(Map, Long>> bufferEffectiveSizes) { @@ -300,11 +305,12 @@ private void initBufferEffectiveSizes(Map, Long>> bu } /** - * Submit a query to tiledb for writing + * Submit a query to TileDB for writing + * * @param buffers Map of buffers to write * @param bufferEffectiveSizes Map of effective buffer sizes * @return QueryStatus - * @throws TileDBError + * @throws TileDBError TileDBError */ private QueryStatus submitQuery(Map> buffers, Map, Long>> bufferEffectiveSizes) throws TileDBError { @@ -386,13 +392,14 @@ private QueryStatus submitQuery(Map> buff /** * Append a column to appropriate buffer + * * @param page Page from presto containing data * @param position current row number * @param channel column index * @param columnBuffer NativeBuffer for column data * @param bufferPosition The current position of the buffer (where a write should start) * @return new effective buffer size after write - * @throws TileDBError + * @throws TileDBError TileDBError */ private long appendColumn(Page page, int position, int channel, NativeArray columnBuffer, int bufferPosition) throws TileDBError { diff --git a/src/main/java/io/trino/plugin/tiledb/TileDBRecordCursor.java b/src/main/java/io/trino/plugin/tiledb/TileDBRecordCursor.java index 6fb7c9574e..40f0263687 100644 --- a/src/main/java/io/trino/plugin/tiledb/TileDBRecordCursor.java +++ b/src/main/java/io/trino/plugin/tiledb/TileDBRecordCursor.java @@ -441,7 +441,6 @@ private int getClampedBufferSize(int numElements, int elementBytes) * Build the ranges for a query based on the split * * @param split the split to build the subArray based off of - * @return */ private void setRanges(TileDBSplit split) throws TileDBError { @@ -542,12 +541,13 @@ else if (attBounds.getSecond() == null) { /** * Returns the Query condition for the given bound. + * * @param attr The attribute * @param isString True if the attribute is String * @param bound The bound * @param op TIleDB operator * @return The query Condition - * @throws TileDBError + * @throws TileDBError TileDBError */ private QueryCondition conditionForBound(Attribute attr, boolean isString, Object bound, tiledb_query_condition_op_t op) throws TileDBError { @@ -1021,6 +1021,7 @@ else if (currentNumRecords > 0) { /** * Function to calculate the bytes read based on the buffer sizes + * * @return byte in current buffers */ private long calculateNativeArrayByteSizes() @@ -1053,7 +1054,8 @@ private long calculateNativeArrayByteSizes() /** * Check if we can double the buffer, or if there is not enough memory space - * @return + * + * @return true if buffers can be reallocated */ private boolean canReallocBuffers() { @@ -1095,7 +1097,8 @@ private void calculateAdditionalBytesRead() /** * Copy buffers from NativeArray to java arrays for faster access times * Making the JNI calls in NativeArray is too slow - * @throws TileDBError + * + * @throws TileDBError TileDBError */ private void copyQueryBuffers() throws TileDBError { @@ -1366,6 +1369,7 @@ private Pair startTimer() /** * Save function timing to the hashmap of times + * * @param functionName Name of function being recorded * @param timer Times from record */ diff --git a/src/main/java/io/trino/plugin/tiledb/TileDBSplitManager.java b/src/main/java/io/trino/plugin/tiledb/TileDBSplitManager.java index 435b31410f..4e9df6e97a 100644 --- a/src/main/java/io/trino/plugin/tiledb/TileDBSplitManager.java +++ b/src/main/java/io/trino/plugin/tiledb/TileDBSplitManager.java @@ -125,6 +125,7 @@ public ConnectorSplitSource getSplits(ConnectorTransactionHandle transaction, Co /** * Returns the tuple domain and the column handles + * * @param session The connector session * @param tableHandle The table handle * @param constraint The constraint @@ -209,11 +210,11 @@ else if (type instanceof VarcharType) { /** * Split tuple domain if there are multiple ranges * - * @param tupleDomain - * @param splitOnlyPredicates - * @param nonEmptyDomains - * @param dimensionCount - * @return + * @param tupleDomain the tuple domain + * @param splitOnlyPredicates the split predicates + * @param nonEmptyDomains the non-empty domains + * @param dimensionCount the dimension count + * @return tuple domains after split */ private List> splitTupleDomainOnRanges(TupleDomain tupleDomain, int splits, boolean splitOnlyPredicates, HashMap nonEmptyDomains, int dimensionCount) { @@ -282,10 +283,11 @@ private List> splitTupleDomainOnRanges(TupleDomain>> lists, List> result, int depth, Map current) { @@ -307,6 +309,7 @@ private void generateCombinationTupleDomains(List= X we change to >= X AND less than MaxNonEmpty diff --git a/src/main/java/io/trino/plugin/tiledb/util/Util.java b/src/main/java/io/trino/plugin/tiledb/util/Util.java index 548034a759..84511676c0 100644 --- a/src/main/java/io/trino/plugin/tiledb/util/Util.java +++ b/src/main/java/io/trino/plugin/tiledb/util/Util.java @@ -166,9 +166,10 @@ else if (lowerBound < Double.MIN_VALUE) { * Parses a comma-separated filter list and returns a list with key-value pairs, * where the key is the filter name (e.g. bzip2) and the value the filter's value * (e.g. -1) - * @param csvList - * @return - * @throws IllegalArgumentException + * + * @param csvList The csv list + * @return the parsed filter list + * @throws IllegalArgumentException Exception */ public static Optional>> tryParseFilterList(String csvList) throws IllegalArgumentException @@ -211,10 +212,11 @@ public static Optional>> tryParseFilterList(String cs /** * Returns a TileDB FilterList + * * @param ctx The context * @param filterListDesc The filter pairs list extracted with the tryParseFilterList method * @return The FilterList instance - * @throws TileDBError + * @throws TileDBError TileDBError */ public static FilterList createTileDBFilterList( Context ctx, List> filterListDesc) throws TileDBError diff --git a/src/test/java/io/trino/plugin/tiledb/TestTileDBIntegrationSmokeTest.java b/src/test/java/io/trino/plugin/tiledb/TestTileDBIntegrationSmokeTest.java index 200d1fc1aa..0e87ad8202 100644 --- a/src/test/java/io/trino/plugin/tiledb/TestTileDBIntegrationSmokeTest.java +++ b/src/test/java/io/trino/plugin/tiledb/TestTileDBIntegrationSmokeTest.java @@ -22,15 +22,17 @@ import io.trino.testing.AbstractTestQueries; import io.trino.testing.MaterializedResult; import io.trino.testing.QueryRunner; +import org.gaul.modernizer_maven_annotations.SuppressModernizer; import org.testng.annotations.AfterClass; import org.testng.annotations.Test; import static io.trino.plugin.tiledb.TileDBErrorCode.TILEDB_UNEXPECTED_ERROR; import static io.trino.spi.type.VarcharType.VARCHAR; -import static io.trino.testing.assertions.Assert.assertEquals; import static org.assertj.core.api.Assertions.assertThat; +import static org.testng.Assert.assertEquals; @Test +@SuppressModernizer public class TestTileDBIntegrationSmokeTest extends AbstractTestQueries { diff --git a/src/test/java/io/trino/plugin/tiledb/TestTileDBQueries.java b/src/test/java/io/trino/plugin/tiledb/TestTileDBQueries.java index 02b1587e2a..ccb0c4bcee 100644 --- a/src/test/java/io/trino/plugin/tiledb/TestTileDBQueries.java +++ b/src/test/java/io/trino/plugin/tiledb/TestTileDBQueries.java @@ -34,6 +34,7 @@ import io.trino.testing.MaterializedResult; import io.trino.testing.MaterializedRow; import io.trino.testing.QueryRunner; +import org.gaul.modernizer_maven_annotations.SuppressModernizer; import org.testng.annotations.Test; import java.io.File; @@ -65,12 +66,12 @@ import static io.trino.spi.type.TimestampType.TIMESTAMP_MILLIS; import static io.trino.spi.type.TinyintType.TINYINT; import static io.trino.spi.type.VarcharType.VARCHAR; -import static io.trino.testing.assertions.Assert.assertEquals; import static java.lang.String.format; +import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; import static org.testng.Assert.fail; -@Test(singleThreaded = true) +@Test(singleThreaded = true) @SuppressModernizer public class TestTileDBQueries extends AbstractTestQueryFramework {