Skip to content

Commit

Permalink
Build speed up with explicitly setting which beans need early initia…
Browse files Browse the repository at this point in the history
…lization instead

commit 8f5037198cc594ced330517e1b05efbaf9a66f95
Author: Jody Garnett <jody.garnett@gmail.com>
Date:   Tue May 12 10:58:12 2015 -0700

    tone down debug messages

commit 24f474c9a882a5d611f5c8fe211bbbc77fe9f001
Author: Andrea Aime <andrea.aime@gmail.com>
Date:   Sun May 10 14:24:22 2015 +0200

    Explicitly setting which beans need early initialization instead

commit ababf9ba46fca34c621b1138784a5fa284a78f6f
Author: Andrea Aime <andrea.aime@gmail.com>
Date:   Sun Apr 26 10:16:04 2015 +0200

    Build speed up
  • Loading branch information
jodygarnett committed May 12, 2015
1 parent b199a36 commit ed61387
Show file tree
Hide file tree
Showing 41 changed files with 375 additions and 179 deletions.
@@ -1,4 +1,4 @@
/* (c) 2014 Open Source Geospatial Foundation - all rights reserved
/* (c) 2014 - 2015 Open Source Geospatial Foundation - all rights reserved
* (c) 2001 - 2013 OpenPlans
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
Expand All @@ -24,7 +24,6 @@
import org.custommonkey.xmlunit.XMLUnit;
import org.custommonkey.xmlunit.XpathEngine;
import org.geoserver.data.test.SystemTestData;
import org.geoserver.data.test.TestData;
import org.geotools.data.SampleDataAccess;
import org.geotools.data.SampleDataAccessData;
import org.junit.Test;
Expand Down Expand Up @@ -175,8 +174,7 @@ public void prettyPrint(Document doc, OutputStream out) throws Exception {

@Override
protected void setUpTestData(SystemTestData testData) throws Exception {
// TODO Auto-generated method stub

testData.setUpSecurity();
}

}
@@ -1,6 +1,12 @@
/* (c) 2014 - 2015 Open Source Geospatial Foundation - all rights reserved
* (c) 2001 - 2013 OpenPlans
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
*/
package org.geoserver.csw;

import java.io.File;

import org.apache.commons.io.FileUtils;
import org.geoserver.data.test.SystemTestData;

