Skip to content

Commit

Permalink
* log-exporter: export action and event in parquet format
Browse files Browse the repository at this point in the history
Signed-off-by: neo <1100909+neowu@users.noreply.github.com>
  • Loading branch information
neowu committed Mar 4, 2025
1 parent b70deab commit a5fcf4c
Showing 1 changed file with 9 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,17 @@ public class ArchiveService {

public void uploadArchive(LocalDate date) throws IOException {
logger.info("uploading begin, date={}", date);
upload(localActionLogFilePath(date), remoteActionLogPath(date));
upload(localEventFilePath(date), remoteEventPath(date));
logger.info("uploading end, date={}", date);
}

Path actionLogFilePath = localActionLogFilePath(date);
if (exists(actionLogFilePath)) {
Path actionLogParquetFilePath = convertToParquet(actionLogFilePath);
String remoteActionLogPath = remoteActionLogPath(date);
uploadService.upload(actionLogParquetFilePath, remoteActionLogPath);
Files.delete(actionLogParquetFilePath);
}

Path eventFilePath = localEventFilePath(date);
if (exists(eventFilePath)) {
Path eventParquetFilePath = convertToParquet(actionLogFilePath);
String remoteEventPath = remoteEventPath(date);
uploadService.upload(eventParquetFilePath, remoteEventPath);
Files.delete(eventParquetFilePath);
private void upload(Path localFilePath, String remotePath) throws IOException {
if (exists(localFilePath)) {
Path parquetFilePath = convertToParquet(localFilePath);
uploadService.upload(parquetFilePath, remotePath);
Files.delete(parquetFilePath);
}

logger.info("uploading end, date={}", date);
}

Path convertToParquet(Path sourcePath) throws IOException {
Expand Down

0 comments on commit a5fcf4c

Please sign in to comment.