Skip to content

Commit

Permalink
Apply spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
jzhuge committed Aug 30, 2022
1 parent f16158d commit 156625e
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 53 deletions.
29 changes: 12 additions & 17 deletions api/src/main/java/org/apache/iceberg/catalog/ViewCatalog.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.iceberg.catalog;

import java.util.List;
Expand All @@ -27,9 +26,7 @@
import org.apache.iceberg.view.View;
import org.apache.iceberg.view.ViewRepresentation;

/**
* A Catalog API for view create, drop, and load operations.
*/
/** A Catalog API for view create, drop, and load operations. */
public interface ViewCatalog {

/**
Expand Down Expand Up @@ -108,8 +105,8 @@ default boolean dropView(TableIdentifier identifier) {

/**
* Drop a view; optionally delete metadata files.
* <p>
* If purge is set to true the implementation should delete all metadata files.
*
* <p>If purge is set to true the implementation should delete all metadata files.
*
* @param identifier a view identifier
* @param purge if true, delete all metadata files in the view
Expand All @@ -129,25 +126,23 @@ default boolean dropView(TableIdentifier identifier) {

/**
* Invalidate cached view metadata from current catalog.
* <p>
* If the view is already loaded or cached, drop cached data.
* If the view does not exist or is not cached, do nothing.
*
* <p>If the view is already loaded or cached, drop cached data. If the view does not exist or is
* not cached, do nothing.
*
* @param identifier a view identifier
*/
default void invalidateView(TableIdentifier identifier) {
}
default void invalidateView(TableIdentifier identifier) {}

/**
* Initialize a view catalog given a custom name and a map of catalog properties.
* <p>
* A custom view catalog implementation must have a no-arg constructor.
* A compute engine like Spark or Flink will first initialize the catalog without any arguments,
* and then call this method to complete catalog initialization with properties passed into the engine.
*
* <p>A custom view catalog implementation must have a no-arg constructor. A compute engine like
* Spark or Flink will first initialize the catalog without any arguments, and then call this
* method to complete catalog initialization with properties passed into the engine.
*
* @param name a custom name for the catalog
* @param properties catalog properties
*/
default void initialize(String name, Map<String, String> properties) {
}
default void initialize(String name, Map<String, String> properties) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,11 @@
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.iceberg.exceptions;

import com.google.errorprone.annotations.FormatMethod;

/**
* Exception raised when attempting to load a view that does not exist.
*/
/** Exception raised when attempting to load a view that does not exist. */
public class NoSuchViewException extends RuntimeException {
@FormatMethod
public NoSuchViewException(String message, Object... args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,25 @@
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.iceberg.view;

import java.util.Map;
import org.apache.iceberg.PendingUpdate;

/**
* API for updating view properties.
* <p>
* Apply returns the updated view properties as a map for validation.
* <p>
* When committing, these changes will be applied to the current view metadata.
* Commit conflicts will be resolved by applying the pending changes to the new view metadata.
*
* <p>Apply returns the updated view properties as a map for validation.
*
* <p>When committing, these changes will be applied to the current view metadata. Commit conflicts
* will be resolved by applying the pending changes to the new view metadata.
*/
public interface UpdateViewProperties extends PendingUpdate<Map<String, String>> {

/**
* Add a key/value property to the view.
*
* @param key a String key
* @param key a String key
* @param value a String value
* @return this for method chaining
* @throws NullPointerException If either the key or value is null
Expand Down
5 changes: 1 addition & 4 deletions api/src/main/java/org/apache/iceberg/view/View.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.iceberg.view;

import java.util.List;
import java.util.Map;

/**
* Interface for view definition.
*/
/** Interface for view definition. */
public interface View {

String name();
Expand Down
15 changes: 5 additions & 10 deletions api/src/main/java/org/apache/iceberg/view/ViewHistoryEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,18 @@
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.iceberg.view;

/**
* View history entry.
* <p>
* An entry contains a change to the view state.
* At the given timestamp, the current version was set to the given version ID.
*
* <p>An entry contains a change to the view state. At the given timestamp, the current version was
* set to the given version ID.
*/
public interface ViewHistoryEntry {
/**
* Returns the timestamp in milliseconds of the change
*/
/** Returns the timestamp in milliseconds of the change */
long timestampMillis();

/**
* Returns ID of the new current version
*/
/** Returns ID of the new current version */
int versionId();
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.iceberg.view;

import java.util.Locale;
Expand Down
20 changes: 10 additions & 10 deletions api/src/main/java/org/apache/iceberg/view/ViewVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,17 @@
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.iceberg.view;

import java.util.List;
import java.util.Map;

/**
* A version of the view at a point in time.
* <p>
* A version consists of a view metadata file.
* <p>
* Versions are created by view operations, like Create and Replace.
*
* <p>A version consists of a view metadata file.
*
* <p>Versions are created by view operations, like Create and Replace.
*/
public interface ViewVersion {

Expand All @@ -39,24 +38,25 @@ public interface ViewVersion {

/**
* Return this version's timestamp.
* <p>
* This timestamp is the same as those produced by {@link System#currentTimeMillis()}.
*
* <p>This timestamp is the same as those produced by {@link System#currentTimeMillis()}.
*
* @return a long timestamp in milliseconds
*/
long timestampMillis();

/**
* Returns the version summary such as the name of the operation that created that version of the view
* Returns the version summary such as the name of the operation that created that version of the
* view
*
* @return a version summary
*/
Map<String, String> summary();

/**
* Returns the list of view representations
* <p>
* Must contain at least one representation.
*
* <p>Must contain at least one representation.
*
* @return the list of view representations
*/
Expand Down

0 comments on commit 156625e

Please sign in to comment.