Expand All @@ -9,7 +15,7 @@ public abstract class CSWSimpleTestSupport extends CSWTestSupport {

@Override
protected void setUpTestData(SystemTestData testData) throws Exception {

testData.setUpSecurity();
System.setProperty("DefaultCatalogStore", "org.geoserver.csw.store.simple.GeoServerSimpleCatalogStore");

// copy all records into the data directory
Expand Down
@@ -1,4 +1,4 @@
/* (c) 2014 Open Source Geospatial Foundation - all rights reserved
/* (c) 2014 - 2015 Open Source Geospatial Foundation - all rights reserved
* (c) 2001 - 2013 OpenPlans
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
Expand Down Expand Up @@ -77,7 +77,7 @@ protected void onSetUp(SystemTestData testData) throws Exception {
@Override
protected void setUpTestData(SystemTestData testData) throws Exception {
// no pre-existing test data needed for the importer
// super.setUpTestData(testData);
testData.setUpSecurity();
}

@After
Expand Down
@@ -1,4 +1,4 @@
/* (c) 2014 Open Source Geospatial Foundation - all rights reserved
/* (c) 2014 - 2015 Open Source Geospatial Foundation - all rights reserved
* (c) 2001 - 2013 OpenPlans
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
Expand Down Expand Up @@ -89,6 +89,7 @@ protected WCSInfo getWCS() {
@Override
protected void setUpTestData(SystemTestData testData) throws Exception {
// do not setup anything here, we'll setup mosaics later
testData.setUpSecurity();
}

@Override
Expand Down
Expand Up @@ -12,6 +12,7 @@ public abstract class WPSPagesTestSupport extends GeoServerWicketTestSupport {
@Override
protected void setUpTestData(SystemTestData testData) throws Exception {
// no data needed
testData.setUpSecurity();
}

}
14 changes: 7 additions & 7 deletions src/extension/wps/wps-core/src/main/java/applicationContext.xml
Expand Up @@ -218,7 +218,7 @@
<!--
Factory for deprecated processes
-->
<bean id="deprecatedProcessFactory" class="org.geoserver.wps.DeprecatedProcessFactory">
<bean id="deprecatedProcessFactory" class="org.geoserver.wps.DeprecatedProcessFactory" lazy-init="false">
</bean>

<!--
Expand Down Expand Up @@ -279,11 +279,11 @@
</bean>

<!-- The uber-process factory used by GeoServer -->
<bean id="wpsProcessors" class="org.geoserver.wps.process.GeoServerProcessors"/>
<bean id="wpsProcessors" class="org.geoserver.wps.process.GeoServerProcessors" lazy-init="false"/>

<!-- The default process filters -->
<bean id="unsupportedParameterTypeProcessFilter" class="org.geoserver.wps.UnsupportedParameterTypeProcessFilter"/>
<bean id="configuredProcessesFilter" class="org.geoserver.wps.DisabledProcessesSelector"/>
<bean id="unsupportedParameterTypeProcessFilter" class="org.geoserver.wps.UnsupportedParameterTypeProcessFilter" lazy-init="false"/>
<bean id="configuredProcessesFilter" class="org.geoserver.wps.DisabledProcessesSelector" lazy-init="false"/>

<bean id="wpsLocalWorkspaceURLManger" class="org.geoserver.ows.LocalWorkspaceURLMangler">
<constructor-arg value="wps"/>
Expand All @@ -293,17 +293,17 @@
<constructor-arg ref="wpsResourceManager"/>
</bean>

<bean id="coverageResourceListener" class="org.geoserver.wps.resource.CoverageResourceListener">
<bean id="coverageResourceListener" class="org.geoserver.wps.resource.CoverageResourceListener" lazy-init="false">
<constructor-arg ref="wpsResourceManager"/>
<constructor-arg ref="coverageCleaner"/>
</bean>

<!-- Input limits support -->
<bean id="processLimitsFilter" class="org.geoserver.wps.validator.ProcessLimitsFilter" >
<bean id="processLimitsFilter" class="org.geoserver.wps.validator.ProcessLimitsFilter" lazy-init="false">
<constructor-arg index="0" ref="geoServer"/>
</bean>
<!-- Size estimation portion of limits -->
<bean id="objectSizeEstimators" class="org.geoserver.wps.validator.ObjectSizeEstimators"/>
<bean id="objectSizeEstimators" class="org.geoserver.wps.validator.ObjectSizeEstimators" lazy-init="false"/>
<bean id="featureSizeEstimators" class="org.geoserver.wps.validator.FeatureSizeEstimator"/>
<bean id="rasterSizeEstimators" class="org.geoserver.wps.validator.RasterSizeEstimator"/>
<bean id="rawDataSizeEstimator" class="org.geoserver.wps.validator.RawDataSizeEstimator"/>
Expand Down
@@ -1,3 +1,7 @@
/* (c) 2014 - 2015Open Source Geospatial Foundation - all rights reserved
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
*/
package org.geoserver.wps;

import static org.junit.Assert.assertNotNull;
Expand All @@ -10,6 +14,7 @@ public class GeoServerFactoryExtensionTest extends WPSTestSupport {
@Override
protected void setUpTestData(SystemTestData testData) throws Exception {
// do nothing, we don't need data for this test
testData.setUpSecurity();
}

@Test
Expand Down
@@ -1,4 +1,4 @@
/* (c) 2014 Open Source Geospatial Foundation - all rights reserved
/* (c) 2014 -2015 Open Source Geospatial Foundation - all rights reserved
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
*/
Expand Down Expand Up @@ -36,6 +36,7 @@ public class InputLimitsTest extends WPSTestSupport {
@Override
protected void setUpTestData(SystemTestData testData) throws Exception {
// need no layers for this test
testData.setUpSecurity();
}

@Before
Expand All @@ -44,6 +45,14 @@ public void setUpInternal() throws Exception {
MonkeyProcess.clearCommands();
}

@Before
public void resetExecutionTimes() throws Exception {
WPSInfo wps = getGeoServer().getService(WPSInfo.class);
wps.setMaxSynchronousExecutionTime(0);
wps.setMaxAsynchronousExecutionTime(0);
getGeoServer().save(wps);
}

@Override
protected void onSetUp(SystemTestData testData) throws Exception {
super.onSetUp(testData);
Expand All @@ -56,10 +65,6 @@ protected void onSetUp(SystemTestData testData) throws Exception {
// global size limits
wps.setMaxComplexInputSize(10);

// max execution times
wps.setMaxSynchronousExecutionTime(1);
wps.setMaxAsynchronousExecutionTime(2);

// for the buffer process
ProcessGroupInfo geoGroup = new ProcessGroupInfoImpl();
geoGroup.setFactoryClass(GeometryProcessFactory.class);
Expand Down Expand Up @@ -521,7 +526,7 @@ public void testCountourLevelsOutOfRange() throws Exception {
+ " </wps:ResponseForm>\n" + "</wps:Execute>";

Document dom = postAsDOM("wps", xml);
print(dom);
// print(dom);
assertXpathExists("//wps:Status/wps:ProcessFailed", dom);

assertXpathExists("//wps:Status/wps:ProcessFailed", dom);
Expand All @@ -537,6 +542,10 @@ public void testCountourLevelsOutOfRange() throws Exception {

@Test
public void testAsyncExecutionLimits() throws Exception {
WPSInfo wps = getGeoServer().getService(WPSInfo.class);
wps.setMaxAsynchronousExecutionTime(2);
getGeoServer().save(wps);

// submit asynch request with no updates
String request = "wps?service=WPS&version=1.0.0&request=Execute&Identifier=gs:Monkey&storeExecuteResponse=true&DataInputs="
+ urlEncode("id=x2");
Expand Down Expand Up @@ -570,6 +579,10 @@ public Void call() throws Exception {

@Test
public void testSyncExecutionLimits() throws Exception {
WPSInfo wps = getGeoServer().getService(WPSInfo.class);
wps.setMaxSynchronousExecutionTime(1);
getGeoServer().save(wps);

// setup the set of commands for the monkey process
MonkeyProcess.wait("x2", 2000);
MonkeyProcess.progress("x2", 50f, false);
Expand Down
2 changes: 1 addition & 1 deletion src/gwc/src/main/resources/applicationContext.xml
Expand Up @@ -19,7 +19,7 @@
<constructor-arg index="1" ref="geoServerSecurityManager"/>
</bean>

<bean id="gwcFacade" class="org.geoserver.gwc.GWC" depends-on="geoWebCacheExtensions">
<bean id="gwcFacade" class="org.geoserver.gwc.GWC" depends-on="geoWebCacheExtensions" lazy-init="false">
<constructor-arg ref="gwcGeoServervConfigPersister" />
<constructor-arg ref="gwcStorageBroker" />
<constructor-arg ref="gwcTLDispatcher" />
Expand Down
@@ -1,4 +1,4 @@
/* (c) 2014 Open Source Geospatial Foundation - all rights reserved
/* (c) 2014 -2015 Open Source Geospatial Foundation - all rights reserved
* (c) 2001 - 2013 OpenPlans
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
Expand Down Expand Up @@ -28,6 +28,7 @@ public class GWCQuotaStoreDisabledTest extends GeoServerSystemTestSupport {
protected void setUpTestData(SystemTestData testData) throws Exception {
// disable disk quota completely
System.setProperty(DiskQuotaMonitor.GWC_DISKQUOTA_DISABLED, "true");
testData.setUpSecurity();
}

@After
Expand Down
6 changes: 3 additions & 3 deletions src/main/src/main/java/applicationContext.xml
Expand Up @@ -28,7 +28,7 @@
<constructor-arg ref="resourceLoader"/>
</bean>

<bean id="manifestLoader" class="org.geoserver.ManifestLoader">
<bean id="manifestLoader" class="org.geoserver.ManifestLoader" lazy-init="false">
<constructor-arg ref="resourceLoader"/>
</bean>

Expand Down Expand Up @@ -205,11 +205,11 @@
<constructor-arg ref="geoServer"/>
</bean>

<bean id="updateSequenceListener" class="org.geoserver.config.UpdateSequenceListener">
<bean id="updateSequenceListener" class="org.geoserver.config.UpdateSequenceListener" lazy-init="false">
<constructor-arg ref="geoServer"/>
</bean>

<bean id="namespaceWorkspaceConsistencyListener" class="org.geoserver.catalog.NamespaceWorkspaceConsistencyListener">
<bean id="namespaceWorkspaceConsistencyListener" class="org.geoserver.catalog.NamespaceWorkspaceConsistencyListener" lazy-init="false">
<constructor-arg ref="catalog"/>
</bean>

Expand Down
@@ -1,4 +1,4 @@
/* (c) 2014-2015 Open Source Geospatial Foundation - all rights reserved
/* (c) 2014 - 2015 Open Source Geospatial Foundation - all rights reserved
* (c) 2001 - 2013 OpenPlans
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
Expand Down Expand Up @@ -35,6 +35,7 @@
import org.geoserver.catalog.CoverageView;
import org.geoserver.catalog.CoverageView.CoverageBand;
import org.geoserver.catalog.CoverageView.InputCoverageBand;
import org.geoserver.catalog.DataLinkInfo;
import org.geoserver.catalog.DataStoreInfo;
import org.geoserver.catalog.FeatureTypeInfo;
import org.geoserver.catalog.Keyword;
Expand Down Expand Up @@ -138,15 +139,14 @@
import com.thoughtworks.xstream.converters.reflection.ReflectionConverter;
import com.thoughtworks.xstream.converters.reflection.ReflectionProvider;
import com.thoughtworks.xstream.converters.reflection.SortableFieldKeySorter;
import com.thoughtworks.xstream.converters.reflection.Sun14ReflectionProvider;
import com.thoughtworks.xstream.converters.reflection.SunUnsafeReflectionProvider;
import com.thoughtworks.xstream.io.ExtendedHierarchicalStreamWriterHelper;
import com.thoughtworks.xstream.io.HierarchicalStreamDriver;
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
import com.thoughtworks.xstream.mapper.ClassAliasingMapper;
import com.thoughtworks.xstream.mapper.Mapper;
import com.vividsolutions.jts.geom.Geometry;
import org.geoserver.catalog.DataLinkInfo;

/**
* Utility class which loads and saves catalog and configuration objects to and
Expand Down Expand Up @@ -678,7 +678,7 @@ protected Class impl(Class interfce) {
* Custom reflection provider which unwraps proxies, and skips empty collections
* and maps.
*/
class CustomReflectionProvider extends Sun14ReflectionProvider {
class CustomReflectionProvider extends SunUnsafeReflectionProvider {

public CustomReflectionProvider( FieldDictionary fd ) {
super( fd );
Expand Down

0 comments on commit ed61387

Please sign in to comment.