Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .baseline/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,20 @@
<message key="import.illegal" value="Use org.apache.iceberg.relocated.* classes from bundled-guava module instead."/>
</module>
<module name="IllegalImport">
<property name="id" value="BanUnrelocatedAssertJClasses"/>
<property name="id" value="GuavaClassesInAssertJ"/>
<property name="illegalPkgs" value="org.assertj.core.util"/>
<message key="import.illegal" value="Use org.apache.iceberg.relocated.* classes from bundled-guava module instead."/>
</module>
<module name="IllegalImport">
<property name="id" value="BanUnrelocatedArrowClasses"/>
<property name="id" value="GuavaClassesInArrow"/>
<property name="illegalPkgs" value="org.apache.arrow.util"/>
<message key="import.illegal" value="Use org.apache.iceberg.relocated.* classes from bundled-guava module instead."/>
</module>
<module name="IllegalImport">
<property name="id" value="GuavaClassesInParquet"/>
<property name="illegalClasses" value="org.apache.parquet.Preconditions"/>
<message key="import.illegal" value="Use Preconditions from bundled-guava module instead."/>
</module>
<module name="IllegalInstantiation"> <!-- Java Coding Guidelines: Never instantiate primitive types -->
<property name="classes" value="java.lang.Boolean"/>
<property name="classes" value="java.lang.Byte"/>
Expand Down Expand Up @@ -361,6 +366,10 @@
<property name="format" value="\bIOUtils\.toString\("/>
<property name="message" value="Prefer Guava''s [CharStreams,Files,Resources].toString to avoid charset/stream closing issues."/>
</module>
<module name="RegexpSinglelineJava">
<property name="format" value="\bIOUtils\.copy\("/>
<property name="message" value="Prefer Guava''s ByteStreams.copy to avoid charset/stream closing issues."/>
</module>
<module name="RegexpSinglelineJava">
<property name="format" value="static enum"/>
<property name="message" value="Redundant ''static'' modifier."/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.io.IOUtils;
import org.apache.commons.io.input.BoundedInputStream;
import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
import org.apache.iceberg.relocated.com.google.common.io.ByteStreams;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -168,7 +168,7 @@ public void getObject(
try (OutputStream outputStream = response.getOutputStream()) {
try (FileInputStream fis = new FileInputStream(metadata.getDataFile())) {
fis.skip(skipSize);
IOUtils.copy(new BoundedInputStream(fis, bytesToRead), outputStream);
ByteStreams.copy(new BoundedInputStream(fis, bytesToRead), outputStream);
}
}
} else {
Expand All @@ -180,7 +180,7 @@ public void getObject(

try (OutputStream outputStream = response.getOutputStream()) {
try (FileInputStream fis = new FileInputStream(metadata.getDataFile())) {
IOUtils.copy(fis, outputStream);
ByteStreams.copy(fis, outputStream);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
import java.util.List;
import java.util.Map;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.directory.api.util.Hex;
import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
import org.apache.iceberg.relocated.com.google.common.collect.Lists;
import org.apache.iceberg.relocated.com.google.common.io.ByteStreams;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
Expand Down Expand Up @@ -93,7 +93,7 @@ static String md5sum(InputStream is) throws IOException {

private static void inputStreamToFile(InputStream inputStream, File targetFile) throws IOException {
try (OutputStream outputStream = new FileOutputStream(targetFile)) {
IOUtils.copy(inputStream, outputStream);
ByteStreams.copy(inputStream, outputStream);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import java.util.List;
import org.apache.iceberg.parquet.VectorizedReader;
import org.apache.parquet.Preconditions;
import org.apache.iceberg.relocated.com.google.common.base.Preconditions;

/**
* A collection of vectorized readers per column (in the expected read schema) and Arrow Vector holders. This class owns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import org.apache.arrow.vector.complex.ListVector;
import org.apache.arrow.vector.complex.StructVector;
import org.apache.arrow.vector.util.DecimalUtility;
import org.apache.parquet.Preconditions;
import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
import org.apache.parquet.column.ColumnDescriptor;
import org.apache.parquet.column.Dictionary;
import org.apache.parquet.io.api.Binary;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.apache.iceberg.io.InputFile;
import org.apache.iceberg.orc.ORC;
import org.apache.iceberg.parquet.Parquet;
import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
import org.apache.iceberg.relocated.com.google.common.collect.ImmutableList;
import org.apache.iceberg.relocated.com.google.common.collect.Iterables;
import org.apache.iceberg.relocated.com.google.common.collect.Lists;
Expand All @@ -54,7 +55,6 @@
import org.apache.iceberg.util.Filter;
import org.apache.iceberg.util.StructLikeSet;
import org.apache.iceberg.util.StructProjection;
import org.apache.parquet.Preconditions;

public abstract class DeleteFilter<T> {
private static final long DEFAULT_SET_FILTER_THRESHOLD = 100_000L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
import org.apache.iceberg.parquet.ParquetTypeVisitor;
import org.apache.iceberg.parquet.ParquetValueWriter;
import org.apache.iceberg.parquet.ParquetValueWriters;
import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
import org.apache.iceberg.relocated.com.google.common.collect.Lists;
import org.apache.parquet.Preconditions;
import org.apache.parquet.column.ColumnDescriptor;
import org.apache.parquet.io.api.Binary;
import org.apache.parquet.schema.GroupType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.stream.Collectors;
import org.apache.iceberg.mapping.MappedField;
import org.apache.iceberg.mapping.NameMapping;
import org.apache.parquet.Preconditions;
import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
import org.apache.parquet.schema.GroupType;
import org.apache.parquet.schema.MessageType;
import org.apache.parquet.schema.PrimitiveType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.apache.iceberg.arrow.vectorized.BaseBatchReader;
import org.apache.iceberg.arrow.vectorized.VectorizedArrowReader;
import org.apache.iceberg.parquet.VectorizedReader;
import org.apache.parquet.Preconditions;
import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
import org.apache.spark.sql.vectorized.ColumnVector;
import org.apache.spark.sql.vectorized.ColumnarBatch;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.apache.iceberg.arrow.vectorized.BaseBatchReader;
import org.apache.iceberg.arrow.vectorized.VectorizedArrowReader;
import org.apache.iceberg.parquet.VectorizedReader;
import org.apache.parquet.Preconditions;
import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
import org.apache.spark.sql.vectorized.ColumnVector;
import org.apache.spark.sql.vectorized.ColumnarBatch;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.apache.iceberg.arrow.vectorized.BaseBatchReader;
import org.apache.iceberg.arrow.vectorized.VectorizedArrowReader;
import org.apache.iceberg.parquet.VectorizedReader;
import org.apache.parquet.Preconditions;
import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
import org.apache.spark.sql.vectorized.ColumnVector;
import org.apache.spark.sql.vectorized.ColumnarBatch;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.apache.iceberg.arrow.vectorized.BaseBatchReader;
import org.apache.iceberg.arrow.vectorized.VectorizedArrowReader;
import org.apache.iceberg.parquet.VectorizedReader;
import org.apache.parquet.Preconditions;
import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
import org.apache.spark.sql.vectorized.ColumnVector;
import org.apache.spark.sql.vectorized.ColumnarBatch;

Expand Down