Skip to content

Commit

Permalink
PARQUET-2274: Remove Yetus (#1056)
Browse files Browse the repository at this point in the history
* PARQUET-2274: Remove Yetus

I don't think this is used anywhere anymore.

* Add comments
  • Loading branch information
Fokko authored Nov 8, 2023
1 parent 2c233f2 commit 56f40e4
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 55 deletions.
5 changes: 0 additions & 5 deletions parquet-column/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@
<artifactId>zero-allocation-hashing</artifactId>
<version>${net.openhft.version}</version>
</dependency>
<dependency>
<groupId>org.apache.yetus</groupId>
<artifactId>audience-annotations</artifactId>
<version>${yetus.audience-annotations.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
package org.apache.parquet.schema;

import org.apache.parquet.Preconditions;
import org.apache.yetus.audience.InterfaceAudience;

import java.util.Collections;
import java.util.HashSet;
Expand Down Expand Up @@ -150,9 +149,10 @@ protected LogicalTypeAnnotation fromString(List<String> params) {
* Convert this logical type to old logical type representation in parquet-mr (if there's any).
* Those logical type implementations, which don't have a corresponding mapping should return null.
*
* API should be considered private
*
* @return the OriginalType representation of the new logical type, or null if there's none
*/
@InterfaceAudience.Private
public abstract OriginalType toOriginalType();

/**
Expand Down Expand Up @@ -186,8 +186,9 @@ PrimitiveStringifier valueStringifier(PrimitiveType primitiveType) {

/**
* Helper method to convert the old representation of logical types (OriginalType) to new logical type.
*
* API should be considered private
*/
@InterfaceAudience.Private
public static LogicalTypeAnnotation fromOriginalType(OriginalType originalType, DecimalMetadata decimalMetadata) {
if (originalType == null) {
return null;
Expand Down Expand Up @@ -302,8 +303,12 @@ public static class StringLogicalTypeAnnotation extends LogicalTypeAnnotation {
private StringLogicalTypeAnnotation() {
}

/**
* API Should be considered private
*
* @return the original type
*/
@Override
@InterfaceAudience.Private
public OriginalType toOriginalType() {
return OriginalType.UTF8;
}
Expand Down Expand Up @@ -341,8 +346,12 @@ public static class MapLogicalTypeAnnotation extends LogicalTypeAnnotation {
private MapLogicalTypeAnnotation() {
}

/**
* API Should be considered private
*
* @return the original type
*/
@Override
@InterfaceAudience.Private
public OriginalType toOriginalType() {
return OriginalType.MAP;
}
Expand Down Expand Up @@ -375,8 +384,12 @@ public static class ListLogicalTypeAnnotation extends LogicalTypeAnnotation {
private ListLogicalTypeAnnotation() {
}

/**
* API Should be considered private
*
* @return the original type
*/
@Override
@InterfaceAudience.Private
public OriginalType toOriginalType() {
return OriginalType.LIST;
}
Expand Down Expand Up @@ -409,8 +422,12 @@ public static class EnumLogicalTypeAnnotation extends LogicalTypeAnnotation {
private EnumLogicalTypeAnnotation() {
}

/**
* API Should be considered private
*
* @return the original type
*/
@Override
@InterfaceAudience.Private
public OriginalType toOriginalType() {
return OriginalType.ENUM;
}
Expand Down Expand Up @@ -461,8 +478,12 @@ public int getScale() {
return scale;
}

/**
* API Should be considered private
*
* @return the original type
*/
@Override
@InterfaceAudience.Private
public OriginalType toOriginalType() {
return OriginalType.DECIMAL;
}
Expand Down Expand Up @@ -514,8 +535,12 @@ public static class DateLogicalTypeAnnotation extends LogicalTypeAnnotation {
private DateLogicalTypeAnnotation() {
}

/**
* API Should be considered private
*
* @return the original type
*/
@Override
@InterfaceAudience.Private
public OriginalType toOriginalType() {
return OriginalType.DATE;
}
Expand Down Expand Up @@ -562,8 +587,12 @@ private TimeLogicalTypeAnnotation(boolean isAdjustedToUTC, TimeUnit unit) {
this.unit = unit;
}

/**
* API Should be considered private
*
* @return the original type
*/
@Override
@InterfaceAudience.Private
public OriginalType toOriginalType() {
switch (unit) {
case MILLIS:
Expand Down Expand Up @@ -641,8 +670,12 @@ private TimestampLogicalTypeAnnotation(boolean isAdjustedToUTC, TimeUnit unit) {
this.unit = unit;
}

/**
* API Should be considered private
*
* @return the original type
*/
@Override
@InterfaceAudience.Private
public OriginalType toOriginalType() {
switch (unit) {
case MILLIS:
Expand Down Expand Up @@ -727,8 +760,12 @@ private IntLogicalTypeAnnotation(int bitWidth, boolean isSigned) {
this.isSigned = isSigned;
}

/**
* API Should be considered private
*
* @return the original type
*/
@Override
@InterfaceAudience.Private
public OriginalType toOriginalType() {
switch (bitWidth) {
case 8:
Expand Down Expand Up @@ -799,8 +836,12 @@ public static class JsonLogicalTypeAnnotation extends LogicalTypeAnnotation {
private JsonLogicalTypeAnnotation() {
}

/**
* API Should be considered private
*
* @return the original type
*/
@Override
@InterfaceAudience.Private
public OriginalType toOriginalType() {
return OriginalType.JSON;
}
Expand Down Expand Up @@ -838,8 +879,12 @@ public static class BsonLogicalTypeAnnotation extends LogicalTypeAnnotation {
private BsonLogicalTypeAnnotation() {
}

/**
* API Should be considered private
*
* @return the original type
*/
@Override
@InterfaceAudience.Private
public OriginalType toOriginalType() {
return OriginalType.BSON;
}
Expand Down Expand Up @@ -878,8 +923,12 @@ public static class UUIDLogicalTypeAnnotation extends LogicalTypeAnnotation {
private UUIDLogicalTypeAnnotation() {
}

/**
* API Should be considered private
*
* @return the original type
*/
@Override
@InterfaceAudience.Private
public OriginalType toOriginalType() {
// No OriginalType for UUID
return null;
Expand Down Expand Up @@ -914,8 +963,12 @@ public static LogicalTypeAnnotation getInstance() {
private IntervalLogicalTypeAnnotation() {
}

/**
* API Should be considered private
*
* @return the original type
*/
@Override
@InterfaceAudience.Private
public OriginalType toOriginalType() {
return OriginalType.INTERVAL;
}
Expand Down Expand Up @@ -965,8 +1018,12 @@ public static MapKeyValueTypeAnnotation getInstance() {
private MapKeyValueTypeAnnotation() {
}

/**
* API Should be considered private
*
* @return the original type
*/
@Override
@InterfaceAudience.Private
public OriginalType toOriginalType() {
return OriginalType.MAP_KEY_VALUE;
}
Expand Down
5 changes: 0 additions & 5 deletions parquet-hadoop/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,6 @@
<version>${net.openhft.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.yetus</groupId>
<artifactId>audience-annotations</artifactId>
<version>${yetus.audience-annotations.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@
import org.apache.parquet.io.ParquetEncodingException;
import org.apache.parquet.schema.MessageType;
import org.apache.parquet.bytes.ByteBufferAllocator;
import org.apache.yetus.audience.InterfaceAudience;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@InterfaceAudience.Private
/**
* Class should be considered private
*/
public class ColumnChunkPageWriteStore implements PageWriteStore, BloomFilterWriteStore {
private static final Logger LOG = LoggerFactory.getLogger(ColumnChunkPageWriteStore.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@
import org.apache.parquet.io.SeekableInputStream;
import org.apache.parquet.schema.MessageType;
import org.apache.parquet.schema.PrimitiveType;
import org.apache.yetus.audience.InterfaceAudience.Private;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -1384,13 +1383,13 @@ public BloomFilter readBloomFilter(ColumnChunkMetaData meta) throws IOException
}

/**
* @param column
* the column chunk which the column index is to be returned for
* Class should be considered private
*
* @param column the column chunk which the column index is to be returned for
*
* @return the column index for the specified column chunk or {@code null} if there is no index
* @throws IOException
* if any I/O error occurs during reading the file
* @throws IOException if any I/O error occurs during reading the file
*/
@Private
public ColumnIndex readColumnIndex(ColumnChunkMetaData column) throws IOException {
IndexReference ref = column.getColumnIndexReference();
if (ref == null) {
Expand All @@ -1413,13 +1412,12 @@ public ColumnIndex readColumnIndex(ColumnChunkMetaData column) throws IOExceptio
}

/**
* @param column
* the column chunk which the offset index is to be returned for
* Class should be considered private
*
* @param column the column chunk which the offset index is to be returned for
* @return the offset index for the specified column chunk or {@code null} if there is no index
* @throws IOException
* if any I/O error occurs during reading the file
* @throws IOException if any I/O error occurs during reading the file
*/
@Private
public OffsetIndex readOffsetIndex(ColumnChunkMetaData column) throws IOException {
IndexReference ref = column.getOffsetIndexReference();
if (ref == null) {
Expand Down
Loading

0 comments on commit 56f40e4

Please sign in to comment.