-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #864 from uwescience/parallel-ingest-operator-for-…
…raco Pipeline Parallel Ingest
- Loading branch information
Showing
6 changed files
with
186 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/edu/washington/escience/myria/api/encoding/CSVFileScanFragmentEncoding.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package edu.washington.escience.myria.api.encoding; | ||
|
||
import java.util.Set; | ||
|
||
import edu.washington.escience.myria.CsvTupleReader; | ||
import edu.washington.escience.myria.api.encoding.QueryConstruct.ConstructArgs; | ||
import edu.washington.escience.myria.io.AmazonS3Source; | ||
import edu.washington.escience.myria.operator.CSVFileScanFragment; | ||
|
||
public class CSVFileScanFragmentEncoding extends LeafOperatorEncoding<CSVFileScanFragment> { | ||
|
||
@Required public CsvTupleReader reader; | ||
@Required public AmazonS3Source source; | ||
|
||
public Character delimiter; | ||
public Character quote; | ||
public Character escape; | ||
public Integer skip; | ||
|
||
public Set<Integer> workers; | ||
|
||
@Override | ||
public CSVFileScanFragment construct(ConstructArgs args) { | ||
/* Attempt to use all the workers if not specified */ | ||
if (workers == null) { | ||
workers = args.getServer().getAliveWorkers(); | ||
} | ||
|
||
/* Find workers */ | ||
int[] workersArray = | ||
args.getServer().parallelIngestComputeNumWorkers(source.getFileSize(), workers); | ||
|
||
return new CSVFileScanFragment( | ||
source, reader.getSchema(), workersArray, delimiter, quote, escape, skip); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters