forked from gbif/pipelines
-
Notifications
You must be signed in to change notification settings - Fork 0
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 gbif#314 from gbif/gbif-dev
Gbif dev
- Loading branch information
Showing
11 changed files
with
65 additions
and
64 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
37 changes: 37 additions & 0 deletions
37
...es/ingest-gbif-java/src/main/java/org/gbif/pipelines/ingest/java/utils/ConfigFactory.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,37 @@ | ||
package org.gbif.pipelines.ingest.java.utils; | ||
|
||
import org.gbif.pipelines.ingest.utils.FsUtils; | ||
|
||
import lombok.SneakyThrows; | ||
import lombok.extern.slf4j.Slf4j; | ||
|
||
@Slf4j | ||
@SuppressWarnings("all") | ||
public class ConfigFactory<T> { | ||
|
||
private static volatile ConfigFactory instance; | ||
|
||
private final T config; | ||
|
||
private static final Object MUTEX = new Object(); | ||
|
||
@SneakyThrows | ||
private ConfigFactory(String hdfsSiteConfig, String propertiesPath, Class<T> clazz) { | ||
this.config = FsUtils.readConfigFile(hdfsSiteConfig, propertiesPath, clazz); | ||
} | ||
|
||
public static <T> ConfigFactory<T> getInstance(String hdfsSiteConfig, String propertiesPath, Class<T> clazz) { | ||
if (instance == null) { | ||
synchronized (MUTEX) { | ||
if (instance == null) { | ||
instance = new ConfigFactory(hdfsSiteConfig, propertiesPath, clazz); | ||
} | ||
} | ||
} | ||
return instance; | ||
} | ||
|
||
public T get() { | ||
return config; | ||
} | ||
} |
37 changes: 0 additions & 37 deletions
37
...-gbif-java/src/main/java/org/gbif/pipelines/ingest/java/utils/PipelinesConfigFactory.java
This file was deleted.
Oops, something went wrong.
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
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