aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core
diff options
context:
space:
mode:
authortalig <talig@amdocs.com>2018-06-11 12:28:33 +0300
committertalig <talig@amdocs.com>2018-06-11 12:28:43 +0300
commit4dc878ccce1219a78cd64c3bdaee78421c68d11d (patch)
treef03b35d0c3ed9ed87c38de66f2ed4ed459044ba9 /openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core
parent907753f90f876574efdc4c4153ef7516e0bcf8b3 (diff)
Upgrade datastax cassandra driver to 3.4.0
Upgrage zusammen to 1.0.0 which uses datastax cassandra driver 3.4.0 Change-Id: Ie7217986b67cd95de015daedd0f7106c2d0a972d Issue-ID: SDC-1416 Signed-off-by: talig <talig@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core')
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionDaoImpl.java22
1 files changed, 4 insertions, 18 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionDaoImpl.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionDaoImpl.java
index 5b7e1b2c8e..cb5787405b 100644
--- a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionDaoImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionDaoImpl.java
@@ -43,12 +43,10 @@ import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_QUERY_
import com.datastax.driver.core.ResultSet;
import com.datastax.driver.core.Row;
import com.datastax.driver.core.Statement;
-import com.datastax.driver.core.UDTValue;
import com.datastax.driver.core.exceptions.NoHostAvailableException;
import com.datastax.driver.core.querybuilder.QueryBuilder;
import com.datastax.driver.mapping.Mapper;
import com.datastax.driver.mapping.Result;
-import com.datastax.driver.mapping.UDTMapper;
import com.datastax.driver.mapping.annotations.Accessor;
import com.datastax.driver.mapping.annotations.Query;
import java.util.ArrayList;
@@ -95,8 +93,6 @@ public class ActionDaoImpl extends CassandraBaseDao<ActionEntity> implements Act
noSqlDb.getMappingManager().mapper(ActionEntity.class);
private static ActionAccessor accessor =
noSqlDb.getMappingManager().createAccessor(ActionAccessor.class);
- private static UDTMapper<Version> versionMapper =
- noSqlDb.getMappingManager().udtMapper(Version.class);
private static VersionInfoDao versionInfoDao =
VersionInfoDaoFactory.getInstance().createInterface();
private static VersionInfoDeletedDao versionInfoDeletedDao =
@@ -159,7 +155,7 @@ public class ActionDaoImpl extends CassandraBaseDao<ActionEntity> implements Act
Version activeVersion = activeVersionEntity.getActiveVersion();
Statement getNameFromInvUuId = QueryBuilder.select().column("name").from("dox", "Action")
.where(eq("actioninvariantuuid", actionInvariantUuId))
- .and(in("version", versionMapper.toUDT(activeVersion)));
+ .and(in("version", activeVersion));
ActionUtil
.actionLogPreProcessor(ActionSubOperation.GET_NAME_BY_ACTIONINVID, TARGET_ENTITY_DB);
ResultSet results = getSession().execute(getNameFromInvUuId);
@@ -430,7 +426,7 @@ public class ActionDaoImpl extends CassandraBaseDao<ActionEntity> implements Act
@Override
protected Object[] getKeys(ActionEntity entity) {
- return new Object[]{entity.getActionInvariantUuId(), versionMapper.toUDT(entity.getVersion())};
+ return new Object[]{entity.getActionInvariantUuId(), entity.getVersion()};
}
@Override
@@ -438,25 +434,15 @@ public class ActionDaoImpl extends CassandraBaseDao<ActionEntity> implements Act
return accessor.getAllActions().all();
}
- /**
- *
- * @param actionInvariantUUID.
- * @param versions.
- */
private void updateActionStatusForDelete(String actionInvariantUuId, List<Version> versions) {
log.debug(
"entering updateActionStatusForDelete with actionInvariantUuId = " + actionInvariantUuId
+ " for versions " + versions);
- List<UDTValue> versionUdt = new ArrayList<>();
- for (Version v : versions) {
- versionUdt.add(versionMapper.toUDT(v));
- }
-
ActionUtil.actionLogPreProcessor(ActionSubOperation.UPDATE_ACTION_STATUS, TARGET_ENTITY_DB);
//Update the status column of action table
Statement updateStatusStatement =
QueryBuilder.update("dox", "Action").with(set("status", ActionStatus.Deleted.name()))
- .where(eq("actioninvariantuuid", actionInvariantUuId)).and(in("version", versionUdt));
+ .where(eq("actioninvariantuuid", actionInvariantUuId)).and(in("version", versions));
getSession().execute(updateStatusStatement);
ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false);
log.metrics("");
@@ -506,7 +492,7 @@ public class ActionDaoImpl extends CassandraBaseDao<ActionEntity> implements Act
List<Version> versionList = new ArrayList<>();
for (Row row : results) {
- Version version = versionMapper.fromUDT((UDTValue) row.getObject("version"));
+ Version version = row.get("version",Version.class);
versionList.add(version);
}
log.debug("exit getVersionsByName for Action Name = " + name);