Skip to content

Commit

Permalink
Review followup, added links to create-scripts in javadoc for HBasePh…
Browse files Browse the repository at this point in the history
…oenix DAO classes
  • Loading branch information
Søren Vejrup Carlsen committed Jul 3, 2018
1 parent ea5a6bb commit 42fde39
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
import dk.kb.webdanica.core.utils.CloseUtils;
import dk.kb.webdanica.core.utils.DatabaseUtils;

/**
*
* See
* <a href="https://raw.githubusercontent.com/netarchivesuite/webdanica/master/scripts/hbase-phoenix/create_blacklists.sql">create-script for table blacklists</a>
*
*/
public class HBasePhoenixBlackListDAO implements BlackListDAO {

private static final String INSERT_SQL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,8 @@
import dk.kb.webdanica.core.utils.DatabaseUtils;

/**
* CREATE TABLE statecache (
* uuid BIGINT PRIMARY KEY,
* totalSeedsCount BIGINT,
* harvestCount BIGINT,
* totalCritResults BIGINT,
* seedStatusCounts VARCHAR[],
* seedDanicaStatusCounts VARCHAR[],
* last_updated TIMESTAMP
* );
*
* See <a href="https://raw.githubusercontent.com/netarchivesuite/webdanica/master/scripts/hbase-phoenix/create_statecache.sql">create-script for table statecache</a
*
*/
public class HBasePhoenixCacheDAO implements CacheDAO {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
import dk.kb.webdanica.core.datamodel.criteria.DataSource;
import dk.kb.webdanica.core.datamodel.criteria.SingleCriteriaResult;

/**
* See
* <a href="https://raw.githubusercontent.com/netarchivesuite/webdanica/master/scripts/hbase-phoenix/create_criteria_results.sql">create-script for table criteria_results</a>
*/
public class HBasePhoenixCriteriaResultsDAO implements CriteriaResultsDAO {

private static final Logger logger = Logger.getLogger(HBasePhoenixCriteriaResultsDAO.class.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
import dk.kb.webdanica.core.utils.CloseUtils;
import dk.kb.webdanica.core.utils.DatabaseUtils;

/**
* See <a href="https://raw.githubusercontent.com/netarchivesuite/webdanica/master/scripts/hbase-phoenix/create_domains.sql">create-script for table domains</a
*
*/
public class HBasePhoenixDomainsDAO implements DomainsDAO {

private static final String INSERT_SQL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
| | | HARVESTS | ANALYSIS_STATE_REASON | 12 | VARCHAR | null | null | null | null | 1 | | |
| | | HARVESTS | REPORTS | 2003
</pre>
* Should be identical with
* <a href="https://raw.githubusercontent.com/netarchivesuite/webdanica/master/scripts/hbase-phoenix/create_harvests.sql">create-script for table harvests</a
*/
public class HBasePhoenixHarvestDAO implements HarvestDAO {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
import dk.kb.webdanica.core.utils.CloseUtils;
import dk.kb.webdanica.core.utils.DatabaseUtils;

/**
*
* <a href="https://raw.githubusercontent.com/netarchivesuite/webdanica/master/scripts/hbase-phoenix/create_ingestlog.sql">create-script for table ingestlog</a
*
*/
public class HBasePhoenixIngestLogDAO implements IngestLogDAO {

private static final String INSERT_SQL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
import dk.kb.webdanica.core.datamodel.Status;
import dk.kb.webdanica.core.utils.CloseUtils;

/**
* See
* <a href="https://raw.githubusercontent.com/netarchivesuite/webdanica/master/scripts/hbase-phoenix/create_seeds.sql">create-script for table seeds</a>
*/
public class HBasePhoenixSeedsDAO implements SeedsDAO {

private static final String UPSERT_SQL;
Expand Down Expand Up @@ -464,6 +468,13 @@ public Long getDomainSeedsCount(String domain, Status status, DanicaStatus dstat
stm.clearParameters();
stm.setString(1, domain);
stm.setInt(2, dstatus.ordinal());
} else if (status != null && dstatus != null) {
stm = conn.prepareStatement(SEEDS_COUNT_BY_DOMAIN_AND_STATE_AND_DANICASTATE_SQL);
stm.clearParameters();
stm.clearParameters();
stm.setString(1, domain);
stm.setInt(2, status.ordinal());
stm.setInt(3, dstatus.ordinal());
} else {
stm = conn.prepareStatement(SEEDS_COUNT_BY_DOMAIN_SQL);
stm.clearParameters();
Expand Down

0 comments on commit 42fde39

Please sign in to comment.