Skip to content

Commit

Permalink
issue #3676 drop db2 support - initial code removal
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Arnold <robin.arnold@ibm.com>
  • Loading branch information
punktilious committed Jul 20, 2022
1 parent 0f1db0a commit 2da2031
Show file tree
Hide file tree
Showing 63 changed files with 121 additions and 5,258 deletions.
30 changes: 0 additions & 30 deletions fhir-bucket/src/main/java/com/ibm/fhir/bucket/app/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@
import com.ibm.fhir.database.utils.api.UniqueConstraintViolationException;
import com.ibm.fhir.database.utils.common.JdbcConnectionProvider;
import com.ibm.fhir.database.utils.common.PlainSchemaAdapter;
import com.ibm.fhir.database.utils.db2.Db2Adapter;
import com.ibm.fhir.database.utils.db2.Db2PropertyAdapter;
import com.ibm.fhir.database.utils.db2.Db2Translator;
import com.ibm.fhir.database.utils.derby.DerbyAdapter;
import com.ibm.fhir.database.utils.derby.DerbyPropertyAdapter;
import com.ibm.fhir.database.utils.derby.DerbyTranslator;
Expand Down Expand Up @@ -644,9 +641,6 @@ public void configure() {
// if we're only running the client-load or reindex helper modes
if (this.dbType != null) {
switch (this.dbType) {
case DB2:
setupDb2Repository();
break;
case DERBY:
setupDerbyRepository();
break;
Expand Down Expand Up @@ -686,30 +680,6 @@ public void setupDerbyRepository() {
this.transactionProvider = new SimpleTransactionProvider(connectionPool);
}

/**
* Set up the connection pool and transaction provider for connecting to a DB2
* database
*/
public void setupDb2Repository() {
if (schemaName == null) {
schemaName = DEFAULT_SCHEMA_NAME;
}

this.translator = new Db2Translator();
try {
Class.forName(translator.getDriverClassName());
} catch (ClassNotFoundException e) {
throw new IllegalStateException(e);
}

Db2PropertyAdapter propertyAdapter = new Db2PropertyAdapter(dbProperties);
IConnectionProvider cp = new JdbcConnectionProvider(translator, propertyAdapter);
this.connectionPool = new PoolConnectionProvider(cp, connectionPoolSize);
this.adapter = new Db2Adapter(connectionPool);
this.schemaAdapter = new PlainSchemaAdapter(adapter);
this.transactionProvider = new SimpleTransactionProvider(connectionPool);
}

/**
* Set up the connection pool and transaction provider for connecting to a DB2
* database
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@
/**
* The flavor of database schema
* PLAIN - the schema we typically deploy to Derby or PostgreSQL
* MULTITENANT - on Db2 supporting multiple tenants using partitioning and RBAC
* DISTRIBUTED - for use with distributed technologies like Citus DB
* SHARDED - explicitly sharded using an injected shard_key column
*/
public enum SchemaType {
PLAIN,
MULTITENANT,
DISTRIBUTED,
SHARDED
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import com.ibm.fhir.database.utils.api.IDatabaseStatement;
import com.ibm.fhir.database.utils.api.IDatabaseTranslator;
import com.ibm.fhir.database.utils.api.IDatabaseTypeAdapter;
import com.ibm.fhir.database.utils.db2.Db2Adapter;
import com.ibm.fhir.database.utils.derby.DerbyAdapter;
import com.ibm.fhir.database.utils.model.ColumnBase;
import com.ibm.fhir.database.utils.postgres.PostgresAdapter;
Expand Down Expand Up @@ -47,9 +46,6 @@ public void run(IDatabaseTranslator translator, Connection c) {
// DatabaseTypeAdapter is needed to find the correct data type for the column.
final IDatabaseTypeAdapter dbAdapter;
switch (translator.getType()) {
case DB2:
dbAdapter = new Db2Adapter();
break;
case DERBY:
dbAdapter = new DerbyAdapter();
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import com.ibm.fhir.database.utils.api.IDatabaseTranslator;
import com.ibm.fhir.database.utils.citus.CitusTranslator;
import com.ibm.fhir.database.utils.db2.Db2Translator;
import com.ibm.fhir.database.utils.derby.DerbyTranslator;
import com.ibm.fhir.database.utils.model.DbType;
import com.ibm.fhir.database.utils.postgres.PostgresTranslator;
Expand All @@ -29,9 +28,6 @@ public static IDatabaseTranslator getTranslator(DbType type) {
case DERBY:
result = new DerbyTranslator();
break;
case DB2:
result = new Db2Translator();
break;
case POSTGRESQL:
result = new PostgresTranslator();
break;
Expand Down

This file was deleted.

Loading

0 comments on commit 2da2031

Please sign in to comment.