Skip to content

Commit 4caff8b

Browse files
committed
Remove deprecated constructor of GenericManifestFile
1 parent 92b5ef3 commit 4caff8b

File tree

8 files changed

+36
-149
lines changed

8 files changed

+36
-149
lines changed

.palantir/revapi.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,6 +1216,12 @@ acceptedBreaks:
12161216
old: "method org.apache.iceberg.UpdateStatistics org.apache.iceberg.SetStatistics::setStatistics(long,\
12171217
\ org.apache.iceberg.StatisticsFile)"
12181218
justification: "Removing deprecated code"
1219+
- code: "java.method.removed"
1220+
old: "method void org.apache.iceberg.GenericManifestFile::<init>(java.lang.String,\
1221+
\ long, int, org.apache.iceberg.ManifestContent, long, long, java.lang.Long,\
1222+
\ int, long, int, long, int, long, java.util.List<org.apache.iceberg.ManifestFile.PartitionFieldSummary>,\
1223+
\ java.nio.ByteBuffer)"
1224+
justification: "Removing deprecations for 1.10.0"
12191225
- code: "java.method.removed"
12201226
old: "method void org.apache.iceberg.MetadataUpdate.AddSchema::<init>(org.apache.iceberg.Schema,\
12211227
\ int)"

core/src/main/java/org/apache/iceberg/GenericManifestFile.java

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -134,47 +134,6 @@ public GenericManifestFile(Schema avroSchema) {
134134
this.firstRowId = firstRowId;
135135
}
136136

