Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: DSpace/DSpace
...
head fork: DSpace/DSpace
  • 3 commits
  • 1 file changed
  • 0 commit comments
  • 3 contributors
Commits on Apr 02, 2014
@Mini-Pillai Mini-Pillai Fix SolrLogger Memory Error 20fb12c
Commits on Apr 17, 2014
@mdiggory mdiggory Remove Commented out line. a54d314
Commits on May 22, 2014
@mwoodiupui mwoodiupui Merge pull request #515 from atmire/DS-1958
 DS-1958 Fix SolrLogger Memory Error
54e0e64
Showing with 5 additions and 18 deletions.
  1. +5 −18 dspace-api/src/main/java/org/dspace/discovery/SolrServiceImpl.java
View
23 dspace-api/src/main/java/org/dspace/discovery/SolrServiceImpl.java
@@ -40,6 +40,7 @@
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.io.IOUtils;
+import org.apache.commons.io.input.AutoCloseInputStream;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.time.DateFormatUtils;
@@ -1300,7 +1301,6 @@ protected void buildDocument(Context context, Item item)
log.debug(" Added Grouping");
- Vector<InputStreamReader> readers = new Vector<InputStreamReader>();
try {
// now get full text of any bitstreams in the TEXT bundle
@@ -1318,17 +1318,12 @@ protected void buildDocument(Context context, Item item)
for (Bitstream myBitstream : myBitstreams)
{
try {
- InputStreamReader is = new InputStreamReader(
- myBitstream.retrieve()); // get input
- readers.add(is);
- // Add each InputStream to the Indexed Document
- String value = IOUtils.toString(is);
- doc.addField("fulltext", value);
+ doc.addField("fulltext", new AutoCloseInputStream(myBitstream.retrieve()));
if(hitHighlightingFields.contains("*") || hitHighlightingFields.contains("fulltext"))
{
- doc.addField("fulltext_hl", value);
+ doc.addField("fulltext_hl", new AutoCloseInputStream(myBitstream.retrieve()));
}
log.debug(" Added BitStream: "
@@ -1349,16 +1344,6 @@ protected void buildDocument(Context context, Item item)
{
log.error(e.getMessage(), e);
}
- finally {
- Iterator<InputStreamReader> itr = readers.iterator();
- while (itr.hasNext()) {
- InputStreamReader reader = itr.next();
- if (reader != null) {
- reader.close();
- }
- }
- log.debug("closed " + readers.size() + " readers");
- }
//Do any additional indexing, depends on the plugins
List<SolrServiceIndexPlugin> solrServiceIndexPlugins = new DSpace().getServiceManager().getServicesByType(SolrServiceIndexPlugin.class);
@@ -1377,6 +1362,8 @@ protected void buildDocument(Context context, Item item)
}
}
+
+
/**
* Create Lucene document with all the shared fields initialized.
*

No commit comments for this range

Something went wrong with that request. Please try again.