Skip to content

Commit

Permalink
ECL-1058 , remove unnecessary method
Browse files Browse the repository at this point in the history
  • Loading branch information
tarekkh committed Mar 31, 2017
1 parent 748f2b1 commit 9736ae4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ public void deleteRecord(String cloudId)
deleteRepresentationRevision(cloudId, repVersion);
recordDAO.deleteRepresentation(cloudId, repVersion.getRepresentationName(), repVersion.getVersion());
}
recordDAO.deleteRecord(cloudId);
} else {
throw new RecordNotExistsException(cloudId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ public class CassandraRecordDAO {

private PreparedStatement deleteRepresentationVersionStatement;

private PreparedStatement deleteRecordStatement;

private PreparedStatement deleteRepresentationStatement;

private PreparedStatement getRepresentationVersionStatement;
Expand Down Expand Up @@ -132,14 +130,6 @@ private void prepareStatements() {
.prepare("SELECT cloud_id, schema_id, version_id, provider_id, persistent, creation_date, files FROM representation_versions WHERE cloud_id = ? ORDER BY schema_id DESC, version_id DESC;");
getAllRepresentationsForRecordStatement
.setConsistencyLevel(connectionProvider.getConsistencyLevel());

deleteRecordStatement = s.prepare("BEGIN BATCH "
+ "DELETE FROM representation_versions WHERE cloud_id = ? "
+ "DELETE FROM data_set_assignments WHERE cloud_id = ? "
+ "APPLY BATCH;");
deleteRecordStatement.setConsistencyLevel(connectionProvider
.getConsistencyLevel());

deleteRepresentationStatement = s
.prepare("DELETE FROM representation_versions WHERE cloud_id = ? AND schema_id = ? ;");
deleteRepresentationStatement.setConsistencyLevel(connectionProvider
Expand Down Expand Up @@ -219,20 +209,6 @@ public Record getRecord(String cloudId)
return new Record(cloudId, representations);
}

/**
* Deletes record with all representations and all versions. If such record
* doesn't exist - nothing happens.
*
* @param cloudId indentifier of record to be deleted.
*/
public void deleteRecord(String cloudId) throws NoHostAvailableException,
QueryExecutionException {
BoundStatement boundStatement = deleteRecordStatement.bind(cloudId,
cloudId);
ResultSet rs = connectionProvider.getSession().execute(boundStatement);
QueryTracer.logConsistencyLevel(boundStatement, rs);
}

/**
* Deletes representation with all versions. If such represenation doesn't
* exist - nothing happens.
Expand Down

0 comments on commit 9736ae4

Please sign in to comment.