Changeset 32088 for gs3-extensions/solr/trunk/src/perllib/solrutil.pm
- Timestamp:
- 2017-12-08T17:58:07+13:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs3-extensions/solr/trunk/src/perllib/solrutil.pm
r31490 r32088 112 112 } 113 113 114 115 sub open_post_pipe 114 sub get_post_pipe_cmd 116 115 { 117 116 my ($core, $solr_base_url) = @_; … … 125 124 126 125 # Now run solr-post command 126 # See https://wiki.apache.org/solr/UpdateXmlMessages 127 # also https://lucene.apache.org/solr/4_2_1/tutorial.html 128 # suffixing commit=true/commitWithin=10000 to solr's /update servlet didn't work, because 129 # when using SimplePostTool, the commit only happens after the pipe to the tool is closed 127 130 my $post_props = "-Durl=$solr_base_url/$core/update"; # robustness of protocol is taken care of too 128 131 129 132 $post_props .= " -Ddata=stdin"; 130 133 $post_props .= " -Dcommit=yes"; 134 135 # increased VM mem from 512 to 1024, but increasing to 2048M didn't help either when too much 136 # data streamed to SimplePostTool before commit. Nothing works short of committing before the 137 # data streamed gets too large. The solution is to close and reopen the pipe to force commits. 138 my $post_java_cmd = "java -Xmx1024M $post_props -jar \"$full_post_jar\""; 131 139 132 my $post_java_cmd = "java -Xmx512M $post_props -jar \"$full_post_jar\"";140 ##print STDERR "**** post cmd = $post_java_cmd\n"; 133 141 134 ##print STDERR "**** post cmd = $post_java_cmd\n"; 142 return $post_java_cmd; 143 } 144 145 sub open_post_pipe 146 { 147 my ($core, $solr_base_url) = @_; 148 my $post_java_cmd = &get_post_pipe_cmd($core, $solr_base_url); 149 150 open (PIPEOUT, "| $post_java_cmd") 151 || die "Error in solr_passes.pl: Failed to run $post_java_cmd\n!$\n"; 152 153 return $post_java_cmd; # return the post_java_cmd so caller can store it and reopen_post_pipe() 154 } 155 156 sub reopen_post_pipe 157 { 158 my $post_java_cmd = shift(@_); 135 159 136 160 open (PIPEOUT, "| $post_java_cmd") 137 || die "Error in solr _passes.pl: Failed to run $post_java_cmd\n!$\n";161 || die "Error in solrutil::reopen_post_pipe: Failed to run $post_java_cmd\n!$\n"; 138 162 139 163 }
Note:
See TracChangeset
for help on using the changeset viewer.