modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java | 2 modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java | 38 +++++++--- 2 files changed, 28 insertions(+), 12 deletions(-)
New commits: commit a2d3d1ba9278c2d2847a0eb4381ce09ee1475b0d Author: Jay Shaughnessy jshaughn@jshaughn.csb Date: Fri Feb 1 15:32:38 2013 -0500
InventoryManager tweeks - return to debug logging - make the sync batch size configurable
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java index 7043c1f..f1746da 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java @@ -145,6 +145,19 @@ public class InventoryManager extends AgentService implements ContainerService, private static final int COMPONENT_START_TIMEOUT = 60 * 1000; // 60 seconds private static final int COMPONENT_STOP_TIMEOUT = 5 * 1000; // 5 seconds
+ static private final int SYNC_BATCH_SIZE; + + static { + + int syncBatchSize = 500; + try { + syncBatchSize = Integer.parseInt(System.getProperty("rhq.agent.sync.batch.size", "500")); + } catch (Throwable t) { + // + } + SYNC_BATCH_SIZE = syncBatchSize; + } + private final Log log = LogFactory.getLog(InventoryManager.class);
private PluginContainerConfiguration configuration; @@ -2832,10 +2845,10 @@ public class InventoryManager extends AgentService implements ContainerService, }
private void mergeUnknownResources(Set<ResourceSyncInfo> unknownResourceSyncInfos) { - //TODO if (log.isDebugEnabled()) { - log.info("Merging [" + unknownResourceSyncInfos.size() - + "] unknown Resources and their descendants into local inventory..."); - //} + if (log.isDebugEnabled()) { + log.debug("Merging [" + unknownResourceSyncInfos.size() + + "] unknown Resources and their descendants into local inventory..."); + }
if (!unknownResourceSyncInfos.isEmpty()) { PluginMetadataManager pmm = this.pluginManager.getMetadataManager(); @@ -2875,8 +2888,6 @@ public class InventoryManager extends AgentService implements ContainerService, return result; }
- static final int BATCH_SIZE = 500; - private Resource getResourceFromSyncInfo(ResourceSyncInfo syncInfo) { Resource result;
@@ -2886,7 +2897,7 @@ public class InventoryManager extends AgentService implements ContainerService,
while (!resourceIdList.isEmpty()) { int size = resourceIdList.size(); - int end = (BATCH_SIZE < size) ? BATCH_SIZE : size; + int end = (SYNC_BATCH_SIZE < size) ? SYNC_BATCH_SIZE : size;
List<Integer> resourceIdBatch = resourceIdList.subList(0, end); Integer[] resourceIdArray = resourceIdBatch.toArray(new Integer[resourceIdBatch.size()]); @@ -2915,13 +2926,18 @@ public class InventoryManager extends AgentService implements ContainerService, + "] resources when fetching from server"); }
- StopWatch stopWatch = new StopWatch(); + boolean isDebugEnabled = log.isDebugEnabled(); + StopWatch stopWatch = null; + + if (isDebugEnabled) { + stopWatch = new StopWatch(); + }
result = syncInfoTreeToResourceTree(syncInfo, resourceMap);
- //TODO if (log.isDebugEnabled()) { - log.info("syncInfoTreeToResourceTree time=[" + stopWatch + "]"); - //} + if (isDebugEnabled) { + log.debug("syncInfoTreeToResourceTree time=[" + stopWatch + "]"); + }
return result; }
commit a9d9edd07ce3a53df0c994b098df078273aa91eb Author: Jay Shaughnessy jshaughn@jshaughn.csb Date: Fri Feb 1 15:00:41 2013 -0500
Change to private vars I guess means a change to Serialization id
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java index 96b51fa..1618b09 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java @@ -43,7 +43,7 @@ import org.rhq.core.domain.util.PageOrdering; @XmlAccessorType(XmlAccessType.FIELD) @SuppressWarnings("unused") public class ResourceCriteria extends TaggedCriteria { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 2L;
private Integer filterId; private String filterName;
rhq-commits@lists.fedorahosted.org