diff --git a/gbif/ingestion/ingest-gbif-fragmenter/src/main/java/org/gbif/pipelines/fragmenter/FragmentPersister.java b/gbif/ingestion/ingest-gbif-fragmenter/src/main/java/org/gbif/pipelines/fragmenter/FragmentPersister.java index 1ddfacc73..e4e055251 100644 --- a/gbif/ingestion/ingest-gbif-fragmenter/src/main/java/org/gbif/pipelines/fragmenter/FragmentPersister.java +++ b/gbif/ingestion/ingest-gbif-fragmenter/src/main/java/org/gbif/pipelines/fragmenter/FragmentPersister.java @@ -26,9 +26,7 @@ import org.gbif.pipelines.fragmenter.common.HbaseStore; import org.gbif.pipelines.fragmenter.common.RawRecord; import org.gbif.pipelines.fragmenter.record.OccurrenceRecordConverter; -import org.gbif.pipelines.fragmenter.strategy.DwcaStrategy; import org.gbif.pipelines.fragmenter.strategy.Strategy; -import org.gbif.pipelines.fragmenter.strategy.XmlStrategy; import org.gbif.pipelines.keygen.HBaseLockingKeyService; import org.gbif.pipelines.keygen.OccurrenceRecord; import org.gbif.pipelines.keygen.common.HbaseConnectionFactory; @@ -92,14 +90,6 @@ public class FragmentPersister { private Connection hbaseConnection; - public static FragmentPersisterBuilder xmlBuilder() { - return FragmentPersister.builder().strategy(XmlStrategy.create()); - } - - public static FragmentPersisterBuilder dwcaBuilder() { - return FragmentPersister.builder().strategy(DwcaStrategy.create()); - } - @SneakyThrows public long persist() { diff --git a/gbif/ingestion/ingest-gbif-fragmenter/src/test/java/org/gbif/pipelines/fragmenter/FragmentPersisterIT.java b/gbif/ingestion/ingest-gbif-fragmenter/src/test/java/org/gbif/pipelines/fragmenter/FragmentPersisterIT.java index cdd0976b9..3edd8a814 100644 --- a/gbif/ingestion/ingest-gbif-fragmenter/src/test/java/org/gbif/pipelines/fragmenter/FragmentPersisterIT.java +++ b/gbif/ingestion/ingest-gbif-fragmenter/src/test/java/org/gbif/pipelines/fragmenter/FragmentPersisterIT.java @@ -7,6 +7,8 @@ import org.gbif.api.vocabulary.EndpointType; import org.gbif.pipelines.fragmenter.common.HbaseServer; import org.gbif.pipelines.fragmenter.common.TableAssert; +import org.gbif.pipelines.fragmenter.strategy.DwcaStrategy; +import org.gbif.pipelines.fragmenter.strategy.XmlStrategy; import org.junit.Assert; import org.junit.Before; import org.junit.ClassRule; @@ -47,7 +49,8 @@ public void dwcaDwcaZipSyncUploadTest() throws IOException { // When long result = - FragmentPersister.dwcaBuilder() + FragmentPersister.builder() + .strategy(DwcaStrategy.create()) .tableName(HbaseServer.FRAGMENT_TABLE_NAME) .keygenConfig(HbaseServer.CFG) .pathToArchive(regularZipDwca) @@ -77,7 +80,8 @@ public void dwcaSyncUploadTest() throws IOException { // When long result = - FragmentPersister.dwcaBuilder() + FragmentPersister.builder() + .strategy(DwcaStrategy.create()) .tableName(HbaseServer.FRAGMENT_TABLE_NAME) .keygenConfig(HbaseServer.CFG) .pathToArchive(regularDwca) @@ -107,7 +111,8 @@ public void dwcaAsyncUploadTest() throws IOException { // When long result = - FragmentPersister.dwcaBuilder() + FragmentPersister.builder() + .strategy(DwcaStrategy.create()) .tableName(HbaseServer.FRAGMENT_TABLE_NAME) .keygenConfig(HbaseServer.CFG) .pathToArchive(regularDwca) @@ -140,7 +145,8 @@ public void dwcaSyncUpdateUploadTest() throws IOException { // When long resultFirst = - FragmentPersister.dwcaBuilder() + FragmentPersister.builder() + .strategy(DwcaStrategy.create()) .tableName(HbaseServer.FRAGMENT_TABLE_NAME) .keygenConfig(HbaseServer.CFG) .pathToArchive(regularDwca) @@ -156,7 +162,8 @@ public void dwcaSyncUpdateUploadTest() throws IOException { .persist(); long resultSecond = - FragmentPersister.dwcaBuilder() + FragmentPersister.builder() + .strategy(DwcaStrategy.create()) .tableName(HbaseServer.FRAGMENT_TABLE_NAME) .keygenConfig(HbaseServer.CFG) .pathToArchive(regularUpdatedDwca) @@ -193,7 +200,8 @@ public void dwcaAsyncUpdateUploadTest() throws IOException { // When long resultFirst = - FragmentPersister.dwcaBuilder() + FragmentPersister.builder() + .strategy(DwcaStrategy.create()) .tableName(HbaseServer.FRAGMENT_TABLE_NAME) .keygenConfig(HbaseServer.CFG) .pathToArchive(regularDwca) @@ -210,7 +218,8 @@ public void dwcaAsyncUpdateUploadTest() throws IOException { .persist(); long resultSecond = - FragmentPersister.dwcaBuilder() + FragmentPersister.builder() + .strategy(DwcaStrategy.create()) .tableName(HbaseServer.FRAGMENT_TABLE_NAME) .keygenConfig(HbaseServer.CFG) .pathToArchive(regularUpdatedDwca) @@ -248,7 +257,8 @@ public void dwcaOccExtSyncUploadTest() throws IOException { // When long result = - FragmentPersister.dwcaBuilder() + FragmentPersister.builder() + .strategy(DwcaStrategy.create()) .tableName(HbaseServer.FRAGMENT_TABLE_NAME) .keygenConfig(HbaseServer.CFG) .pathToArchive(occurrenceAsExtensionDwca) @@ -278,7 +288,8 @@ public void dwcaOccExtAsyncUploadTest() throws IOException { // When long result = - FragmentPersister.dwcaBuilder() + FragmentPersister.builder() + .strategy(DwcaStrategy.create()) .tableName(HbaseServer.FRAGMENT_TABLE_NAME) .keygenConfig(HbaseServer.CFG) .pathToArchive(occurrenceAsExtensionDwca) @@ -310,7 +321,8 @@ public void dwcaMultimediaSyncUploadTest() throws IOException { // When long result = - FragmentPersister.dwcaBuilder() + FragmentPersister.builder() + .strategy(DwcaStrategy.create()) .tableName(HbaseServer.FRAGMENT_TABLE_NAME) .keygenConfig(HbaseServer.CFG) .pathToArchive(multimediaExtensionDwca) @@ -340,7 +352,8 @@ public void dwcaMultimediaAsyncUploadTest() throws IOException { // When long result = - FragmentPersister.dwcaBuilder() + FragmentPersister.builder() + .strategy(DwcaStrategy.create()) .tableName(HbaseServer.FRAGMENT_TABLE_NAME) .keygenConfig(HbaseServer.CFG) .pathToArchive(multimediaExtensionDwca) @@ -373,7 +386,8 @@ public void xmlSyncUploadTest() throws IOException { // When long result = - FragmentPersister.xmlBuilder() + FragmentPersister.builder() + .strategy(XmlStrategy.create()) .tableName(HbaseServer.FRAGMENT_TABLE_NAME) .keygenConfig(HbaseServer.CFG) .pathToArchive(xmlArchivePath) @@ -403,7 +417,8 @@ public void xmlAsyncUploadTest() throws IOException { // When long result = - FragmentPersister.xmlBuilder() + FragmentPersister.builder() + .strategy(XmlStrategy.create()) .tableName(HbaseServer.FRAGMENT_TABLE_NAME) .keygenConfig(HbaseServer.CFG) .pathToArchive(xmlArchivePath) @@ -435,7 +450,8 @@ public void xmlSyncDoubeUploadTest() throws IOException { // When long resultFirst = - FragmentPersister.xmlBuilder() + FragmentPersister.builder() + .strategy(XmlStrategy.create()) .tableName(HbaseServer.FRAGMENT_TABLE_NAME) .keygenConfig(HbaseServer.CFG) .pathToArchive(xmlArchivePath) @@ -451,7 +467,8 @@ public void xmlSyncDoubeUploadTest() throws IOException { .persist(); long resultSecond = - FragmentPersister.xmlBuilder() + FragmentPersister.builder() + .strategy(XmlStrategy.create()) .tableName(HbaseServer.FRAGMENT_TABLE_NAME) .keygenConfig(HbaseServer.CFG) .pathToArchive(xmlArchivePath) @@ -488,7 +505,8 @@ public void xmlAsyncDoubeUploadTest() throws IOException { // When long resultFirst = - FragmentPersister.xmlBuilder() + FragmentPersister.builder() + .strategy(XmlStrategy.create()) .tableName(HbaseServer.FRAGMENT_TABLE_NAME) .keygenConfig(HbaseServer.CFG) .pathToArchive(xmlArchivePath) @@ -505,7 +523,8 @@ public void xmlAsyncDoubeUploadTest() throws IOException { .persist(); long resultSecond = - FragmentPersister.xmlBuilder() + FragmentPersister.builder() + .strategy(XmlStrategy.create()) .tableName(HbaseServer.FRAGMENT_TABLE_NAME) .keygenConfig(HbaseServer.CFG) .pathToArchive(xmlArchivePath)