Skip to content
Permalink
Browse files
JUDDI-881 filtering is now togglable, load tests are now performed du…
…ring junit test executing with filtering disabled. For best performance with larger data sets, it is recommended to disable this.
  • Loading branch information
spyhunter99 committed Dec 25, 2014
1 parent 8f7c669 commit 32fd00534079181b8fef1bfdd2adfab26569c579
Showing 8 changed files with 216 additions and 120 deletions.
@@ -156,7 +156,16 @@ Logging properties that can be referenced in the _juddiv3.xml_ file.
|_juddi/logging/logInquirySearchPayloads| Enables request payload logging for the Inquiry Find apis |N| false
|===========================================================================================

=== Performance

.These properties are used to enable or disable certain capabilities based on performance considerations

Perofrmance properties are referenced in the _juddiv3.xm_ file.
[options="header"]
|===========================================================================================
|Property Name |Description |Required |Default Value or [Example Value]
|_juddi/performance/enableFindBusinessTModelBagFiltering| UDDI defines a mechansim to filter findBusiness relates based on tModelInstanceInfo within their service's binding templates. This is an expensive operation and will cause significant performance degredation on larger registries. For spec complliance, it should be set to true. We suspect it's not a commonly used feature and recommend setting this to false. |N| true
|===========

=== Deploying two or more jUDDI server on the same application server

