@@ -92,12 +92,12 @@ public RowType valueType() {
9292
9393 @ VisibleForTesting
9494 public DataFilePathFactory pathFactory (int level ) {
95- return formatContext .pathFactory (new FormatKey (level , false ));
95+ return formatContext .pathFactory (new WriteFormatKey (level , false ));
9696 }
9797
9898 public RollingFileWriter <KeyValue , DataFileMeta > createRollingMergeTreeFileWriter (
9999 int level , FileSource fileSource ) {
100- FormatKey key = new FormatKey (level , false );
100+ WriteFormatKey key = new WriteFormatKey (level , false );
101101 return new RollingFileWriter <>(
102102 () -> {
103103 DataFilePathFactory pathFactory = formatContext .pathFactory (key );
@@ -108,7 +108,7 @@ public RollingFileWriter<KeyValue, DataFileMeta> createRollingMergeTreeFileWrite
108108 }
109109
110110 public RollingFileWriter <KeyValue , DataFileMeta > createRollingChangelogFileWriter (int level ) {
111- FormatKey key = new FormatKey (level , true );
111+ WriteFormatKey key = new WriteFormatKey (level , true );
112112 return new RollingFileWriter <>(
113113 () -> {
114114 DataFilePathFactory pathFactory = formatContext .pathFactory (key );
@@ -122,7 +122,7 @@ public RollingFileWriter<KeyValue, DataFileMeta> createRollingChangelogFileWrite
122122 }
123123
124124 private KeyValueDataFileWriter createDataFileWriter (
125- Path path , FormatKey key , FileSource fileSource , boolean isExternalPath ) {
125+ Path path , WriteFormatKey key , FileSource fileSource , boolean isExternalPath ) {
126126 return formatContext .thinModeEnabled
127127 ? new KeyValueThinDataFileWriterImpl (
128128 fileIO ,
@@ -154,17 +154,17 @@ private KeyValueDataFileWriter createDataFileWriter(
154154
155155 public void deleteFile (DataFileMeta file ) {
156156 fileIO .deleteQuietly (
157- formatContext .pathFactory (new FormatKey (file .level (), false )).toPath (file ));
157+ formatContext .pathFactory (new WriteFormatKey (file .level (), false )).toPath (file ));
158158 }
159159
160160 public void copyFile (DataFileMeta sourceFile , DataFileMeta targetFile ) throws IOException {
161161 Path sourcePath =
162162 formatContext
163- .pathFactory (new FormatKey (sourceFile .level (), false ))
163+ .pathFactory (new WriteFormatKey (sourceFile .level (), false ))
164164 .toPath (sourceFile );
165165 Path targetPath =
166166 formatContext
167- .pathFactory (new FormatKey (targetFile .level (), false ))
167+ .pathFactory (new WriteFormatKey (targetFile .level (), false ))
168168 .toPath (targetFile );
169169 fileIO .copyFile (sourcePath , targetPath , true );
170170 }
@@ -174,7 +174,7 @@ public FileIO getFileIO() {
174174 }
175175
176176 public String newChangelogFileName (int level ) {
177- return formatContext .pathFactory (new FormatKey (level , true )).newChangelogFileName ();
177+ return formatContext .pathFactory (new WriteFormatKey (level , true )).newChangelogFileName ();
178178 }
179179
180180 public static Builder builder (
@@ -241,9 +241,9 @@ public KeyValueFileWriterFactory build(
241241
242242 private static class FileWriterContextFactory {
243243
244- private final Function <FormatKey , String > key2Format ;
245- private final Function <FormatKey , String > key2Compress ;
246- private final Function <FormatKey , String > key2Stats ;
244+ private final Function <WriteFormatKey , String > key2Format ;
245+ private final Function <WriteFormatKey , String > key2Compress ;
246+ private final Function <WriteFormatKey , String > key2Stats ;
247247
248248 private final Map <Pair <String , String >, Optional <SimpleStatsExtractor >>
249249 formatStats2Extractor ;
@@ -335,12 +335,12 @@ private boolean supportsThinMode(RowType keyType, RowType valueType) {
335335 return true ;
336336 }
337337
338- private FileWriterContext fileWriterContext (FormatKey key ) {
338+ private FileWriterContext fileWriterContext (WriteFormatKey key ) {
339339 return new FileWriterContext (
340340 writerFactory (key ), statsProducer (key ), key2Compress .apply (key ));
341341 }
342342
343- private SimpleStatsProducer statsProducer (FormatKey key ) {
343+ private SimpleStatsProducer statsProducer (WriteFormatKey key ) {
344344 String format = key2Format .apply (key );
345345 String statsMode = key2Stats .apply (key );
346346 if (format .equals ("avro" )) {
@@ -380,7 +380,7 @@ private Optional<SimpleStatsExtractor> createSimpleStatsExtractor(
380380 return fileFormat (format ).createStatsExtractor (writeRowType , statsFactories );
381381 }
382382
383- private DataFilePathFactory pathFactory (FormatKey key ) {
383+ private DataFilePathFactory pathFactory (WriteFormatKey key ) {
384384 String format = key2Format .apply (key );
385385 return format2PathFactory .computeIfAbsent (
386386 format ,
@@ -390,7 +390,7 @@ private DataFilePathFactory pathFactory(FormatKey key) {
390390 .createDataFilePathFactory (partition , bucket ));
391391 }
392392
393- private FormatWriterFactory writerFactory (FormatKey key ) {
393+ private FormatWriterFactory writerFactory (WriteFormatKey key ) {
394394 return format2WriterFactory .computeIfAbsent (
395395 key2Format .apply (key ),
396396 format -> fileFormat (format ).createWriterFactory (writeRowType ));
@@ -402,12 +402,12 @@ private FileFormat fileFormat(String format) {
402402 }
403403 }
404404
405- private static class FormatKey {
405+ private static class WriteFormatKey {
406406
407407 private final int level ;
408408 private final boolean isChangelog ;
409409
410- private FormatKey (int level , boolean isChangelog ) {
410+ private WriteFormatKey (int level , boolean isChangelog ) {
411411 this .level = level ;
412412 this .isChangelog = isChangelog ;
413413 }
@@ -417,7 +417,7 @@ public boolean equals(Object o) {
417417 if (o == null || getClass () != o .getClass ()) {
418418 return false ;
419419 }
420- FormatKey formatKey = (FormatKey ) o ;
420+ WriteFormatKey formatKey = (WriteFormatKey ) o ;
421421 return level == formatKey .level && isChangelog == formatKey .isChangelog ;
422422 }
423423
0 commit comments