mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 15:03:18 +00:00
DS-3579: Improve cache usage rdfizer, sub-daily, doi organiser
This commit is contained in:
@@ -289,7 +289,7 @@ public class SubscribeCLITool {
|
|||||||
Context context = null;
|
Context context = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
context = new Context();
|
context = new Context(Context.Mode.READ_ONLY);
|
||||||
processDaily(context, test);
|
processDaily(context, test);
|
||||||
context.complete();
|
context.complete();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@@ -8,28 +8,12 @@
|
|||||||
|
|
||||||
package org.dspace.identifier.doi;
|
package org.dspace.identifier.doi;
|
||||||
|
|
||||||
import java.io.IOException;
|
import org.apache.commons.cli.*;
|
||||||
import java.io.PrintStream;
|
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
import org.apache.commons.cli.CommandLine;
|
|
||||||
import org.apache.commons.cli.CommandLineParser;
|
|
||||||
import org.apache.commons.cli.HelpFormatter;
|
|
||||||
import org.apache.commons.cli.Option;
|
|
||||||
import org.apache.commons.cli.OptionBuilder;
|
|
||||||
import org.apache.commons.cli.Options;
|
|
||||||
import org.apache.commons.cli.ParseException;
|
|
||||||
import org.apache.commons.cli.PosixParser;
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.factory.ContentServiceFactory;
|
import org.dspace.content.factory.ContentServiceFactory;
|
||||||
import org.dspace.content.service.ItemService;
|
import org.dspace.content.service.ItemService;
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.*;
|
||||||
import org.dspace.core.Constants;
|
|
||||||
import org.dspace.core.Context;
|
|
||||||
import org.dspace.core.Email;
|
|
||||||
import org.dspace.core.I18nUtil;
|
|
||||||
import org.dspace.handle.factory.HandleServiceFactory;
|
import org.dspace.handle.factory.HandleServiceFactory;
|
||||||
import org.dspace.handle.service.HandleService;
|
import org.dspace.handle.service.HandleService;
|
||||||
import org.dspace.identifier.DOI;
|
import org.dspace.identifier.DOI;
|
||||||
@@ -39,6 +23,11 @@ import org.dspace.identifier.factory.IdentifierServiceFactory;
|
|||||||
import org.dspace.identifier.service.DOIService;
|
import org.dspace.identifier.service.DOIService;
|
||||||
import org.dspace.utils.DSpace;
|
import org.dspace.utils.DSpace;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.PrintStream;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -203,6 +192,7 @@ public class DOIOrganiser {
|
|||||||
|
|
||||||
for (DOI doi : dois) {
|
for (DOI doi : dois) {
|
||||||
organiser.reserve(doi);
|
organiser.reserve(doi);
|
||||||
|
context.uncacheEntity(doi);
|
||||||
}
|
}
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
System.err.println("Error in database connection:" + ex.getMessage());
|
System.err.println("Error in database connection:" + ex.getMessage());
|
||||||
@@ -223,6 +213,7 @@ public class DOIOrganiser {
|
|||||||
for (DOI doi : dois)
|
for (DOI doi : dois)
|
||||||
{
|
{
|
||||||
organiser.register(doi);
|
organiser.register(doi);
|
||||||
|
context.uncacheEntity(doi);
|
||||||
}
|
}
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
System.err.println("Error in database connection:" + ex.getMessage());
|
System.err.println("Error in database connection:" + ex.getMessage());
|
||||||
@@ -247,6 +238,7 @@ public class DOIOrganiser {
|
|||||||
for (DOI doi : dois)
|
for (DOI doi : dois)
|
||||||
{
|
{
|
||||||
organiser.update(doi);
|
organiser.update(doi);
|
||||||
|
context.uncacheEntity(doi);
|
||||||
}
|
}
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
System.err.println("Error in database connection:" + ex.getMessage());
|
System.err.println("Error in database connection:" + ex.getMessage());
|
||||||
@@ -270,6 +262,7 @@ public class DOIOrganiser {
|
|||||||
DOI doi = iterator.next();
|
DOI doi = iterator.next();
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
organiser.delete(doi.getDoi());
|
organiser.delete(doi.getDoi());
|
||||||
|
context.uncacheEntity(doi);
|
||||||
}
|
}
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
System.err.println("Error in database connection:" + ex.getMessage());
|
System.err.println("Error in database connection:" + ex.getMessage());
|
||||||
|
@@ -9,29 +9,11 @@
|
|||||||
package org.dspace.rdf;
|
package org.dspace.rdf;
|
||||||
|
|
||||||
import com.hp.hpl.jena.rdf.model.Model;
|
import com.hp.hpl.jena.rdf.model.Model;
|
||||||
import java.io.PrintWriter;
|
import org.apache.commons.cli.*;
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
import java.util.concurrent.CopyOnWriteArraySet;
|
|
||||||
import org.apache.commons.cli.CommandLine;
|
|
||||||
import org.apache.commons.cli.CommandLineParser;
|
|
||||||
import org.apache.commons.cli.HelpFormatter;
|
|
||||||
import org.apache.commons.cli.Option;
|
|
||||||
import org.apache.commons.cli.OptionBuilder;
|
|
||||||
import org.apache.commons.cli.Options;
|
|
||||||
import org.apache.commons.cli.ParseException;
|
|
||||||
import org.apache.commons.cli.PosixParser;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.*;
|
||||||
import org.dspace.content.Community;
|
|
||||||
import org.dspace.content.DSpaceObject;
|
|
||||||
import org.dspace.content.Item;
|
|
||||||
import org.dspace.content.Site;
|
|
||||||
import org.dspace.content.factory.ContentServiceFactory;
|
import org.dspace.content.factory.ContentServiceFactory;
|
||||||
import org.dspace.content.service.CommunityService;
|
import org.dspace.content.service.CommunityService;
|
||||||
import org.dspace.content.service.ItemService;
|
import org.dspace.content.service.ItemService;
|
||||||
@@ -44,6 +26,14 @@ import org.dspace.rdf.storage.RDFStorage;
|
|||||||
import org.dspace.services.ConfigurationService;
|
import org.dspace.services.ConfigurationService;
|
||||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||||
|
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.CopyOnWriteArraySet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class manages the handling of RDF data in DSpace. It generates
|
* This class manages the handling of RDF data in DSpace. It generates
|
||||||
* identifiers, it loads data, it manages the conversion of DSpace Objects into
|
* identifiers, it loads data, it manages the conversion of DSpace Objects into
|
||||||
@@ -443,8 +433,9 @@ public class RDFizer {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
callback.callback(dso);
|
callback.callback(dso);
|
||||||
report("Processed " + contentServiceFactory.getDSpaceObjectService(dso).getTypeText(dso) + " " + dso.getID()
|
report("Processed " + contentServiceFactory.getDSpaceObjectService(dso).getTypeText(dso) + " " + dso.getID()
|
||||||
+ " (handle " + dso.getHandle() + ").");
|
+ " (handle " + dso.getHandle() + ").");
|
||||||
|
context.uncacheEntity(dso);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean isProcessed(DSpaceObject dso)
|
protected boolean isProcessed(DSpaceObject dso)
|
||||||
|
Reference in New Issue
Block a user