@@ -40,24 +40,17 @@ public class ArchiveService {
4040
4141 public void uploadArchive (LocalDate date ) throws IOException {
4242 logger .info ("uploading begin, date={}" , date );
43+ upload (localActionLogFilePath (date ), remoteActionLogPath (date ));
44+ upload (localEventFilePath (date ), remoteEventPath (date ));
45+ logger .info ("uploading end, date={}" , date );
46+ }
4347
44- Path actionLogFilePath = localActionLogFilePath (date );
45- if (exists (actionLogFilePath )) {
46- Path actionLogParquetFilePath = convertToParquet (actionLogFilePath );
47- String remoteActionLogPath = remoteActionLogPath (date );
48- uploadService .upload (actionLogParquetFilePath , remoteActionLogPath );
49- Files .delete (actionLogParquetFilePath );
50- }
51-
52- Path eventFilePath = localEventFilePath (date );
53- if (exists (eventFilePath )) {
54- Path eventParquetFilePath = convertToParquet (actionLogFilePath );
55- String remoteEventPath = remoteEventPath (date );
56- uploadService .upload (eventParquetFilePath , remoteEventPath );
57- Files .delete (eventParquetFilePath );
48+ private void upload (Path localFilePath , String remotePath ) throws IOException {
49+ if (exists (localFilePath )) {
50+ Path parquetFilePath = convertToParquet (localFilePath );
51+ uploadService .upload (parquetFilePath , remotePath );
52+ Files .delete (parquetFilePath );
5853 }
59-
60- logger .info ("uploading end, date={}" , date );
6154 }
6255
6356 Path convertToParquet (Path sourcePath ) throws IOException {
0 commit comments