Package org.apache.hadoop.io

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


        // Test data and that the row for the data is for our table. If table
        // does not exist, scanner will return row after where our table would
        // be inserted if it exists so look for exact match on table name.
           
        if (data != null && data.size() > 0) {
          for (Writable k: data.keySet()) {
            if (HRegionInfo.getTableNameFromRegionName(
                ((HStoreKey) k).getRow()).equals(tableName)) {
         
              // Then a region for this table already exists. Ergo table exists.
                 
View Full Code Here


    final Hits hits = client.search(query, new String[] { INDEX_NAME }, 10);
    assertNotNull(hits);
    assertEquals(10, hits.getHits().size());
    for (final Hit hit : hits.getHits()) {
      final MapWritable details = client.getDetails(hit);
      final Set<Writable> keySet = details.keySet();
      assertFalse(keySet.isEmpty());
      assertNotNull(details.get(new Text("path")));
      assertNotNull(details.get(new Text("category")));
    }
    client.close();
View Full Code Here

    final Hits hits = client.search(query, new String[] { INDEX_NAME }, 10);
    assertNotNull(hits);
    assertEquals(10, hits.getHits().size());
    for (final Hit hit : hits.getHits()) {
      final MapWritable details = client.getDetails(hit, new String[] { "path" });
      final Set<Writable> keySet = details.keySet();
      assertFalse(keySet.isEmpty());
      assertNotNull(details.get(new Text("path")));
      assertNull(details.get(new Text("category")));
    }
    client.close();
View Full Code Here

    final Hits hits = client.search(query, new String[] { index.getName() }, 10);
    assertNotNull(hits);
    assertEquals(1, hits.getHits().size());
    final Hit hit = hits.getHits().get(0);
    final MapWritable details = client.getDetails(hit);
    final Set<Writable> keySet = details.keySet();
    assertEquals(1, keySet.size());
    final Writable writable = details.get(new Text(binaryFieldName));
    assertNotNull(writable);
    assertThat(writable, instanceOf(BytesWritable.class));
    BytesWritable bytesWritable = (BytesWritable) writable;
View Full Code Here

    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);
    }
    client.close();
View Full Code Here

    try {
      if (w3CLogRecordReader.nextKeyValue()
          && (value_ = w3CLogRecordReader.getCurrentValue()) != null) {
        Map<String, String> values = Maps.newHashMap();

        for (Writable key : value_.keySet()) {
          Writable value = value_.get(key);
          values.put(key.toString(), value != null ? value.toString() : null);
        }
        incrCounter(LzoW3CLogLoaderCounters.LinesW3CDecoded, 1L);
        incrCounter(LzoW3CLogLoaderCounters.UnparseableLines,
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.