Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1CC501074E for ; Thu, 27 Jun 2013 21:37:08 +0000 (UTC) Received: (qmail 20958 invoked by uid 500); 27 Jun 2013 21:37:07 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 20896 invoked by uid 500); 27 Jun 2013 21:37:07 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 20885 invoked by uid 99); 27 Jun 2013 21:37:07 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Jun 2013 21:37:07 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 9F89A38BDA; Thu, 27 Jun 2013 21:37:07 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ahuang@apache.org To: commits@cloudstack.apache.org Date: Thu, 27 Jun 2013 21:37:07 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/2] git commit: updated refs/heads/vmsync to 0233044 Updated Branches: refs/heads/vmsync 3c2aa1850 -> 0233044b2 Deadlock resolved Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c6ba4a23 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c6ba4a23 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c6ba4a23 Branch: refs/heads/vmsync Commit: c6ba4a23e88cd18d756cde9648a96b57c2606ae5 Parents: 3c2aa18 Author: Alex Huang Authored: Wed Jun 26 16:53:54 2013 -0700 Committer: Alex Huang Committed: Thu Jun 27 14:00:31 2013 -0700 ---------------------------------------------------------------------- .../framework/jobs/AsyncJobManager.java | 2 + .../framework/jobs/dao/AsyncJobJoinMapDao.java | 4 +- .../jobs/dao/AsyncJobJoinMapDaoImpl.java | 113 +++++++++++-------- .../jobs/impl/AsyncJobManagerImpl.java | 72 +++++++++++- tools/eclipse/remove-eclipse-profile.sh | 26 +++++ utils/src/com/cloud/utils/db/GenericDao.java | 4 +- .../src/com/cloud/utils/db/GenericDaoBase.java | 1 + .../cloud/utils/db/GenericSearchBuilder.java | 46 +++++--- 8 files changed, 203 insertions(+), 65 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c6ba4a23/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobManager.java ---------------------------------------------------------------------- diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobManager.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobManager.java index bc06101..440188a 100644 --- a/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobManager.java +++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobManager.java @@ -37,6 +37,8 @@ public interface AsyncJobManager extends Manager { void completeAsyncJob(long jobId, JobInfo.Status jobStatus, int resultCode, String result); + List wakeupByJoinedJobCompletion(long joinedJobId); + void updateAsyncJobStatus(long jobId, int processStatus, String resultObject); void updateAsyncJobAttachment(long jobId, String instanceType, Long instanceId); void logJobJournal(long jobId, AsyncJob.JournalType journalType, String http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c6ba4a23/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJoinMapDao.java ---------------------------------------------------------------------- diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJoinMapDao.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJoinMapDao.java index 9c993f1..4458fa2 100644 --- a/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJoinMapDao.java +++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJoinMapDao.java @@ -37,5 +37,7 @@ public interface AsyncJobJoinMapDao extends GenericDao void completeJoin(long joinJobId, JobInfo.Status joinStatus, String joinResult, long completeMsid); List wakeupScan(); - List wakeupByJoinedJobCompletion(long joinedJobId); + + List findJobsToWake(long joinedJobId); +// List wakeupByJoinedJobCompletion(long joinedJobId); } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c6ba4a23/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJoinMapDaoImpl.java ---------------------------------------------------------------------- diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJoinMapDaoImpl.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJoinMapDaoImpl.java index 8ea5073..ba6cfbc 100644 --- a/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJoinMapDaoImpl.java +++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJoinMapDaoImpl.java @@ -37,6 +37,7 @@ import com.cloud.utils.db.SearchCriteria; import com.cloud.utils.db.SearchCriteria.Op; import com.cloud.utils.db.Transaction; import com.cloud.utils.db.UpdateBuilder; +import com.cloud.utils.exception.CloudRuntimeException; public class AsyncJobJoinMapDaoImpl extends GenericDaoBase implements AsyncJobJoinMapDao { public static final Logger s_logger = Logger.getLogger(AsyncJobJoinMapDaoImpl.class); @@ -45,8 +46,10 @@ public class AsyncJobJoinMapDaoImpl extends GenericDaoBase RecordSearchByOwner; private final SearchBuilder CompleteJoinSearch; private final SearchBuilder WakeupSearch; + +// private final GenericSearchBuilder JoinJobSearch; - public AsyncJobJoinMapDaoImpl() { + protected AsyncJobJoinMapDaoImpl() { RecordSearch = createSearchBuilder(); RecordSearch.and("jobId", RecordSearch.entity().getJobId(), Op.EQ); RecordSearch.and("joinJobId", RecordSearch.entity().getJoinJobId(), Op.EQ); @@ -65,6 +68,10 @@ public class AsyncJobJoinMapDaoImpl extends GenericDaoBase wakeupByJoinedJobCompletion(long joinedJobId) { - List standaloneList = new ArrayList(); - - Transaction txn = Transaction.currentTxn(); - PreparedStatement pstmt = null; + + @Override + public List findJobsToWake(long joinedJobId) { + List standaloneList = new ArrayList(); + Transaction txn = Transaction.currentTxn(); + String sql = "SELECT job_id FROM async_job_join_map WHERE join_job_id = ? AND job_id NOT IN (SELECT content_id FROM sync_queue_item)"; try { - txn.start(); - - // - // performance sensitive processing, do it in plain SQL - // - String sql = "UPDATE async_job SET job_pending_signals=? WHERE id IN " + - "(SELECT job_id FROM async_job_join_map WHERE join_job_id = ?)"; - pstmt = txn.prepareStatement(sql); - pstmt.setInt(1, AsyncJob.Contants.SIGNAL_MASK_WAKEUP); - pstmt.setLong(2, joinedJobId); - pstmt.executeUpdate(); - pstmt.close(); - - sql = "UPDATE sync_queue_item SET queue_proc_msid=NULL, queue_proc_number=NULL WHERE content_id IN " + - "(SELECT job_id FROM async_job_join_map WHERE join_job_id = ?)"; - pstmt = txn.prepareStatement(sql); - pstmt.setLong(1, joinedJobId); - pstmt.executeUpdate(); - pstmt.close(); - - sql = "SELECT job_id FROM async_job_join_map WHERE join_job_id = ? AND job_id NOT IN (SELECT content_id FROM sync_queue_item)"; - pstmt = txn.prepareStatement(sql); - pstmt.setLong(1, joinedJobId); - ResultSet rs = pstmt.executeQuery(); - while(rs.next()) { - standaloneList.add(rs.getLong(1)); - } - rs.close(); - pstmt.close(); - - txn.commit(); - } catch (SQLException e) { - s_logger.error("Unexpected exception", e); - } - + PreparedStatement pstmt = txn.prepareStatement(sql); + pstmt.setLong(1, joinedJobId); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) { + standaloneList.add(rs.getLong(1)); + } + } catch (SQLException e) { + throw new CloudRuntimeException("Unable to execute " + sql, e); + } return standaloneList; - } + } + +// @Override +// public List wakeupByJoinedJobCompletion(long joinedJobId) { +// List standaloneList = new ArrayList(); +// +// Transaction txn = Transaction.currentTxn(); +// PreparedStatement pstmt = null; +// try { +// txn.start(); +// +// // +// // performance sensitive processing, do it in plain SQL +// // +// String sql = "UPDATE async_job SET job_pending_signals=? WHERE id IN " + +// "(SELECT job_id FROM async_job_join_map WHERE join_job_id = ?)"; +// pstmt = txn.prepareStatement(sql); +// pstmt.setInt(1, AsyncJob.Contants.SIGNAL_MASK_WAKEUP); +// pstmt.setLong(2, joinedJobId); +// pstmt.executeUpdate(); +// pstmt.close(); +// +// sql = "UPDATE sync_queue_item SET queue_proc_msid=NULL, queue_proc_number=NULL WHERE content_id IN " + +// "(SELECT job_id FROM async_job_join_map WHERE join_job_id = ?)"; +// pstmt = txn.prepareStatement(sql); +// pstmt.setLong(1, joinedJobId); +// pstmt.executeUpdate(); +// pstmt.close(); +// +// sql = "SELECT job_id FROM async_job_join_map WHERE join_job_id = ? AND job_id NOT IN (SELECT content_id FROM sync_queue_item)"; +// pstmt = txn.prepareStatement(sql); +// pstmt.setLong(1, joinedJobId); +// ResultSet rs = pstmt.executeQuery(); +// while(rs.next()) { +// standaloneList.add(rs.getLong(1)); +// } +// rs.close(); +// pstmt.close(); +// +// txn.commit(); +// } catch (SQLException e) { +// s_logger.error("Unexpected exception", e); +// } +// +// return standaloneList; +// } } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c6ba4a23/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java ---------------------------------------------------------------------- diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java index a59aea3..2351a10 100644 --- a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java +++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java @@ -48,6 +48,7 @@ import org.apache.cloudstack.framework.jobs.AsyncJobManager; import org.apache.cloudstack.framework.jobs.dao.AsyncJobDao; import org.apache.cloudstack.framework.jobs.dao.AsyncJobJoinMapDao; import org.apache.cloudstack.framework.jobs.dao.AsyncJobJournalDao; +import org.apache.cloudstack.framework.jobs.dao.SyncQueueItemDao; import org.apache.cloudstack.framework.messagebus.MessageBus; import org.apache.cloudstack.framework.messagebus.MessageDetector; import org.apache.cloudstack.framework.messagebus.PublishScope; @@ -65,12 +66,18 @@ import com.cloud.utils.concurrency.NamedThreadFactory; import com.cloud.utils.db.DB; import com.cloud.utils.db.GenericDao; import com.cloud.utils.db.GenericDaoBase; +import com.cloud.utils.db.GenericSearchBuilder; import com.cloud.utils.db.GlobalLock; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; +import com.cloud.utils.db.SearchCriteria.Op; import com.cloud.utils.db.Transaction; import com.cloud.utils.exception.CloudRuntimeException; import com.cloud.utils.exception.ExceptionUtil; import com.cloud.utils.mgmt.JmxUtil; +import edu.emory.mathcs.backport.java.util.Collections; + public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager, ClusterManagerListener, Configurable { // Advanced private static final ConfigKey JobExpireMinutes = new ConfigKey(Long.class, "job.expire.minutes", "Advanced", AsyncJobManager.class, "1440", @@ -86,7 +93,9 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager, private static final int MAX_ONETIME_SCHEDULE_SIZE = 50; private static final int HEARTBEAT_INTERVAL = 2000; private static final int GC_INTERVAL = 10000; // 10 seconds - + + @Inject + private SyncQueueItemDao _queueItemDao; @Inject private SyncQueueManager _queueMgr; @Inject private AsyncJobDao _jobDao; @Inject private AsyncJobJournalDao _journalDao; @@ -224,7 +233,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager, job.setLastUpdated(DateUtil.currentGMTTime()); _jobDao.update(jobId, job); - List wakeupList = _joinMapDao.wakeupByJoinedJobCompletion(jobId); + List wakeupList = wakeupByJoinedJobCompletion(jobId); _joinMapDao.disjoinAllJobs(jobId); txn.commit(); @@ -841,6 +850,26 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager, throw new ConfigurationException("Unable to load db.properties to configure AsyncJobManagerImpl"); } + JoinJobSearch = _joinMapDao.createSearchBuilder(Long.class); + JoinJobSearch.and(JoinJobSearch.entity().getJoinJobId(), Op.EQ, "joinJobId"); + JoinJobSearch.selectField(JoinJobSearch.entity().getJobId()); + JoinJobSearch.done(); + + JobIdsSearch = _jobDao.createSearchBuilder(); + JobIdsSearch.and(JobIdsSearch.entity().getId(), Op.IN, "ids").done(); + + QueueJobIdsSearch = _queueItemDao.createSearchBuilder(); + QueueJobIdsSearch.and(QueueJobIdsSearch.entity().getContentId(), Op.IN, "contentIds").done(); + + JoinJobIdsSearch = _joinMapDao.createSearchBuilder(Long.class); + JoinJobIdsSearch.selectField(JoinJobIdsSearch.entity().getJobId()); + JoinJobIdsSearch.and(JoinJobIdsSearch.entity().getJoinJobId(), Op.EQ, "joinJobId"); + JoinJobIdsSearch.and(JoinJobIdsSearch.entity().getJobId(), Op.NIN, "jobIds"); + JoinJobIdsSearch.done(); + + ContentIdsSearch = _queueItemDao.createSearchBuilder(Long.class); + ContentIdsSearch.selectField(ContentIdsSearch.entity().getContentId()).done(); + AsyncJobExecutionContext.init(this, _joinMapDao); OutcomeImpl.init(this); @@ -848,6 +877,34 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager, } @Override + @DB + public List wakeupByJoinedJobCompletion(long joinedJobId) { + SearchCriteria joinJobSC = JoinJobSearch.create("joinJobId", joinedJobId); + + List result = _joinMapDao.customSearch(joinJobSC, null); + if (result.size() != 0) { + Collections.sort(result); + Long[] ids = result.toArray(new Long[result.size()]); + + SearchCriteria jobsSC = JobIdsSearch.create("ids", ids); + SearchCriteria queueItemsSC = QueueJobIdsSearch.create("contentIds", ids); + + Transaction txn = Transaction.currentTxn(); + txn.start(); + AsyncJobVO job = _jobDao.createForUpdate(); + job.setPendingSignals(1); + _jobDao.update(job, jobsSC); + + SyncQueueItemVO item = _queueItemDao.createForUpdate(); + item.setLastProcessNumber(null); + item.setLastProcessMsid(null); + _queueItemDao.update(item, queueItemsSC); + txn.commit(); + } + return _joinMapDao.findJobsToWake(joinedJobId); + } + + @Override public void onManagementNodeJoined(List nodeList, long selfNodeId) { } @@ -897,4 +954,15 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager, _executor.shutdown(); return true; } + + private GenericSearchBuilder ContentIdsSearch; + private GenericSearchBuilder JoinJobSearch; + private SearchBuilder JobIdsSearch; + private SearchBuilder QueueJobIdsSearch; + private GenericSearchBuilder JoinJobIdsSearch; + + protected AsyncJobManagerImpl() { + + } + } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c6ba4a23/tools/eclipse/remove-eclipse-profile.sh ---------------------------------------------------------------------- diff --git a/tools/eclipse/remove-eclipse-profile.sh b/tools/eclipse/remove-eclipse-profile.sh new file mode 100644 index 0000000..6b31583 --- /dev/null +++ b/tools/eclipse/remove-eclipse-profile.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +for file in `find . -name org.eclipse.m2e.core.prefs | xargs`; do + if grep -q activeProfiles=eclipse $file; then + echo Replacing $file; + sed -i s/activeProfiles=eclipse/activeProfiles=/g $file; + else + echo Skipping $file; + fi; +done \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c6ba4a23/utils/src/com/cloud/utils/db/GenericDao.java ---------------------------------------------------------------------- diff --git a/utils/src/com/cloud/utils/db/GenericDao.java b/utils/src/com/cloud/utils/db/GenericDao.java index 3efc1c5..66d0f67 100755 --- a/utils/src/com/cloud/utils/db/GenericDao.java +++ b/utils/src/com/cloud/utils/db/GenericDao.java @@ -134,6 +134,8 @@ public interface GenericDao { boolean update(ID id, T entity); + int update(T entity, SearchCriteria sc); + /** * Look for all active rows. * @return list of entity beans. @@ -213,7 +215,7 @@ public interface GenericDao { /** * Remove based on the search criteria. This will delete if the VO object - * does not have a REMOVED column. + * does not have a REMOVED column. * @param sc search criteria to match * @return rows removed. */ http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c6ba4a23/utils/src/com/cloud/utils/db/GenericDaoBase.java ---------------------------------------------------------------------- diff --git a/utils/src/com/cloud/utils/db/GenericDaoBase.java b/utils/src/com/cloud/utils/db/GenericDaoBase.java index f593c38..3a7e584 100755 --- a/utils/src/com/cloud/utils/db/GenericDaoBase.java +++ b/utils/src/com/cloud/utils/db/GenericDaoBase.java @@ -1267,6 +1267,7 @@ public abstract class GenericDaoBase extends Compone } @DB(txn=false) + @Override public int update(final T entity, final SearchCriteria sc) { final UpdateBuilder ub = getUpdateBuilder(entity); return update(ub, sc, null); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c6ba4a23/utils/src/com/cloud/utils/db/GenericSearchBuilder.java ---------------------------------------------------------------------- diff --git a/utils/src/com/cloud/utils/db/GenericSearchBuilder.java b/utils/src/com/cloud/utils/db/GenericSearchBuilder.java index 4bae344..bf28144 100755 --- a/utils/src/com/cloud/utils/db/GenericSearchBuilder.java +++ b/utils/src/com/cloud/utils/db/GenericSearchBuilder.java @@ -34,7 +34,6 @@ import net.sf.cglib.proxy.MethodProxy; import com.cloud.utils.db.SearchCriteria.Func; import com.cloud.utils.db.SearchCriteria.Op; import com.cloud.utils.db.SearchCriteria.SelectType; -import com.cloud.utils.exception.CloudRuntimeException; /** * GenericSearchBuilder is used to build a search based on a VO object @@ -75,13 +74,19 @@ public class GenericSearchBuilder implements MethodInterceptor { } protected Attribute getSpecifiedAttribute() { - assert(_entity != null && _specifiedAttrs != null && _specifiedAttrs.size() == 1) : "Now now, better specify an attribute or else we can't help you"; + if (_entity == null || _specifiedAttrs == null || _specifiedAttrs.size() != 1) { + throw new RuntimeException("Now now, better specify an attribute or else we can't help you"); + } return _specifiedAttrs.get(0); } public GenericSearchBuilder selectField(Object... useless) { - assert _entity != null : "SearchBuilder cannot be modified once it has been setup"; - assert _specifiedAttrs.size() > 0 : "You didn't specify any attributes"; + if (_entity == null) { + throw new RuntimeException("SearchBuilder cannot be modified once it has been setup"); + } + if (_specifiedAttrs.size() <= 0) { + throw new RuntimeException("You didn't specify any attributes"); + } if (_selects == null) { _selects = new ArrayList(); @@ -132,12 +143,15 @@ public class GenericSearchBuilder implements MethodInterceptor { field = _resultType.getDeclaredField(fieldName); field.setAccessible(true); } catch (SecurityException e) { - throw new CloudRuntimeException("Unable to find " + fieldName, e); + throw new RuntimeException("Unable to find " + fieldName, e); } catch (NoSuchFieldException e) { - throw new CloudRuntimeException("Unable to find " + fieldName, e); + throw new RuntimeException("Unable to find " + fieldName, e); } } else { - assert _selects.size() == 0 : "You're selecting more than one item and yet is not providing a container class to put these items in. So what do you expect me to do. Spin magic?"; + if (_selects.size() != 0) { + throw new RuntimeException( + "You're selecting more than one item and yet is not providing a container class to put these items in. So what do you expect me to do. Spin magic?"); + } } Select select = new Select(func, _specifiedAttrs.size() == 0 ? null : _specifiedAttrs.get(0), field, params); @@ -148,10 +162,6 @@ public class GenericSearchBuilder implements MethodInterceptor { return this; } -// public GenericSearchBuilder select(String joinName, String fieldName, Func func, Object useless, Object... params) { -// -// } - @Override public Object intercept(Object object, Method method, Object[] args, MethodProxy methodProxy) throws Throwable { String name = method.getName(); @@ -175,7 +185,7 @@ public class GenericSearchBuilder implements MethodInterceptor { } } } - assert false : "Perhaps you need to make the method start with get or is?"; + throw new RuntimeException("Perhaps you need to make the method start with get or is: " + method); } } return methodProxy.invokeSuper(object, args); @@ -479,7 +489,9 @@ public class GenericSearchBuilder implements MethodInterceptor { sql.delete(sql.length() - 5, sql.length()); sql.append(" IS NOT NULL "); } else { - assert((op.getParams() == 0 && params == null) || (params.length == op.getParams())) : "Problem with condition: " + name; + if ((op.getParams() != 0 || params != null) && (params.length != op.getParams())) { + throw new RuntimeException("Problem with condition: " + name); + } } } @@ -527,7 +539,7 @@ public class GenericSearchBuilder implements MethodInterceptor { public GenericSearchBuilder values(Object... params) { if (condition.op.getParams() > 0 && condition.op.params != params.length) { - throw new CloudRuntimeException("The # of parameters set " + params.length + " does not match # of parameters required by " + condition.op); + throw new RuntimeException("The # of parameters set " + params.length + " does not match # of parameters required by " + condition.op); } condition.setPresets(params); return builder;