-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ALS-4978: Changes to optionally support remote genomic processing
- Loading branch information
Showing
10 changed files
with
393 additions
and
111 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
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
41 changes: 41 additions & 0 deletions
41
...g/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/GenomicProcessorConfig.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,41 @@ | ||
package edu.harvard.hms.dbmi.avillach.hpds.processing; | ||
|
||
import edu.harvard.hms.dbmi.avillach.hpds.processing.genomic.GenomicProcessorRestClient; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.PropertySource; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@SpringBootApplication | ||
@PropertySource("classpath:application.properties") | ||
public class GenomicProcessorConfig { | ||
|
||
@Value("${HPDS_GENOMIC_DATA_DIRECTORY:/opt/local/hpds/all/}") | ||
private String hpdsGenomicDataDirectory; | ||
|
||
|
||
@Bean(name = "localGenomicProcessor") | ||
@ConditionalOnProperty(prefix = "hpds.genomicProcessor", name = "impl", havingValue = "local") | ||
public GenomicProcessor localGenomicProcessor() { | ||
// todo: make sure this is set as default | ||
//System.getProperty("HPDS_GENOMIC_DATA_DIRECTORY", "/opt/local/hpds/all/"); | ||
return new GenomicProcessorNodeImpl(hpdsGenomicDataDirectory); | ||
} | ||
|
||
@Bean(name = "remoteGenomicProcessor") | ||
@ConditionalOnProperty(prefix = "hpds.genomicProcessor", name = "impl", havingValue = "remote") | ||
public GenomicProcessor remoteGenomicProcessor() { | ||
// Just for testing, for now, move to a configuration file or something | ||
List<GenomicProcessor> nodes = new ArrayList<>(); | ||
String[] hosts = new String[] {"http://localhost:8090/", "http://localhost:8091/"}; | ||
nodes = List.of( | ||
new GenomicProcessorRestClient(hosts[0]), | ||
new GenomicProcessorRestClient(hosts[1]) | ||
); | ||
return new GenomicProcessorParentImpl(nodes); | ||
} | ||
} |
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
Oops, something went wrong.