Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#103] improve(doc): improve English in code comments (#110)

Justin Mcleana4c62265eb61
diff --git a/api/src/main/java/com/datastrato/graviton/CatalogChange.java b/api/src/main/java/com/datastrato/graviton/CatalogChange.java
index cc911ea575..3a21a139bc 100644
--- a/api/src/main/java/com/datastrato/graviton/CatalogChange.java
+++ b/api/src/main/java/com/datastrato/graviton/CatalogChange.java
@@ -12,8 +12,8 @@ public interface CatalogChange {
/**
* Creates a new catalog change to rename the catalog.
*
- * @param newName the new name of the catalog
- * @return the catalog change
+ * @param newName The new name of the catalog.
+ * @return The catalog change.
*/
static CatalogChange rename(String newName) {
return new RenameCatalog(newName);
@@ -22,8 +22,8 @@ public interface CatalogChange {
/**
* Creates a new catalog change to update the catalog comment.
*
- * @param newComment the new comment of the catalog
- * @return the catalog change
+ * @param newComment The new comment for the catalog.
+ * @return The catalog change.
*/
static CatalogChange updateComment(String newComment) {
return new UpdateCatalogComment(newComment);
@@ -32,19 +32,19 @@ public interface CatalogChange {
/**
* Creates a new catalog change to set the property and value for the catalog.
*
- * @param property the property name to set
- * @param value the property value to set
- * @return the catalog change
+ * @param property The property name to set.
+ * @param value The value to set the property to.
+ * @return The catalog change.
*/
static CatalogChange setProperty(String property, String value) {
return new SetProperty(property, value);
}
/**
- * Creates a new catalog change to remove the property from the catalog.
+ * Creates a new catalog change to remove a property from the catalog.
*
- * @param property the property name to remove
- * @return the catalog change
+ * @param property The property name to remove.
+ * @return The catalog change.
*/
static CatalogChange removeProperty(String property) {
return new RemoveProperty(property);
diff --git a/api/src/main/java/com/datastrato/graviton/CatalogProvider.java b/api/src/main/java/com/datastrato/graviton/CatalogProvider.java
index 9f6a5f06b0..18323048b6 100644
--- a/api/src/main/java/com/datastrato/graviton/CatalogProvider.java
+++ b/api/src/main/java/com/datastrato/graviton/CatalogProvider.java
@@ -5,9 +5,8 @@
package com.datastrato.graviton;
/**
- * A Catalog provider is a class that provides a short name for a catalog. This short is used when
- * creating a catalog, Graviton will search the short name and its related class name to create the
- * catalog.
+ * A Catalog provider is a class that provides a short name for a catalog. This short name is used
+ * when creating a catalog.
*/
public interface CatalogProvider {
diff --git a/api/src/main/java/com/datastrato/graviton/Metalake.java b/api/src/main/java/com/datastrato/graviton/Metalake.java
index 53f18cbe9e..9811c3a172 100644
--- a/api/src/main/java/com/datastrato/graviton/Metalake.java
+++ b/api/src/main/java/com/datastrato/graviton/Metalake.java
@@ -7,8 +7,8 @@ package com.datastrato.graviton;
import java.util.Map;
/**
- * The interface of a metalake. The metalake is the top level entity in the graviton system. It
- * contains a set of catalogs.
+ * The interface of a metalake. The metalake is the top level entity in the graviton system,
+ * containing a set of catalogs.
*/
public interface Metalake extends Auditable {
diff --git a/api/src/main/java/com/datastrato/graviton/MetalakeChange.java b/api/src/main/java/com/datastrato/graviton/MetalakeChange.java
index 6b7a981b49..8bb81f6f19 100644
--- a/api/src/main/java/com/datastrato/graviton/MetalakeChange.java
+++ b/api/src/main/java/com/datastrato/graviton/MetalakeChange.java
@@ -12,8 +12,8 @@ public interface MetalakeChange {
/**
* Creates a new metalake change to rename the metalake.
*
- * @param newName the new name of the metalake
- * @return the metalake change
+ * @param newName The New name of the metalake.
+ * @return The metalake change.
*/
static MetalakeChange rename(String newName) {
return new RenameMetalake(newName);
@@ -22,29 +22,29 @@ public interface MetalakeChange {
/**
* Creates a new metalake change to update the metalake comment.
*
- * @param newComment the new comment of the metalake
- * @return the metalake change
+ * @param newComment The new comment of the metalake.
+ * @return The metalake change.
*/
static MetalakeChange updateComment(String newComment) {
return new UpdateMetalakeComment(newComment);
}
/**
- * Creates a new metalake change to set the property and value for the metalake.
+ * Creates a new metalake change to set a property and value pair for the metalake.
*
- * @param property the property name to set
- * @param value the property value to set
- * @return the metalake change
+ * @param property The property name to set.
+ * @param value The value to set the property to.
+ * @return The metalake change.
*/
static MetalakeChange setProperty(String property, String value) {
return new SetProperty(property, value);
}
/**
- * Creates a new metalake change to remove the property from the metalake.
+ * Creates a new metalake change to remove a property from the metalake.
*
- * @param property the property name to remove
- * @return the metalake change
+ * @param property The property name to remove.
+ * @return The metalake change.
*/
static MetalakeChange removeProperty(String property) {
return new RemoveProperty(property);
diff --git a/api/src/main/java/com/datastrato/graviton/rel/Schema.java b/api/src/main/java/com/datastrato/graviton/rel/Schema.java
index a557102b0f..bb9ae31d33 100644
--- a/api/src/main/java/com/datastrato/graviton/rel/Schema.java
+++ b/api/src/main/java/com/datastrato/graviton/rel/Schema.java
@@ -10,25 +10,25 @@ import java.util.Map;
import javax.annotation.Nullable;
/**
- * An interface representing a schema in the {@link com.datastrato.graviton.Catalog}. Schema is a
- * basic container of relational objects, like tables, views, etc. Schema can be self-nested, which
- * means it can be schema1.schema2.table.
+ * An interface representing a schema in the {@link com.datastrato.graviton.Catalog}. A Schema is a
+ * basic container of relational objects, like tables, views, etc. A Schema can be self-nested,
+ * which means it can be schema1.schema2.table.
*
- * <p>It defines basic properties of a schema. A catalog implementation with {@link SupportsSchemas}
- * should implement it.
+ * <p>This defines the basic properties of a schema. A catalog implementation with {@link
+ * SupportsSchemas} should implement this interface.
*/
public interface Schema extends Auditable {
- /** return the name of the Schema. */
+ /** Return the name of the Schema. */
String name();
- /** return the comment of the Schema. Null is returned if no comment is set. */
+ /** Return the comment of the Schema. Null is returned if the comment is not set. */
@Nullable
default String comment() {
return null;
}
- /** return the properties of the Schema. Empty map is returned if no properties are set. */
+ /** Return the properties of the Schema. An empty map is returned if no properties are set. */
default Map<String, String> properties() {
return Collections.emptyMap();
}
diff --git a/api/src/main/java/com/datastrato/graviton/rel/SchemaChange.java b/api/src/main/java/com/datastrato/graviton/rel/SchemaChange.java
index 99dd70b613..78ab60356e 100644
--- a/api/src/main/java/com/datastrato/graviton/rel/SchemaChange.java
+++ b/api/src/main/java/com/datastrato/graviton/rel/SchemaChange.java
@@ -26,21 +26,21 @@ import lombok.Getter;
public interface SchemaChange {
/**
- * SchemaChange class to set the property and value for the schema.
+ * SchemaChange class to set the property and value pairs for the schema.
*
- * @param property the property name to set
- * @param value the property value to set
- * @return the SchemaChange object
+ * @param property The property name to set.
+ * @param value The value to set teh property to.
+ * @return The SchemaChange object.
*/
static SchemaChange setProperty(String property, String value) {
return new SetProperty(property, value);
}
/**
- * SchemaChange class to remove the property from the schema.
+ * SchemaChange class to remove a property from the schema.
*
- * @param property the property name to remove
- * @return the SchemaChange object
+ * @param property The property name to remove.
+ * @return The SchemaChange object.
*/
static SchemaChange removeProperty(String property) {
return new RemoveProperty(property);
diff --git a/api/src/main/java/com/datastrato/graviton/rel/SupportsSchemas.java b/api/src/main/java/com/datastrato/graviton/rel/SupportsSchemas.java
index 99a0f24338..451cabb994 100644
--- a/api/src/main/java/com/datastrato/graviton/rel/SupportsSchemas.java
+++ b/api/src/main/java/com/datastrato/graviton/rel/SupportsSchemas.java
@@ -38,9 +38,9 @@ public interface SupportsSchemas {
* returned by this discovery method. For example, if table a.b.t exists, this method invoked as
* listSchemas(a) must return [a.b] in the result array
*
- * @param namespace the namespace to list
- * @return an array of schema identifier under the namespace
- * @throws NoSuchNamespaceException if the namespace does not exist
+ * @param namespace The namespace to list.
+ * @return An array of schema identifier under the namespace.
+ * @throws NoSuchNamespaceException If the namespace does not exist.
*/
NameIdentifier[] listSchemas(Namespace namespace) throws NoSuchNamespaceException;
@@ -50,8 +50,8 @@ public interface SupportsSchemas {
* <p>If an entity such as a table, view exists, its parent namespaces must also exist. For
* example, if table a.b.t exists, this method invoked as schemaExists(a) must return true.
*
- * @param ident the name identifier of the schema
- * @return true if the schema exists, false otherwise
+ * @param ident The name identifier of the schema.
+ * @return True if the schema exists, false otherwise.
*/
default boolean schemaExists(NameIdentifier ident) {
try {
@@ -65,11 +65,11 @@ public interface SupportsSchemas {
/**
* Create a schema in the catalog.
*
- * @param ident the name identifier of the schema
- * @param comment the comment of the schema
- * @param metadata the metadata of the schema
- * @return the created schema
- * @throws SchemaAlreadyExistsException if the schema already exists
+ * @param ident The name identifier of the schema.
+ * @param comment The comment of the schema.
+ * @param metadata The metadata of the schema.
+ * @return The created schema.
+ * @throws SchemaAlreadyExistsException If the schema already exists.
*/
Schema createSchema(NameIdentifier ident, String comment, Map<String, String> metadata)
throws SchemaAlreadyExistsException;
@@ -77,33 +77,33 @@ public interface SupportsSchemas {
/**
* Load metadata properties for a schema.
*
- * @param ident the name identifier of the schema
- * @return a schema
- * @throws NoSuchSchemaException If the schema does not exist (optional)
+ * @param ident The name identifier of the schema.
+ * @return A schema.
+ * @throws NoSuchSchemaException If the schema does not exist (optional).
*/
Schema loadSchema(NameIdentifier ident) throws NoSuchSchemaException;
/**
* Apply the metadata change to a schema in the catalog.
*
- * @param ident the name identifier of the schema
- * @param changes the metadata changes to apply
- * @return the altered schema
- * @throws NoSuchSchemaException if the schema does not exist
+ * @param ident The name identifier of the schema.
+ * @param changes The metadata changes to apply.
+ * @return The altered schema.
+ * @throws NoSuchSchemaException If the schema does not exist.
*/
Schema alterSchema(NameIdentifier ident, SchemaChange... changes) throws NoSuchSchemaException;
/**
- * Drop a schema from the catalog with cascade option, recursively dropping all objects within the
- * schema if cascade is tur.
+ * Drop a schema from the catalog. If cascade option is true, recursively drop all objects within
+ * the schema.
*
* <p>If the catalog implementation does not support this operation, it may throw {@link
* UnsupportedOperationException}.
*
- * @param ident the name identifier of the schema
- * @param cascade if true, recursively drop all objects within the schema
- * @return true if the schema is dropped successfully, false otherwise
- * @throws NonEmptySchemaException if the schema is not empty and cascade is false
+ * @param ident The name identifier of the schema.
+ * @param cascade If true, recursively drop all objects within the schema.
+ * @return True if the schema is dropped successfully, false otherwise.
+ * @throws NonEmptySchemaException If the schema is not empty and cascade is false.
*/
boolean dropSchema(NameIdentifier ident, boolean cascade) throws NonEmptySchemaException;
}
diff --git a/api/src/main/java/com/datastrato/graviton/rel/Table.java b/api/src/main/java/com/datastrato/graviton/rel/Table.java
index 4a8d50bb84..02febe71fe 100644
--- a/api/src/main/java/com/datastrato/graviton/rel/Table.java
+++ b/api/src/main/java/com/datastrato/graviton/rel/Table.java
@@ -11,24 +11,24 @@ import java.util.Map;
import javax.annotation.Nullable;
/**
- * An interface representing a table in a {@link Namespace}. It defines basic properties of a table.
- * A catalog implementation with {@link TableCatalog} should implement it.
+ * An interface representing a table in a {@link Namespace}. It defines the basic properties of a
+ * table. A catalog implementation with {@link TableCatalog} should implement this interface.
*/
public interface Table extends Auditable {
/** return the name of the table. */
String name();
- /** return the columns of the table. */
+ /** Return the columns of the table. */
Column[] columns();
- /** return the comment of the table. Null is returned if no comment is set. */
+ /** Return the comment of the table. Null is returned if no comment is set. */
@Nullable
default String comment() {
return null;
}
- /** return the properties of the table. Empty map is returned if no properties are set. */
+ /** Return the properties of the table. Empty map is returned if no properties are set. */
default Map<String, String> properties() {
return Collections.emptyMap();
}
diff --git a/api/src/main/java/com/datastrato/graviton/rel/TableCatalog.java b/api/src/main/java/com/datastrato/graviton/rel/TableCatalog.java
index 939daa4e08..a736340b7e 100644
--- a/api/src/main/java/com/datastrato/graviton/rel/TableCatalog.java
+++ b/api/src/main/java/com/datastrato/graviton/rel/TableCatalog.java
@@ -36,26 +36,26 @@ public interface TableCatalog {
/**
* List the tables in a namespace from the catalog.
*
- * @param namespace a namespace
- * @return an array of table identifiers in the namespace
- * @throws NoSuchSchemaException if the schema does not exist
+ * @param namespace A namespace.
+ * @return An array of table identifiers in the namespace.
+ * @throws NoSuchSchemaException If the schema does not exist.
*/
NameIdentifier[] listTables(Namespace namespace) throws NoSuchSchemaException;
/**
* Load table metadata by {@link NameIdentifier} from the catalog.
*
- * @param ident a table identifier
- * @return the table metadata
- * @throws NoSuchTableException if the table does not exist
+ * @param ident A table identifier.
+ * @return The table metadata.
+ * @throws NoSuchTableException If the table does not exist.
*/
Table loadTable(NameIdentifier ident) throws NoSuchTableException;
/**
* Check if a table exists using an {@link NameIdentifier} from the catalog.
*
- * @param ident a table identifier
- * @return true if the table exists, false otherwise
+ * @param ident A table identifier.
+ * @return true If the table exists, false otherwise.
*/
default boolean tableExists(NameIdentifier ident) {
try {
@@ -68,13 +68,13 @@ public interface TableCatalog {
/**
* Create a table in the catalog.
*
- * @param ident a table identifier
- * @param columns the columns of the new table
- * @param comment the table comment
- * @param properties the table properties
- * @return the created table metadata
- * @throws NoSuchSchemaException if the schema does not exist
- * @throws TableAlreadyExistsException if the table already exists
+ * @param ident A table identifier.
+ * @param columns The columns of the new table.
+ * @param comment The table comment.
+ * @param properties The table properties.
+ * @return Fhe created table metadata.
+ * @throws NoSuchSchemaException If the schema does not exist.
+ * @throws TableAlreadyExistsException If the table already exists.
*/
Table createTable(
NameIdentifier ident, Column[] columns, String comment, Map<String, String> properties)
@@ -86,11 +86,11 @@ public interface TableCatalog {
* <p>Implementations may reject the change. If any change is rejected, no changes should be
* applied to the table.
*
- * @param ident a table identifier
- * @param changes table changes to apply to the table
- * @return the updated table metadata
- * @throws NoSuchTableException if the table does not exist
- * @throws IllegalArgumentException if the change is rejected by the implementation
+ * @param ident A table identifier.
+ * @param changes Table changes to apply to the table.
+ * @return The updated table metadata.
+ * @throws NoSuchTableException If the table does not exist.
+ * @throws IllegalArgumentException If the change is rejected by the implementation.
*/
Table alterTable(NameIdentifier ident, TableChange... changes)
throws NoSuchTableException, IllegalArgumentException;
@@ -98,8 +98,8 @@ public interface TableCatalog {
/**
* Drop a table from the catalog.
*
- * @param ident a table identifier
- * @return true if the table was dropped, false if the table did not exist
+ * @param ident A table identifier.
+ * @return True if the table was dropped, false if the table did not exist.
*/
boolean dropTable(NameIdentifier ident);
@@ -109,9 +109,9 @@ public interface TableCatalog {
* <p>If the catalog supports to purge a table, this method should be overridden. The default
* implementation throws an {@link UnsupportedOperationException}.
*
- * @param ident a table identifier
- * @return true if the table was purged, false if the table did not exist
- * @throws UnsupportedOperationException if the catalog does not support to purge a table
+ * @param ident A table identifier.
+ * @return True if the table was purged, false if the table did not exist.
+ * @throws UnsupportedOperationException If the catalog does not support to purge a table.
*/
default boolean purgeTable(NameIdentifier ident) throws UnsupportedOperationException {
throw new UnsupportedOperationException("purgeTable not supported.");
diff --git a/api/src/main/java/com/datastrato/graviton/rel/TableChange.java b/api/src/main/java/com/datastrato/graviton/rel/TableChange.java
index d45fe0291b..d009465e94 100644
--- a/api/src/main/java/com/datastrato/graviton/rel/TableChange.java
+++ b/api/src/main/java/com/datastrato/graviton/rel/TableChange.java
@@ -29,8 +29,8 @@ public interface TableChange {
/**
* Create a TableChange for renaming a table.
*
- * @param newName the new table name
- * @return a TableChange for the rename
+ * @param newName The new table name.
+ * @return A TableChange for the rename.
*/
static TableChange rename(String newName) {
return new RenameTable(newName);
@@ -39,8 +39,8 @@ public interface TableChange {
/**
* Create a TableChange for updating the comment.
*
- * @param newComment the new comment
- * @return a TableChange for the update
+ * @param newComment The new comment.
+ * @return A TableChange for the update.
*/
static TableChange updateComment(String newComment) {
return new UpdateComment(newComment);
@@ -51,9 +51,9 @@ public interface TableChange {
*
* <p>If the property already exists, it will be replaced with the new value.
*
- * @param property the property name
- * @param value the new property value
- * @return a TableChange for the addition
+ * @param property The property name.
+ * @param value The new property value.
+ * @return A TableChange for the addition.
*/
static TableChange setProperty(String property, String value) {
return new SetProperty(property, value);
@@ -64,8 +64,8 @@ public interface TableChange {
*
* <p>If the property does not exist, the change will succeed.
*
- * @param property the property name
- * @return a TableChange for the addition
+ * @param property The property name.
+ * @return A TableChange for the addition.
*/
static TableChange removeProperty(String property) {
return new RemoveProperty(property);
@@ -78,9 +78,9 @@ public interface TableChange {
* If the new field is nested and its parent does not exist or is not a struct, the change will
* result in an {@link IllegalArgumentException}.
*
- * @param fieldNames field names of the new column
- * @param dataType the new column's data type
- * @return a TableChange for the addition
+ * @param fieldNames The field names of the new column.
+ * @param dataType The new column's data type.
+ * @return A TableChange for the addition.
*/
static TableChange addColumn(String[] fieldNames, Type dataType) {
return new AddColumn(fieldNames, dataType, null, null);
@@ -93,10 +93,10 @@ public interface TableChange {
* If the new field is nested and its parent does not exist or is not a struct, the change will
* result in an {@link IllegalArgumentException}.
*
- * @param fieldNames field names of the new column
- * @param dataType the new column's data type
- * @param comment the new field's comment string
- * @return a TableChange for the addition
+ * @param fieldNames The field names of the new column.
+ * @param dataType The new column's data type.
+ * @param comment The new field's comment string.
+ * @return A TableChange for the addition.
*/
static TableChange addColumn(String[] fieldNames, Type dataType, String comment) {
return new AddColumn(fieldNames, dataType, comment, null);
@@ -109,11 +109,11 @@ public interface TableChange {
* If the new field is nested and its parent does not exist or is not a struct, the change will
* result in an {@link IllegalArgumentException}.
*
- * @param fieldNames field names of the new column
- * @param dataType the new column's data type
- * @param comment the new field's comment string
- * @param position the new columns's position
- * @return a TableChange for the addition
+ * @param fieldNames Field names of the new column.
+ * @param dataType The new column's data type.
+ * @param comment The new field's comment string.
+ * @param position The new columns's position.
+ * @return A TableChange for the addition.
*/
static TableChange addColumn(
String[] fieldNames, Type dataType, String comment, ColumnPosition position) {
@@ -128,9 +128,9 @@ public interface TableChange {
*
* <p>If the field does not exist, the change will result in an {@link IllegalArgumentException}.
*
- * @param fieldNames the current field names
- * @param newName the new name
- * @return a TableChange for the rename
+ * @param fieldNames The current field names.
+ * @param newName The new name.
+ * @return A TableChange for the rename.
*/
static TableChange renameColumn(String[] fieldNames, String newName) {
return new RenameColumn(fieldNames, newName);
@@ -143,9 +143,9 @@ public interface TableChange {
*
* <p>If the field does not exist, the change will result in an {@link IllegalArgumentException}.
*
- * @param fieldNames field names of the column to update
- * @param newDataType the new data type
- * @return a TableChange for the update
+ * @param fieldNames The field names of the column to update.
+ * @param newDataType The new data type.
+ * @return A TableChange for the update.
*/
static TableChange updateColumnType(String[] fieldNames, Type newDataType) {
return new UpdateColumnType(fieldNames, newDataType);
@@ -158,9 +158,9 @@ public interface TableChange {
*
* <p>If the field does not exist, the change will result in an {@link IllegalArgumentException}.
*
- * @param fieldNames field names of the column to update
- * @param newComment the new comment
- * @return a TableChange for the update
+ * @param fieldNames The field names of the column to update.
+ * @param newComment The new comment.
+ * @return A TableChange for the update.
*/
static TableChange updateColumnComment(String[] fieldNames, String newComment) {
return new UpdateColumnComment(fieldNames, newComment);
@@ -173,9 +173,9 @@ public interface TableChange {
*
* <p>If the field does not exist, the change will result in an {@link IllegalArgumentException}.
*
- * @param fieldNames field names of the column to update
- * @param newPosition the new position
- * @return a TableChange for the update
+ * @param fieldNames The field names of the column to update.
+ * @param newPosition The new position.
+ * @return A TableChange for the update.
*/
static TableChange updateColumnPosition(String[] fieldNames, ColumnPosition newPosition) {
return new UpdateColumnPosition(fieldNames, newPosition);
@@ -186,9 +186,9 @@ public interface TableChange {
*
* <p>If the field does not exist, the change will result in an {@link IllegalArgumentException}.
*
- * @param fieldNames field names of the column to delete
- * @param ifExists silence the error if column doesn't exist during drop
- * @return a TableChange for the delete
+ * @param fieldNames Field names of the column to delete.
+ * @param ifExists Silence the error if column doesn't exist during drop.
+ * @return A TableChange for the delete.
*/
static TableChange deleteColumn(String[] fieldNames, Boolean ifExists) {
return new DeleteColumn(fieldNames, ifExists);