This repository was archived by the owner on Sep 16, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +24
-2
lines changed
main/java/com/marklogic/appdeployer
test/java/com/marklogic/appdeployer Expand file tree Collapse file tree 6 files changed +24
-2
lines changed Original file line number Diff line number Diff line change 11group =com.marklogic
22javadocsDir =../gh-pages-marklogic-java/javadocs
3- version =3.3.1
4- mlJavaclientUtilVersion =3.3.1
3+ version =3.4-beta1
4+ mlJavaclientUtilVersion =3.4-beta1
55mlJunitVersion =3.1.0
66
Original file line number Diff line number Diff line change @@ -114,6 +114,7 @@ public class AppConfig {
114114 private boolean deleteTestModules = false ;
115115 private String deleteTestModulesPattern = "/test/**" ;
116116 private int modulesLoaderThreadCount = 8 ;
117+ private Integer modulesLoaderBatchSize ;
117118
118119 private String schemasPath ;
119120
@@ -1186,4 +1187,12 @@ public boolean isSortOtherDatabaseByDependencies() {
11861187 public void setSortOtherDatabaseByDependencies (boolean sortOtherDatabaseByDependencies ) {
11871188 this .sortOtherDatabaseByDependencies = sortOtherDatabaseByDependencies ;
11881189 }
1190+
1191+ public Integer getModulesLoaderBatchSize () {
1192+ return modulesLoaderBatchSize ;
1193+ }
1194+
1195+ public void setModulesLoaderBatchSize (Integer modulesLoaderBatchSize ) {
1196+ this .modulesLoaderBatchSize = modulesLoaderBatchSize ;
1197+ }
11891198}
Original file line number Diff line number Diff line change @@ -588,6 +588,12 @@ public AppConfig newAppConfig() {
588588 c .setModulesLoaderThreadCount (Integer .parseInt (prop ));
589589 }
590590
591+ prop = getProperty ("mlModulesLoaderBatchSize" );
592+ if (prop != null ) {
593+ logger .info ("Modules loader batch size: " + prop );
594+ c .setModulesLoaderBatchSize (Integer .parseInt (prop ));
595+ }
596+
591597 /**
592598 * The following properties are all for generating Entity Services artifacts.
593599 */
Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ public ModulesLoader newModulesLoader(AppConfig appConfig) {
3232 RestBatchWriter assetBatchWriter = new RestBatchWriter (appConfig .newModulesDatabaseClient (), false );
3333 assetBatchWriter .setThreadCount (threadCount );
3434 AssetFileLoader assetFileLoader = new AssetFileLoader (assetBatchWriter , modulesManager );
35+ if (appConfig .getModulesLoaderBatchSize () != null ) {
36+ assetFileLoader .setBatchSize (appConfig .getModulesLoaderBatchSize ());
37+ }
3538
3639 String permissions = appConfig .getModulePermissions ();
3740 if (permissions != null ) {
Original file line number Diff line number Diff line change @@ -138,6 +138,7 @@ public void allProperties() {
138138 p .setProperty ("mlDeleteTestModules" , "true" );
139139 p .setProperty ("mlDeleteTestModulesPattern" , "/some/pattern" );
140140 p .setProperty ("mlModulesLoaderThreadCount" , "3" );
141+ p .setProperty ("mlModulesLoaderBatchSize" , "79" );
141142
142143 p .setProperty ("mlModelsPath" , "ml/models" );
143144 p .setProperty ("mlInstanceConverterPath" , "ext/my/path" );
@@ -239,6 +240,7 @@ public void allProperties() {
239240 assertTrue (config .isDeleteTestModules ());
240241 assertEquals ("/some/pattern" , config .getDeleteTestModulesPattern ());
241242 assertEquals (3 , config .getModulesLoaderThreadCount ());
243+ assertEquals (new Integer (79 ), config .getModulesLoaderBatchSize ());
242244
243245 assertEquals ("ml/models" , config .getModelsPath ());
244246 assertEquals ("ext/my/path" , config .getInstanceConverterPath ());
Original file line number Diff line number Diff line change @@ -71,6 +71,8 @@ public void customModuleTimestampsPath() {
7171
7272 @ Test
7373 public void loadModulesFromMultiplePaths () {
74+ // Setting batch size to make sure nothing blows up
75+ appConfig .setModulesLoaderBatchSize (1 );
7476 appConfig .getModulePaths ().add ("src/test/resources/sample-app/build/mlRestApi/some-library/ml-modules" );
7577
7678 initializeAppDeployer (new DeployRestApiServersCommand (true ), buildLoadModulesCommand ());
You can’t perform that action at this time.
0 commit comments