apex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject [10/50] [abbrv] incubator-apex-malhar git commit: MLHR-1931 #resolve #comment modified readFully to return values as Slice
Date Fri, 29 Jan 2016 19:12:27 GMT
MLHR-1931 #resolve #comment modified readFully to return values as Slice


Project: http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/commit/b067525d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/tree/b067525d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/diff/b067525d

Branch: refs/heads/master
Commit: b067525de65ad889880ef3fcaa43ddef57e43f22
Parents: 480d6ed
Author: Chandni Singh <csingh@apache.org>
Authored: Wed Dec 16 09:27:08 2015 -0800
Committer: Chandni Singh <csingh@apache.org>
Committed: Wed Dec 16 09:27:30 2015 -0800

----------------------------------------------------------------------
 .../main/java/com/datatorrent/lib/fileaccess/DTFileReader.java   | 4 ++--
 .../src/main/java/com/datatorrent/lib/fileaccess/FileAccess.java | 4 +---
 .../main/java/com/datatorrent/lib/fileaccess/TFileReader.java    | 4 ++--
 3 files changed, 5 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/b067525d/library/src/main/java/com/datatorrent/lib/fileaccess/DTFileReader.java
----------------------------------------------------------------------
diff --git a/library/src/main/java/com/datatorrent/lib/fileaccess/DTFileReader.java b/library/src/main/java/com/datatorrent/lib/fileaccess/DTFileReader.java
index cb97520..6dca462 100644
--- a/library/src/main/java/com/datatorrent/lib/fileaccess/DTFileReader.java
+++ b/library/src/main/java/com/datatorrent/lib/fileaccess/DTFileReader.java
@@ -68,13 +68,13 @@ public class DTFileReader implements FileAccess.FileReader
   }
 
   @Override
-  public void readFully(TreeMap<Slice, byte[]> data) throws IOException
+  public void readFully(TreeMap<Slice, Slice> data) throws IOException
   {
     scanner.rewind();
     for (; !scanner.atEnd(); scanner.advance()) {
       Entry en = scanner.entry();
       Slice key = new Slice(en.getBlockBuffer(), en.getKeyOffset(), en.getKeyLength());
-      byte[] value = Arrays.copyOfRange(en.getBlockBuffer(), en.getValueOffset(), en.getValueOffset()
+ en.getValueLength());
+      Slice value = new Slice(en.getBlockBuffer(), en.getValueOffset(), en.getValueLength());
       data.put(key, value);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/b067525d/library/src/main/java/com/datatorrent/lib/fileaccess/FileAccess.java
----------------------------------------------------------------------
diff --git a/library/src/main/java/com/datatorrent/lib/fileaccess/FileAccess.java b/library/src/main/java/com/datatorrent/lib/fileaccess/FileAccess.java
index 16d6d72..fff81ca 100644
--- a/library/src/main/java/com/datatorrent/lib/fileaccess/FileAccess.java
+++ b/library/src/main/java/com/datatorrent/lib/fileaccess/FileAccess.java
@@ -83,9 +83,7 @@ public interface FileAccess extends Closeable
      * @param data
      * @throws IOException
      */
-    //Move to
-    // void readFully(TreeMap<Slice, Slice> data) throws IOException;
-    void readFully(TreeMap<Slice, byte[]> data) throws IOException;
+    void readFully(TreeMap<Slice, Slice> data) throws IOException;
 
     /**
      * Repositions the pointer to the beginning of the underlying file.

http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/b067525d/library/src/main/java/com/datatorrent/lib/fileaccess/TFileReader.java
----------------------------------------------------------------------
diff --git a/library/src/main/java/com/datatorrent/lib/fileaccess/TFileReader.java b/library/src/main/java/com/datatorrent/lib/fileaccess/TFileReader.java
index 8426c3f..37fd950 100644
--- a/library/src/main/java/com/datatorrent/lib/fileaccess/TFileReader.java
+++ b/library/src/main/java/com/datatorrent/lib/fileaccess/TFileReader.java
@@ -63,7 +63,7 @@ public class TFileReader implements FileAccess.FileReader
   }
 
   @Override
-  public void readFully(TreeMap<Slice, byte[]> data) throws IOException
+  public void readFully(TreeMap<Slice, Slice> data) throws IOException
   {
     scanner.rewind();
     for (; !scanner.atEnd(); scanner.advance()) {
@@ -74,7 +74,7 @@ public class TFileReader implements FileAccess.FileReader
       byte[] value = new byte[vlen];
       en.getKey(key);
       en.getValue(value);
-      data.put(new Slice(key, 0, key.length), value);
+      data.put(new Slice(key, 0, key.length), new Slice(value, 0, value.length));
     }
 
   }


Mime
View raw message