137-
/**
138-
* GenericManifestFile constructor.
139-
*
140-
* @deprecated will be removed in 1.10.0; use {@link ManifestWriter#toManifestFile()} instead.
141-
*/
142-
@Deprecated
143-
public GenericManifestFile(
144-
String path,
145-
long length,
146-
int specId,
147-
ManifestContent content,
148-
long sequenceNumber,
149-
long minSequenceNumber,
150-
Long snapshotId,
151-
int addedFilesCount,
152-
long addedRowsCount,
153-
int existingFilesCount,
154-
long existingRowsCount,
155-
int deletedFilesCount,
156-
long deletedRowsCount,
157-
List<PartitionFieldSummary> partitions,
158-
ByteBuffer keyMetadata) {
159-
super(ManifestFile.schema().columns().size());
160-
this.avroSchema = AVRO_SCHEMA;
161-
this.manifestPath = path;
162-
this.length = length;
163-
this.specId = specId;
164-
this.content = content;
165-
this.sequenceNumber = sequenceNumber;
166-
this.minSequenceNumber = minSequenceNumber;
167-
this.snapshotId = snapshotId;
168-
this.addedFilesCount = addedFilesCount;
169-
this.addedRowsCount = addedRowsCount;
170-
this.existingFilesCount = existingFilesCount;
171-
this.existingRowsCount = existingRowsCount;
172-
this.deletedFilesCount = deletedFilesCount;
173-
this.deletedRowsCount = deletedRowsCount;
174-
this.partitions = partitions == null ? null : partitions.toArray(new PartitionFieldSummary[0]);
175-
this.keyMetadata = ByteBuffers.toByteArray(keyMetadata);
176-
}
177-
178137
/**
179138
* Copy constructor.
180139
*

flink/v1.19/flink/src/test/java/org/apache/iceberg/flink/sink/TestIcebergCommitter.java

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,8 @@
6666
import org.apache.iceberg.DataFiles;
6767
import org.apache.iceberg.DeleteFile;
6868
import org.apache.iceberg.FileFormat;
69-
import org.apache.iceberg.GenericManifestFile;
70-
import org.apache.iceberg.ManifestContent;
7169
import org.apache.iceberg.ManifestFile;
70+
import org.apache.iceberg.ManifestFiles;
7271
import org.apache.iceberg.Metrics;
7372
import org.apache.iceberg.Parameter;
7473
import org.apache.iceberg.ParameterizedTestExtension;
@@ -1166,22 +1165,10 @@ public void testDeleteFiles() throws Exception {
11661165
}
11671166

11681167
private ManifestFile createTestingManifestFile(Path manifestPath) {
1169-
return new GenericManifestFile(
1170-
manifestPath.toAbsolutePath().toString(),
1171-
manifestPath.toFile().length(),
1172-
0,
1173-
ManifestContent.DATA,
1174-
0,
1175-
0,
1176-
0L,
1177-
0,
1178-
0,
1179-
0,
1180-
0,
1181-
0,
1182-
0,
1183-
null,
1184-
null);
1168+
return ManifestFiles.write(
1169+
PartitionSpec.unpartitioned(),
1170+
org.apache.iceberg.Files.localOutput(manifestPath.toFile()))
1171+
.toManifestFile();
11851172
}
11861173

11871174
private IcebergWriteAggregator buildIcebergWriteAggregator(String myJobId, String operatorId) {

flink/v1.19/flink/src/test/java/org/apache/iceberg/flink/sink/TestIcebergFilesCommitter.java

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,8 @@
5555
import org.apache.iceberg.DataFile;
5656
import org.apache.iceberg.DeleteFile;
5757
import org.apache.iceberg.FileFormat;
58-
import org.apache.iceberg.GenericManifestFile;
59-
import org.apache.iceberg.ManifestContent;
6058
import org.apache.iceberg.ManifestFile;
59+
import org.apache.iceberg.ManifestFiles;
6160
import org.apache.iceberg.Parameter;
6261
import org.apache.iceberg.ParameterizedTestExtension;
6362
import org.apache.iceberg.Parameters;
@@ -1120,22 +1119,10 @@ private FileAppenderFactory<RowData> createDeletableAppenderFactory() {
11201119
}
11211120

11221121
private ManifestFile createTestingManifestFile(Path manifestPath) {
1123-
return new GenericManifestFile(
1124-
manifestPath.toAbsolutePath().toString(),
1125-
manifestPath.toFile().length(),
1126-
0,
1127-
ManifestContent.DATA,
1128-
0,
1129-
0,
1130-
0L,
1131-
0,
1132-
0,
1133-
0,
1134-
0,
1135-
0,
1136-
0,
1137-
null,
1138-
null);
1122+
return ManifestFiles.write(
1123+
PartitionSpec.unpartitioned(),
1124+
org.apache.iceberg.Files.localOutput(manifestPath.toFile()))
1125+
.toManifestFile();
11391126
}
11401127

11411128
private List<Path> assertFlinkManifests(int expectedCount) throws IOException {

flink/v1.20/flink/src/test/java/org/apache/iceberg/flink/sink/TestIcebergCommitter.java

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,8 @@
6666
import org.apache.iceberg.DataFiles;
6767
import org.apache.iceberg.DeleteFile;
6868
import org.apache.iceberg.FileFormat;
69-
import org.apache.iceberg.GenericManifestFile;
70-
import org.apache.iceberg.ManifestContent;
7169
import org.apache.iceberg.ManifestFile;
70+
import org.apache.iceberg.ManifestFiles;
7271
import org.apache.iceberg.Metrics;
7372
import org.apache.iceberg.Parameter;
7473
import org.apache.iceberg.ParameterizedTestExtension;
@@ -1165,22 +1164,10 @@ public void testDeleteFiles() throws Exception {
11651164
}
11661165

11671166
private ManifestFile createTestingManifestFile(Path manifestPath) {
1168-
return new GenericManifestFile(
1169-
manifestPath.toAbsolutePath().toString(),
1170-
manifestPath.toFile().length(),
1171-
0,
1172-
ManifestContent.DATA,
1173-
0,
1174-
0,
1175-
0L,
1176-
0,
1177-
0,
1178-
0,
1179-
0,
1180-
0,
1181-
0,
1182-
null,
1183-
null);
1167+
return ManifestFiles.write(
1168+
PartitionSpec.unpartitioned(),
1169+
org.apache.iceberg.Files.localOutput(manifestPath.toFile()))
1170+
.toManifestFile();
11841171
}
11851172

11861173
private IcebergWriteAggregator buildIcebergWriteAggregator(String myJobId, String operatorId) {

flink/v1.20/flink/src/test/java/org/apache/iceberg/flink/sink/TestIcebergFilesCommitter.java

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,8 @@
5555
import org.apache.iceberg.DataFile;
5656
import org.apache.iceberg.DeleteFile;
5757
import org.apache.iceberg.FileFormat;
58-
import org.apache.iceberg.GenericManifestFile;
59-
import org.apache.iceberg.ManifestContent;
6058
import org.apache.iceberg.ManifestFile;
59+
import org.apache.iceberg.ManifestFiles;
6160
import org.apache.iceberg.Parameter;
6261
import org.apache.iceberg.ParameterizedTestExtension;
6362
import org.apache.iceberg.Parameters;
@@ -1120,22 +1119,10 @@ private FileAppenderFactory<RowData> createDeletableAppenderFactory() {
11201119
}
11211120

11221121
private ManifestFile createTestingManifestFile(Path manifestPath) {
1123-
return new GenericManifestFile(
1124-
manifestPath.toAbsolutePath().toString(),
1125-
manifestPath.toFile().length(),
1126-
0,
1127-
ManifestContent.DATA,
1128-
0,
1129-
0,
1130-
0L,
1131-
0,
1132-
0,
1133-
0,
1134-
0,
1135-
0,
1136-
0,
1137-
null,
1138-
null);
1122+
return ManifestFiles.write(
1123+
PartitionSpec.unpartitioned(),
1124+
org.apache.iceberg.Files.localOutput(manifestPath.toFile()))
1125+
.toManifestFile();
11391126
}
11401127

11411128
private List<Path> assertFlinkManifests(int expectedCount) throws IOException {

flink/v2.0/flink/src/test/java/org/apache/iceberg/flink/sink/TestIcebergCommitter.java

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,8 @@
6666
import org.apache.iceberg.DataFiles;
6767
import org.apache.iceberg.DeleteFile;
6868
import org.apache.iceberg.FileFormat;
69-
import org.apache.iceberg.GenericManifestFile;
70-
import org.apache.iceberg.ManifestContent;
7169
import org.apache.iceberg.ManifestFile;
70+
import org.apache.iceberg.ManifestFiles;
7271
import org.apache.iceberg.Metrics;
7372
import org.apache.iceberg.Parameter;
7473
import org.apache.iceberg.ParameterizedTestExtension;
@@ -1155,22 +1154,10 @@ public void testDeleteFiles() throws Exception {
11551154
}
11561155

11571156
private ManifestFile createTestingManifestFile(Path manifestPath) {
1158-
return new GenericManifestFile(
1159-
manifestPath.toAbsolutePath().toString(),
1160-
manifestPath.toFile().length(),
1161-
0,
1162-
ManifestContent.DATA,
1163-
0,
1164-
0,
1165-
0L,
1166-
0,
1167-
0,
1168-
0,
1169-
0,
1170-
0,
1171-
0,
1172-
null,
1173-
null);
1157+
return ManifestFiles.write(
1158+
PartitionSpec.unpartitioned(),
1159+
org.apache.iceberg.Files.localOutput(manifestPath.toFile()))
1160+
.toManifestFile();
11741161
}
11751162

11761163
private IcebergWriteAggregator buildIcebergWriteAggregator(String myJobId, String operatorId) {

flink/v2.0/flink/src/test/java/org/apache/iceberg/flink/sink/TestIcebergFilesCommitter.java

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,8 @@
5555
import org.apache.iceberg.DataFile;
5656
import org.apache.iceberg.DeleteFile;
5757
import org.apache.iceberg.FileFormat;
58-
import org.apache.iceberg.GenericManifestFile;
59-
import org.apache.iceberg.ManifestContent;
6058
import org.apache.iceberg.ManifestFile;
59+
import org.apache.iceberg.ManifestFiles;
6160
import org.apache.iceberg.Parameter;
6261
import org.apache.iceberg.ParameterizedTestExtension;
6362
import org.apache.iceberg.Parameters;
@@ -1120,22 +1119,10 @@ private FileAppenderFactory<RowData> createDeletableAppenderFactory() {
11201119
}
11211120

11221121
private ManifestFile createTestingManifestFile(Path manifestPath) {
1123-
return new GenericManifestFile(
1124-
manifestPath.toAbsolutePath().toString(),
1125-
manifestPath.toFile().length(),
1126-
0,
1127-
ManifestContent.DATA,
1128-
0,
1129-
0,
1130-
0L,
1131-
0,
1132-
0,
1133-
0,
1134-
0,
1135-
0,
1136-
0,
1137-
null,
1138-
null);
1122+
return ManifestFiles.write(
1123+
PartitionSpec.unpartitioned(),
1124+
org.apache.iceberg.Files.localOutput(manifestPath.toFile()))
1125+
.toManifestFile();
11391126
}
11401127

11411128
private List<Path> assertFlinkManifests(int expectedCount) throws IOException {

0 commit comments

Comments
 (0)