@@ -19,12 +19,17 @@
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.persistence.EntityManager;
import javax.xml.ws.Holder;
import org.apache.commons.configuration.ConfigurationException;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.juddi.config.AppConfig;
import org.apache.juddi.config.Property;
import org.apache.juddi.mapping.MappingModelToApi;
import org.apache.juddi.query.FetchBindingTemplatesQuery;
import org.apache.juddi.query.FetchBusinessEntitiesQuery;
@@ -226,28 +231,36 @@ public static BusinessList getBusinessListFromKeys(FindBusiness body, FindQualif

// Sort and retrieve the final results taking paging into account
List<?> queryResults = FetchBusinessEntitiesQuery.select(em, findQualifiers, keysFound, body.getMaxRows(), body.getListHead(), listDesc);
List<?> serviceResults = null;
for (int i = 0; i<queryResults.size(); i++) {
org.apache.juddi.model.BusinessEntity be = (org.apache.juddi.model.BusinessEntity) queryResults.get(i);

List<Object> keysIn = new ArrayList<Object>();
List<org.apache.juddi.model.BusinessService> services = be.getBusinessServices();
for (int j = 0; j<services.size(); j++) {
keysIn.add(services.get(j).getEntityKey());
}

serviceResults = FindServiceByTModelKeyQuery.select(em, findQualifiers, body.getTModelBag(), null, keysIn);
if (serviceResults == null) {
be.setBusinessServices(null);
} else {
ListDescription ldesc = new ListDescription();
result.setListDescription(listDesc);
List<?> srvcs = FetchBusinessServicesQuery.select(em, findQualifiers, serviceResults, body.getMaxRows(),
body.getListHead(), ldesc);
be.setBusinessServices((List<org.apache.juddi.model.BusinessService>)srvcs);
}

boolean enabled = true;
try {
AppConfig.getConfiguration().getBoolean(Property.JUDDI_ENABLE_FIND_BUSINESS_TMODEL_BAG_FILTERING, true);
} catch (ConfigurationException ex) {
logger.error(ex);
}
if (enabled) {
List<?> serviceResults = null;
for (int i = 0; i < queryResults.size(); i++) {
org.apache.juddi.model.BusinessEntity be = (org.apache.juddi.model.BusinessEntity) queryResults.get(i);

List<Object> keysIn = new ArrayList<Object>();
List<org.apache.juddi.model.BusinessService> services = be.getBusinessServices();
for (int j = 0; j < services.size(); j++) {
keysIn.add(services.get(j).getEntityKey());
}

serviceResults = FindServiceByTModelKeyQuery.select(em, findQualifiers, body.getTModelBag(), null, keysIn);
if (serviceResults == null) {
be.setBusinessServices(null);
} else {
ListDescription ldesc = new ListDescription();
result.setListDescription(listDesc);
List<?> srvcs = FetchBusinessServicesQuery.select(em, findQualifiers, serviceResults, body.getMaxRows(),
body.getListHead(), ldesc);
be.setBusinessServices((List<org.apache.juddi.model.BusinessService>) srvcs);
}
}
}



if (queryResults != null && queryResults.size() > 0)
@@ -190,4 +190,10 @@ public interface Property {
* @since 3.2.1
*/
public final static String JUDDI_LOGGING_FindApiCalls = "juddi.logging.logInquirySearchPayloads";
/**
* The UDDI v3 spec specifically calls for supporting this, however it creates significant performance problems in jUDDI when there
* are a large number of business and services. Defaults to true if not defined
* @since 3.3
*/
public static String JUDDI_ENABLE_FIND_BUSINESS_TMODEL_BAG_FILTERING="juddi.preformance.enableFindBusinessTModelBagFiltering";
}
@@ -20,6 +20,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.juddi.Registry;
import org.apache.juddi.config.AppConfig;
import org.apache.juddi.config.Property;
import org.apache.juddi.query.util.FindQualifiers;
import org.apache.juddi.v3.tck.TckBusiness;
import org.apache.juddi.v3.tck.TckBusinessService;
@@ -29,6 +31,7 @@
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.uddi.api_v3.BusinessList;
import org.uddi.api_v3.FindBusiness;
@@ -82,8 +85,14 @@ public static void shutdown() throws ConfigurationException{
}

@Test
public void find20Businesses() throws DispositionReportFaultMessage {
tckTModel.saveJoePublisherTmodel(authInfoJoe);
//@Ignore
public void find20Businesses() throws DispositionReportFaultMessage, ConfigurationException {
//disable TModelBag filtering
logger.info("Disabling findBusiness tModelBag filtering....");
AppConfig.getConfiguration().setProperty(Property.JUDDI_ENABLE_FIND_BUSINESS_TMODEL_BAG_FILTERING, false);
logger.info("findBusiness tModelBag filtering is enabled: " +
AppConfig.getConfiguration().getProperty(Property.JUDDI_ENABLE_FIND_BUSINESS_TMODEL_BAG_FILTERING));
tckTModel.saveJoePublisherTmodel(authInfoJoe);
long startSave = System.currentTimeMillis();
//loading up 100 businesses, with a 100 services each
tckBusiness.saveJoePublisherBusinesses(authInfoJoe, numberOfBusinesses);
@@ -92,7 +101,7 @@ public void find20Businesses() throws DispositionReportFaultMessage {
}
long saveDuration = System.currentTimeMillis() - startSave;
System.out.println("Saved " + numberOfBusinesses + " businesses with each " + numberOfServices + " services in " + saveDuration + "ms");

System.out.println("Tiggering findBusiness query...");
//find 20 businesses by name
FindBusiness fb = new FindBusiness();
org.uddi.api_v3.FindQualifiers apiFq = new org.uddi.api_v3.FindQualifiers();
@@ -109,7 +118,7 @@ public void find20Businesses() throws DispositionReportFaultMessage {
System.out.println("Find 20 businesses took " + findDuration + "ms. Size=" + result.getBusinessInfos().getBusinessInfo().size());
// it takes less then 1 second, make sure it stays faster then 5 seconds
//Assert.assertTrue(findDuration < 5000);

System.out.println("Tiggering findService query...");
FindService fs = new FindService();
fs.setFindQualifiers(apiFq);
name.setValue("Service One%");
@@ -122,6 +131,7 @@ public void find20Businesses() throws DispositionReportFaultMessage {
findDuration = System.currentTimeMillis() - startFind;
System.out.println("Find " + all + " services took " + findDuration + "ms. Size=" + serviceList.getServiceInfos().getServiceInfo().size());

System.out.println("Tiggering deletion...");
long startDelete = System.currentTimeMillis();
for (int i=0; i<numberOfBusinesses; i++) {
tckBusinessService.deleteJoePublisherServices(authInfoJoe, i, numberOfServices);

0 comments on commit 32fd005

Please sign in to comment.