Author: frm
Date: Thu Nov  1 10:31:15 2018
New Revision: 1845437

URL: http://svn.apache.org/viewvc?rev=1845437&view=rev
Log:
OAK-7864 - Log Segment Store read operations

Contribution by Axel Hanikel.

Modified:
    
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/CachingSegmentReader.java
    
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/LoggingHook.java

Modified: 
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/CachingSegmentReader.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/CachingSegmentReader.java?rev=1845437&r1=1845436&r2=1845437&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/CachingSegmentReader.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/CachingSegmentReader.java
 Thu Nov  1 10:31:15 2018
@@ -24,11 +24,14 @@ import static com.google.common.base.Pre
 import com.google.common.base.Function;
 import com.google.common.base.Supplier;
 import org.apache.jackrabbit.oak.cache.CacheStats;
+import org.apache.jackrabbit.oak.segment.tool.LoggingHook;
 import org.apache.jackrabbit.oak.spi.blob.BlobStore;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.apache.jackrabbit.oak.stats.MeterStats;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * This {@code SegmentReader} implementation implements caching for
@@ -38,6 +41,8 @@ public class CachingSegmentReader implem
     public static final int DEFAULT_STRING_CACHE_MB = 256;
     public static final int DEFAULT_TEMPLATE_CACHE_MB = 64;
 
+    private static final Logger LOG = 
LoggerFactory.getLogger(LoggingHook.class.getName() + ".reader");
+
     @NotNull
     private final Supplier<SegmentWriter> writer;
 
@@ -127,6 +132,7 @@ public class CachingSegmentReader implem
     @NotNull
     @Override
     public SegmentNodeState readNode(@NotNull RecordId id) {
+        LOG.trace(System.currentTimeMillis() + " " + 
LoggingHook.urlEncode(Thread.currentThread().getName()) + " n? " + 
id.toString());
         return new SegmentNodeState(this, writer, blobStore, id, readStats);
     }
 
@@ -140,6 +146,7 @@ public class CachingSegmentReader implem
     @Override
     public SegmentPropertyState readProperty(
             @NotNull RecordId id, @NotNull PropertyTemplate template) {
+        LOG.trace(System.currentTimeMillis() + " " + 
LoggingHook.urlEncode(Thread.currentThread().getName()) + " p? " + 
id.toString());
         return new SegmentPropertyState(this, id, template);
     }
 

Modified: 
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/LoggingHook.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/LoggingHook.java?rev=1845437&r1=1845436&r2=1845437&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/LoggingHook.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/LoggingHook.java
 Thu Nov  1 10:31:15 2018
@@ -130,7 +130,7 @@ public class LoggingHook implements Comm
         return val.toString();
     }
 
-    private static String urlEncode(String s) {
+    public static String urlEncode(String s) {
         String ret;
         try {
             ret = URLEncoder.encode(s, "UTF-8").replace("%2F", 
"/").replace("%3A", ":");


Reply via email to