exo-jcr SVN: r4343 - jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-05-05 04:38:08 -0400 (Thu, 05 May 2011)
New Revision: 4343
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/RdbmsWorkspaceInitializer.java
Log:
EXOJCR-1331: Cache can contain NullNodeData for root node after RDBMS restore
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/RdbmsWorkspaceInitializer.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/RdbmsWorkspaceInitializer.java 2011-05-05 07:18:58 UTC (rev 4342)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/RdbmsWorkspaceInitializer.java 2011-05-05 08:38:08 UTC (rev 4343)
@@ -63,6 +63,11 @@
protected final RepositoryService repositoryService;
/**
+ * Indicates if RDBMS restore in progress or not.
+ */
+ volatile private boolean isRestoreInProgress = false;
+
+ /**
* Constructor RdbmsWorkspaceInitializer.
*/
public RdbmsWorkspaceInitializer(WorkspaceEntry config, RepositoryEntry repConfig,
@@ -81,6 +86,17 @@
* {@inheritDoc}
*/
@Override
+ public boolean isWorkspaceInitialized()
+ {
+ // If someone invoke isWorkspaceInitialized() during restore then NullNodeData for root node will be pushed
+ // into the cache and will be there even restore is finished and data will be placed into DB.
+ return isRestoreInProgress ? false : super.isWorkspaceInitialized();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
public NodeData initWorkspace() throws RepositoryException
{
if (isWorkspaceInitialized())
@@ -90,7 +106,15 @@
long start = System.currentTimeMillis();
- restoreAction();
+ isRestoreInProgress = true;
+ try
+ {
+ restoreAction();
+ }
+ finally
+ {
+ isRestoreInProgress = false;
+ }
final NodeData root = (NodeData)dataManager.getItemData(Constants.ROOT_UUID);
13 years
exo-jcr SVN: r4342 - jcr/trunk/exo.jcr.component.core/src/main/resources/conf/storage.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-05-05 03:18:58 -0400 (Thu, 05 May 2011)
New Revision: 4342
Modified:
jcr/trunk/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.sql
jcr/trunk/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.sql
Log:
EXOJCR-1330: increase size for DATA field of JCR_M(S)VALUE table
Modified: jcr/trunk/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.sql
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.sql 2011-05-02 09:59:35 UTC (rev 4341)
+++ jcr/trunk/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.sql 2011-05-05 07:18:58 UTC (rev 4342)
@@ -20,7 +20,7 @@
CREATE UNIQUE INDEX JCR_IDX_MITEM_PARENT_ID ON JCR_MITEM(I_CLASS, PARENT_ID, ID, VERSION DESC);
CREATE TABLE JCR_MVALUE(
ID BIGINT generated by default as identity (START WITH 2) NOT NULL,
- DATA VARBINARY(65535),
+ DATA VARBINARY(16777216),
ORDER_NUM INTEGER NOT NULL,
PROPERTY_ID VARCHAR(96) NOT NULL,
STORAGE_DESC VARCHAR(512),
Modified: jcr/trunk/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.sql
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.sql 2011-05-02 09:59:35 UTC (rev 4341)
+++ jcr/trunk/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.sql 2011-05-05 07:18:58 UTC (rev 4342)
@@ -21,7 +21,7 @@
CREATE UNIQUE INDEX JCR_IDX_SITEM_PARENT_ID ON JCR_SITEM(I_CLASS, CONTAINER_NAME, PARENT_ID, ID, VERSION DESC);
CREATE TABLE JCR_SVALUE(
ID BIGINT generated by default as identity (START WITH 2) NOT NULL,
- DATA VARBINARY(65535),
+ DATA VARBINARY(16777216),
ORDER_NUM INTEGER NOT NULL,
PROPERTY_ID VARCHAR(96) NOT NULL,
STORAGE_DESC VARCHAR(512),
13 years
exo-jcr SVN: r4341 - core/trunk/exo.core.component.web.css/src/main/java/org/exoplatform/services/web/css and 4 other directories.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2011-05-02 05:59:35 -0400 (Mon, 02 May 2011)
New Revision: 4341
Modified:
core/trunk/exo.core.component.script.groovy/src/main/java/org/exoplatform/services/script/groovy/jarjar/JarJarExpressionTransformer.java
core/trunk/exo.core.component.web.css/src/main/java/org/exoplatform/services/web/css/FSScanner.java
ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/Codecs.java
ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java
ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/LinkedList.java
ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/URI.java
ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/wadl/BaseWadlGeneratorImpl.java
ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/GroovyJaxrsPublisher.java
ws/trunk/exo.ws.testframework/src/main/java/org/exoplatform/services/test/mock/MockServletContext.java
Log:
EXOJCR-1221: Fixed the last blocker and critical violation. If it could not be fixed the tag NOSONAR has been used
Modified: core/trunk/exo.core.component.script.groovy/src/main/java/org/exoplatform/services/script/groovy/jarjar/JarJarExpressionTransformer.java
===================================================================
--- core/trunk/exo.core.component.script.groovy/src/main/java/org/exoplatform/services/script/groovy/jarjar/JarJarExpressionTransformer.java 2011-04-29 19:33:18 UTC (rev 4340)
+++ core/trunk/exo.core.component.script.groovy/src/main/java/org/exoplatform/services/script/groovy/jarjar/JarJarExpressionTransformer.java 2011-05-02 09:59:35 UTC (rev 4341)
@@ -93,7 +93,7 @@
if (ss != null)
{
- System.out.println(s + " -> " + ss);
+ System.out.println(s + " -> " + ss); //NOSONAR
return createExpr(ss);
}
Modified: core/trunk/exo.core.component.web.css/src/main/java/org/exoplatform/services/web/css/FSScanner.java
===================================================================
--- core/trunk/exo.core.component.web.css/src/main/java/org/exoplatform/services/web/css/FSScanner.java 2011-04-29 19:33:18 UTC (rev 4340)
+++ core/trunk/exo.core.component.web.css/src/main/java/org/exoplatform/services/web/css/FSScanner.java 2011-05-02 09:59:35 UTC (rev 4341)
@@ -53,7 +53,7 @@
{
doScan(root);
int ratio = (size2 * 100) / size1;
- System.out.println("ratio = " + ratio);
+ System.out.println("ratio = " + ratio); //NOSONAR
}
private void doScan(File f)
@@ -67,7 +67,7 @@
}
else if (f.isFile() && f.getName().endsWith(".css"))
{
- System.out.println("About to process " + f.getAbsolutePath());
+ System.out.println("About to process " + f.getAbsolutePath()); //NOSONAR
try
{
FileReader reader = new FileReader(f);
@@ -95,11 +95,11 @@
}
catch (IOException e)
{
- e.printStackTrace(System.err);
+ e.printStackTrace(System.err); //NOSONAR
}
catch (UnsupportedOperationException e)
{
- e.printStackTrace(System.err);
+ e.printStackTrace(System.err); //NOSONAR
}
}
}
Modified: ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/Codecs.java
===================================================================
--- ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/Codecs.java 2011-04-29 19:33:18 UTC (rev 4340)
+++ ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/Codecs.java 2011-05-02 09:59:35 UTC (rev 4341)
@@ -45,7 +45,6 @@
import java.io.UnsupportedEncodingException;
import java.net.URLConnection;
import java.util.BitSet;
-import java.util.StringTokenizer;
import java.util.Vector;
/**
@@ -350,67 +349,6 @@
}
/**
- * TBD! How to return file name and mode?
- * @param rdr the reader from which to read and decode the data
- * @exception ParseException if either the "begin" or "end" line are not
- * found, or the "begin" is incorrect
- * @exception IOException if the <var>rdr</var> throws an IOException
- */
- private final static byte[] uudecode(BufferedReader rdr) throws ParseException, IOException
- {
- String line, file_name;
- int file_mode;
-
- // search for beginning
-
- while ((line = rdr.readLine()) != null && !line.startsWith("begin "));
- if (line == null)
- throw new ParseException("'begin' line not found");
-
- // parse 'begin' line
-
- StringTokenizer tok = new StringTokenizer(line);
- tok.nextToken(); // throw away 'begin'
- try
- // extract mode
- {
- file_mode = Integer.parseInt(tok.nextToken(), 8);
- }
- catch (Exception e)
- {
- throw new ParseException("Invalid mode on line: " + line);
- }
- try
- // extract name
- {
- file_name = tok.nextToken();
- }
- catch (java.util.NoSuchElementException e)
- {
- throw new ParseException("No file name found on line: " + line);
- }
-
- // read and parse body
-
- byte[] body = new byte[1000];
- int off = 0;
-
- while ((line = rdr.readLine()) != null && !line.equals("end"))
- {
- byte[] tmp = uudecode(line.toCharArray());
- if (off + tmp.length > body.length)
- body = Util.resizeArray(body, off + 1000);
- System.arraycopy(tmp, 0, body, off, tmp.length);
- off += tmp.length;
- }
-
- if (line == null)
- throw new ParseException("'end' line not found");
-
- return Util.resizeArray(body, off);
- }
-
- /**
* This method decodes the given uuencoded char[].
* <P>
* <em>Note:</em> just the actual data is decoded; any 'begin' and 'end' lines
@@ -482,7 +420,7 @@
new char[(int)(str.length() * 1.5)], src[] =
str.toCharArray();
char ch;
- int cnt = 0, didx = 1, last = 0, slen = str.length();
+ int cnt = 0, didx = 1, slen = str.length();
for (int sidx = 0; sidx < slen; sidx++)
{
Modified: ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java
===================================================================
--- ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java 2011-04-29 19:33:18 UTC (rev 4340)
+++ ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java 2011-05-02 09:59:35 UTC (rev 4341)
@@ -1543,20 +1543,19 @@
if (challenge.getScheme().equalsIgnoreCase("SOCKS5"))
{
- System.out.println("Enter username and password for SOCKS " + "server on host " + challenge.getHost());
- System.out.println("Authentication Method: username/password");
+ System.out.println("Enter username and password for SOCKS " + "server on host " + challenge.getHost()); //NOSONAR
+ System.out.println("Authentication Method: username/password"); //NOSONAR
}
else
{
- System.out.println("Enter username and password for realm `" + challenge.getRealm() + "' on host "
- + challenge.getHost() + ":" + challenge.getPort());
- System.out.println("Authentication Scheme: " + challenge.getScheme());
+ System.out.println("Enter username and password for realm `" + challenge.getRealm() + "' on host " + challenge.getHost() + ":" + challenge.getPort()); //NOSONAR
+ System.out.println("Authentication Scheme: " + challenge.getScheme()); //NOSONAR
}
// get username
BufferedReader inp = new BufferedReader(new InputStreamReader(System.in));
- System.out.print("Username: ");
+ System.out.print("Username: "); //NOSONAR
System.out.flush();
try
{
@@ -1572,7 +1571,7 @@
// get password
echo(false);
- System.out.print("Password: ");
+ System.out.print("Password: "); //NOSONAR
System.out.flush();
try
{
@@ -1582,7 +1581,7 @@
{
return null;
}
- System.out.println();
+ System.out.println(); //NOSONAR
echo(true);
if (pass == null)
Modified: ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/LinkedList.java
===================================================================
--- ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/LinkedList.java 2011-04-29 19:33:18 UTC (rev 4340)
+++ ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/LinkedList.java 2011-05-02 09:59:35 UTC (rev 4341)
@@ -147,7 +147,7 @@
{
// LinkedList Test Suite
- System.err.println("\n*** Linked List Tests ...");
+ System.err.println("\n*** Linked List Tests ..."); //NOSONAR
LinkedList list = new LinkedList();
list.addToHead("One");
@@ -207,7 +207,7 @@
if (list.getFirst() != null)
throw new Exception("Empty list wrong");
- System.err.println("\n*** Tests finished successfuly");
+ System.err.println("\n*** Tests finished successfuly"); //NOSONAR
}
}
Modified: ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/URI.java
===================================================================
--- ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/URI.java 2011-04-29 19:33:18 UTC (rev 4340)
+++ ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/URI.java 2011-05-02 09:59:35 UTC (rev 4341)
@@ -1424,8 +1424,8 @@
*/
public static void main(String args[]) throws Exception
{
- System.err.println();
- System.err.println("*** URI Tests ...");
+ System.err.println(); //NOSONAR
+ System.err.println("*** URI Tests ..."); //NOSONAR
/*
* Relative URI test set, taken from Section C of rfc-2396 and Roy's test1.
@@ -1781,7 +1781,7 @@
testUnescape("%71there", "qthere");
testUnescape("%B1there", "\u00B1there");
- System.err.println("*** Tests finished successfuly");
+ System.err.println("*** Tests finished successfuly"); //NOSONAR
}
private static final String nl = PrivilegedSystemHelper.getProperty("line.separator");
Modified: ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/wadl/BaseWadlGeneratorImpl.java
===================================================================
--- ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/wadl/BaseWadlGeneratorImpl.java 2011-04-29 19:33:18 UTC (rev 4340)
+++ ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/wadl/BaseWadlGeneratorImpl.java 2011-05-02 09:59:35 UTC (rev 4341)
@@ -93,7 +93,7 @@
public org.exoplatform.services.rest.wadl.research.Method createMethod(ResourceMethodDescriptor rmd)
{
String httpMethod = rmd.getHttpMethod();
- // FIXME Ignore HEAD methods currently.
+ // TODO Ignore HEAD methods currently.
// Implementation of wadl2java for generation client code does not support
// HEAD method. See https://wadl.dev.java.net/ .
// If WADL contains HEAD method description then client code get part of
Modified: ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/GroovyJaxrsPublisher.java
===================================================================
--- ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/GroovyJaxrsPublisher.java 2011-04-29 19:33:18 UTC (rev 4340)
+++ ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/GroovyJaxrsPublisher.java 2011-05-02 09:59:35 UTC (rev 4341)
@@ -541,7 +541,7 @@
}
catch (RuntimeException e)
{
- // FIXME : Need have proper exception for invalid resources in 'exo.ws.rest.core'.
+ // TODO : Need have proper exception for invalid resources in 'exo.ws.rest.core'.
throw new MalformedScriptException(e.getMessage());
}*/
}
Modified: ws/trunk/exo.ws.testframework/src/main/java/org/exoplatform/services/test/mock/MockServletContext.java
===================================================================
--- ws/trunk/exo.ws.testframework/src/main/java/org/exoplatform/services/test/mock/MockServletContext.java 2011-04-29 19:33:18 UTC (rev 4340)
+++ ws/trunk/exo.ws.testframework/src/main/java/org/exoplatform/services/test/mock/MockServletContext.java 2011-05-02 09:59:35 UTC (rev 4341)
@@ -207,7 +207,7 @@
}
catch (IOException e)
{
- e.printStackTrace();
+ e.printStackTrace(); //NOSONAR
}
return null;
}
13 years