Skip to content

Commit

Permalink
Cleanup/consolidate QueryExecutorBean's Persister usage
Browse files Browse the repository at this point in the history
  • Loading branch information
keith-ratcliffe committed Mar 13, 2024
1 parent b087ac9 commit f4eeddc
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 188 deletions.
Expand Up @@ -114,12 +114,15 @@ public Query create(String userDN, List<String> dnList, SecurityMarking marking,
q.setColumnVisibility(marking.toColumnVisibilityString());
q.setUncaughtExceptionHandler(new QueryUncaughtExceptionHandler());
Thread.currentThread().setUncaughtExceptionHandler(q.getUncaughtExceptionHandler());
return q;
}

public void save(Query q, QueryParameters qp) {
// Persist the query object if required
if (qp.getPersistenceMode().equals(QueryPersistence.PERSISTENT)) {
log.debug("Persisting query with id: " + q.getId());
create(q);
save(q);
}
return q;
}

private void tableCheck(AccumuloClient c) throws AccumuloException, AccumuloSecurityException, TableExistsException {
Expand All @@ -141,7 +144,7 @@ private void tableCheck(AccumuloClient c) throws AccumuloException, AccumuloSecu
* the query
*
*/
private void create(Query query) {
private void save(Query query) {
AccumuloClient c = null;
try {
Map<String,String> trackingMap = connectionFactory.getTrackingMap(Thread.currentThread().getStackTrace());
Expand Down Expand Up @@ -180,7 +183,7 @@ public void update(Query query) throws Exception {
// Do we really need to remove first. Won't creating a record with the same key just overwrite with a new timestamp
// The only time this wouldn't be the case is when the name and/or the visibility changes, which would cause a new row id
remove(query);
create(query);
save(query);
}

/**
Expand Down

0 comments on commit f4eeddc

Please sign in to comment.