FAQ
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);

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommits @
categorieshive, hadoop
postedMar 3, '13 at 7:28p
activeMar 3, '13 at 7:28p
posts1
users1
websitehive.apache.org

1 user in discussion

Hashutosh: 1 post

People

Translate

site design / logo © 2021 Grokbase