Author: jens
Date: Fri Sep 14 04:34:42 2012
New Revision: 1384641
URL: http://svn.apache.org/viewvc?rev=1384641&view=rev
Log:
add ability to log content size added to InMemory store
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/ContentStreamDataImpl.java
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/ContentStreamDataImpl.java
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/ContentStreamDataImpl.java?rev=1384641&r1=1384640&r2=1384641&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/ContentStreamDataImpl.java
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/ContentStreamDataImpl.java
Fri Sep 14 04:34:42 2012
@@ -33,9 +33,16 @@ import org.apache.chemistry.opencmis.com
import org.apache.chemistry.opencmis.commons.data.ContentStream;
import org.apache.chemistry.opencmis.commons.data.LastModifiedContentStream;
import
org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class ContentStreamDataImpl implements LastModifiedContentStream {
+ private static final Logger LOG =
LoggerFactory.getLogger(ContentStreamDataImpl.class.getName());
+
+ private static long TOTAL_LENGTH = 0L;
+ private static long TOTAL_CALLS = 0L;
+
private int fLength;
private String fMimeType;
@@ -77,6 +84,10 @@ public class ContentStreamDataImpl imple
contentStream.close();
in.close();
}
+ TOTAL_LENGTH += fLength;
+ LOG.debug("setting content stream, total no calls " + ++TOTAL_CALLS +
".");
+ LOG.debug("setting content stream, new size total " + (TOTAL_LENGTH /
(1024 * 1024)) + "MB.");
+
}
public long getLength() {