Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup/consolidate QueryExecutorBean's Persister usage #2308

Open
wants to merge 3 commits into
base: integration
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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