Package org.apache.hadoop.io

Examples of org.apache.hadoop.io.MapWritable.entrySet()


            break;
          }

          SortedMap<Text, byte[]> results = new TreeMap<Text, byte[]>();
          Text row = null;
          for (Map.Entry<Writable, Writable> e: values.entrySet()) {
            HStoreKey key = (HStoreKey) e.getKey();
            Text thisRow = key.getRow();
            if (row == null) {
              row = thisRow;
            } else {
View Full Code Here


                  MapWritable values = server.next(scannerId);
                  if(values == null || values.size() == 0) {
                    break;
                  }
                  boolean haveRegionInfo = false;
                  for (Map.Entry<Writable, Writable> e: values.entrySet()) {

                    byte[] value = ((ImmutableBytesWritable) e.getValue()).get();
                    if (value == null || value.length == 0) {
                      break;
                    }
View Full Code Here

            rawRecord = (MapWritable) keys.getValue().getValue();
          }
        }
      }

      for (Map.Entry<Writable, Writable> e : rawRecord.entrySet()) {
        writer.append(e.getKey(), e.getValue());
      }

      candidates.remove(readerIndex);
View Full Code Here

          status[i].getPath(), conf);
      key = (Writable) ReflectionUtils.newInstance(convertedKeyClass, conf);
      rawRecord = new MapWritable();

      while (reader.next(key, rawRecord)) {
        for (Map.Entry<Writable, Writable> e : rawRecord.entrySet()) {
          writer.append(e.getKey(), e.getValue());
        }
      }
      reader.close();
    }
View Full Code Here

        bais.close();
      } catch (IOException e) {
        throw new IllegalStateException("The table query configurations could not be deserialized from the given configuration");
      }
    }
    for (Map.Entry<Writable,Writable> entry : mapWritable.entrySet())
      configs.put(((Text) entry.getKey()).toString(), (InputTableConfig) entry.getValue());

    return configs;
  }
View Full Code Here

        while ( (msg = peer.getCurrentMessage()) != null ) {
          blValue = (BooleanWritable) msg.get(new Text(KeyValueHashPartitionedBSP.TEST_UNEXPECTED_KEYS));
          assertEquals(false, blValue.get());
          values = (MapWritable) msg.get(new Text(KeyValueHashPartitionedBSP.TEST_INPUT_VALUES));
          for (Map.Entry<Writable,Writable> w : values.entrySet()) {
            input.put( Integer.valueOf( w.getKey().toString() ), Integer.valueOf( w.getValue().toString() ));
          }
        }
       
        for (int i=0; i<maxValue; i++) {
View Full Code Here

    List<MapWritable> detailList = client.getDetails(hits.getHits());
    assertEquals(hits.getHits().size(), detailList.size());
    for (int i = 0; i < detailList.size(); i++) {
      final MapWritable details1 = client.getDetails(hits.getHits().get(i));
      final MapWritable details2 = detailList.get(i);
      assertEquals(details1.entrySet(), details2.entrySet());
      final Set<Writable> keySet = details2.keySet();
      assertFalse(keySet.isEmpty());
      final Writable writable = details2.get(new Text("path"));
      assertNotNull(writable);
    }
View Full Code Here

    while (values.hasNext()) {
      MapWritable value = values.next();

      // each column (name-value pair) is a field (name-value pair)
      for (Map.Entry<Writable, Writable> entry : value.entrySet()) {
        // name is already UTF-8 encoded
        String column = ((Text) entry.getKey()).toString();
        byte[] columnValue = ((ImmutableBytesWritable)entry.getValue()).get();
        Field.Store store = indexConf.isStore(column)?
          Field.Store.YES: Field.Store.NO;
View Full Code Here

        ((TypedBytesWritable) writables2[i]).getValue());
    }
    assertEquals(MapWritable.class, in.readType());

    MapWritable mw = in.readMap();
    assertEquals(map.entrySet(), mw.entrySet());

    assertEquals(Type.LIST, TypedBytesInput.get(distream).readType());
    assertEquals(r1.getBoolVal(), TypedBytesInput.get(distream).read());
    assertEquals(r1.getByteVal(), TypedBytesInput.get(distream).read());
    assertEquals(r1.getIntVal(), TypedBytesInput.get(distream).read());
View Full Code Here

    if (isMasterTask(peer)) {
      int minVerticesSize = Integer.MAX_VALUE;
      GraphJobMessage received = null;
      while ((received = peer.getCurrentMessage()) != null) {
        MapWritable x = received.getMap();
        for (Entry<Writable, Writable> e : x.entrySet()) {
          int curr = ((IntWritable) e.getValue()).get();
          if (minVerticesSize > curr) {
            minVerticesSize = curr;
          }
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.