jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1299746 - in /jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit: state/EmptyNodeState.java state/PersistentNodeState.java state/TransientNodeState.java utils/PagedIterator.java
Date Mon, 12 Mar 2012 17:23:40 GMT
Author: mduerig
Date: Mon Mar 12 17:23:39 2012
New Revision: 1299746

URL: http://svn.apache.org/viewvc?rev=1299746&view=rev
Log:
Microkernel based prototype of JCR implementation (WIP)
- Adapt to changes from OAK-10 

Modified:
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/EmptyNodeState.java
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/PersistentNodeState.java
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientNodeState.java
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/utils/PagedIterator.java

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/EmptyNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/EmptyNodeState.java?rev=1299746&r1=1299745&r2=1299746&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/EmptyNodeState.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/EmptyNodeState.java
Mon Mar 12 17:23:39 2012
@@ -46,7 +46,7 @@ public final class EmptyNodeState extend
     }
 
     @Override
-    public Iterable<ChildNodeEntry> getChildNodeEntries(long offset, long length) {
+    public Iterable<ChildNodeEntry> getChildNodeEntries(long offset, int count) {
         return new Iterable<ChildNodeEntry>() {
             @Override
             public Iterator<ChildNodeEntry> iterator() {

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/PersistentNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/PersistentNodeState.java?rev=1299746&r1=1299745&r2=1299746&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/PersistentNodeState.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/PersistentNodeState.java
Mon Mar 12 17:23:39 2012
@@ -107,9 +107,8 @@ public class PersistentNodeState extends
     }
 
     @Override
-    public Iterable<? extends ChildNodeEntry> getChildNodeEntries(final long offset,
final long length) {
-        // fixme: microkernel should also use long for length (OAK-10)
-        String json = microkernel.getNodes(path.toMkPath(), revision, 1, offset, (int) length,
null);
+    public Iterable<? extends ChildNodeEntry> getChildNodeEntries(final long offset,
final int count) {
+        String json = microkernel.getNodes(path.toMkPath(), revision, 1, offset, count, null);
         final List<ChildNodeEntry> childNodeEntries = new ArrayList<ChildNodeEntry>();
 
         new JsonParser(new JsonHandler(){

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientNodeState.java?rev=1299746&r1=1299745&r2=1299746&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientNodeState.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientNodeState.java
Mon Mar 12 17:23:39 2012
@@ -46,7 +46,7 @@ import static org.apache.jackrabbit.util
  * to a {@code PersistedNodeState}.
  */
 public class TransientNodeState {
-    private static final long BATCH_SIZE = 256;
+    private static final int BATCH_SIZE = 256;
 
     private final Context sessionContext;
 
@@ -154,7 +154,7 @@ public class TransientNodeState {
         Iterator<? extends ChildNodeEntry> persistedEntries = flatten(
             new PagedIterator<ChildNodeEntry>(BATCH_SIZE) {
                 @Override
-                protected Iterator<? extends ChildNodeEntry> getPage(long pos, long
size) {
+                protected Iterator<? extends ChildNodeEntry> getPage(long pos, int
size) {
                     return getPersistentNodeState().getChildNodeEntries(pos, size).iterator();
                 }
         });

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/utils/PagedIterator.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/utils/PagedIterator.java?rev=1299746&r1=1299745&r2=1299746&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/utils/PagedIterator.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/utils/PagedIterator.java
Mon Mar 12 17:23:39 2012
@@ -33,11 +33,11 @@ import java.util.NoSuchElementException;
  * @param <T>
  */
 public abstract class PagedIterator<T> implements Iterator<Iterator<? extends
T>> {
-    private final long pageSize;
+    private final int pageSize;
     private long pos;
     private Iterator<? extends T> current;
 
-    protected PagedIterator(long pageSize) {
+    protected PagedIterator(int pageSize) {
         this.pageSize = pageSize;
     }
 
@@ -46,7 +46,7 @@ public abstract class PagedIterator<T> i
      * @param size  maximal number of elements
      * @return  iterator starting at index {@code pos} containing at most {@code size} elements.
      */
-    protected abstract Iterator<? extends T> getPage(long pos, long size);
+    protected abstract Iterator<? extends T> getPage(long pos, int size);
 
     @Override
     public boolean hasNext() {



Mime
View raw message