You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ha...@apache.org on 2013/03/03 20:28:27 UTC

svn commit: r1452104 - /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/persistence/HashMapWrapper.java

Author: hashutosh
Date: Sun Mar  3 19:28:26 2013
New Revision: 1452104

URL: http://svn.apache.org/r1452104
Log:
HIVE-4104 : Hive localtask does not buffer disk-writes or reads (Gopal V via Ashutosh Chauhan)

Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/persistence/HashMapWrapper.java

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/persistence/HashMapWrapper.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/persistence/HashMapWrapper.java?rev=1452104&r1=1452103&r2=1452104&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/persistence/HashMapWrapper.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/persistence/HashMapWrapper.java Sun Mar  3 19:28:26 2013
@@ -21,6 +21,8 @@ package org.apache.hadoop.hive.ql.exec.p
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
@@ -112,7 +114,7 @@ public class HashMapWrapper<K, V> implem
    */
   public long flushMemoryCacheToPersistent(File file) throws IOException {
     ObjectOutputStream outputStream = null;
-    outputStream = new ObjectOutputStream(new FileOutputStream(file));
+    outputStream = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(file), 4096));
     outputStream.writeObject(mHash);
     outputStream.flush();
     outputStream.close();
@@ -122,7 +124,7 @@ public class HashMapWrapper<K, V> implem
 
   public void initilizePersistentHash(String fileName) throws IOException, ClassNotFoundException {
     ObjectInputStream inputStream = null;
-    inputStream = new ObjectInputStream(new FileInputStream(fileName));
+    inputStream = new ObjectInputStream(new BufferedInputStream(new FileInputStream(fileName), 4096));
     HashMap<K, V> hashtable = (HashMap<K, V>) inputStream.readObject();
     this.setMHash(hashtable);