Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ALS-6511: Add PFB result type #116

Merged
merged 23 commits into from
Aug 19, 2024
Merged

ALS-6511: Add PFB result type #116

merged 23 commits into from
Aug 19, 2024

Conversation

ramari16
Copy link
Contributor

No description provided.

@ramari16 ramari16 added the enhancement New feature or request label Aug 12, 2024
@@ -17,7 +23,19 @@
public class AsyncResult implements Runnable, Comparable<AsyncResult>{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class was a huge pain. I tried to improve it but I'm not super happy with how this turned out. But at least this supports multi value exporting, to some degree

import java.util.stream.Stream;

@Component
public class PfbProcessor implements HpdsProcessor {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is somewhat similar to the QueryProcessor which generates the CSVs, but since PFB needs to write row by row, we batch the rows and then transform the column-based data to row based data before writing

import org.apache.commons.csv.CSVPrinter;
import org.apache.commons.csv.CSVRecord;

import de.siegmar.fastcsv.writer.CsvWriter;
import edu.harvard.hms.dbmi.avillach.hpds.data.phenotype.ColumnMeta;

public class ResultStoreStream extends InputStream {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of these changes are removing an obsolete concept that was no longer in use. The important part is making the writer more generic

import java.util.*;
import java.util.stream.Collectors;

public class PfbWriter implements ResultWriter {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the class responsible for creating the PFB file, using Java's avro library

@ramari16 ramari16 merged commit 1cdfd3e into genomic-v2 Aug 19, 2024
3 checks passed
@ramari16 ramari16 deleted the ALS-6511 branch August 19, 2024 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants