Package org.apache.hadoop.hive.ql.util.jdbm.htree

Examples of org.apache.hadoop.hive.ql.util.jdbm.htree.HTree


          }
          newDir = new File("/tmp" + rand.nextInt());
        }
       
        RecordManager recman = RecordManagerFactory.createRecordManager(newDirName + "/" + pos, props );
        HTree hashTable = HTree.createInstance(recman);
       
        mapJoinTables.put(Byte.valueOf((byte)pos), hashTable);
      }

      storage.put((byte)posBigTable, new ArrayList<ArrayList<Object>>());
View Full Code Here


        // Send some status perodically
        numMapRowsRead++;
        if (((numMapRowsRead % heartbeatInterval) == 0) && (reporter != null))
          reporter.progress();

        HTree hashTable = mapJoinTables.get(alias);
        MapJoinObjectKey keyMap = new MapJoinObjectKey(metadataKeyTag, key);
        MapJoinObjectValue o = (MapJoinObjectValue)hashTable.get(keyMap);
        ArrayList<ArrayList<Object>> res = null;
       
        if (o == null) {
          res = new ArrayList<ArrayList<Object>>();
        }
        else {
          res = o.getObj();
        }
       
        res.add(value);
 
        if (metadataValueTag[tag] == -1) {
          metadataValueTag[tag] = nextVal++;
                   
          tableDesc valueTableDesc = conf.getValueTblDescs().get(tag);
          SerDe valueSerDe = (SerDe)ReflectionUtils.newInstance(valueTableDesc.getDeserializerClass(), null);
          valueSerDe.initialize(null, valueTableDesc.getProperties());
          mapMetadata.put(Integer.valueOf(metadataValueTag[tag]),
              new MapJoinObjectCtx(
                  ObjectInspectorUtils.getStandardObjectInspector(valueSerDe.getObjectInspector(),
                      ObjectInspectorCopyOption.WRITABLE),
              valueSerDe));
        }
       
        // Construct externalizable objects for key and value
        MapJoinObjectKey keyObj = new MapJoinObjectKey(metadataKeyTag, key);
        MapJoinObjectValue valueObj = new MapJoinObjectValue(metadataValueTag[tag], res);

        if (res.size() > 1)
          hashTable.remove(keyObj);

        // This may potentially increase the size of the hashmap on the mapper
        if (res.size() > mapJoinRowsKey) {
          LOG.warn("Number of values for a given key " + keyObj + " are " + res.size());
          LOG.warn("used memory " + Runtime.getRuntime().totalMemory());
        }
       
        hashTable.put(keyObj, valueObj);
        return;
      }

      // Add the value to the ArrayList
      storage.get(alias).add(value);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.ql.util.jdbm.htree.HTree

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.