Examples of LazyString


Examples of net.bpiwowar.mg4j.extensions.utils.LazyString

        if (element == TRECParsingFactory.ELEMENT_TOP) {
          if (topic.id == null) {
            logger.warn("Topic had no identifier - skipping");
          } else {
            logger.debug(new LazyString("Adding topic %s with title [%s]",
                topic.id, topic.title));

            querySet.put(topic.id, topic);
          }
          topic = null;
View Full Code Here

Examples of net.bpiwowar.mg4j.extensions.utils.LazyString

        // Queries
    Set<String> topicIds = GenericHelper.newHashSet();
    Map<String, ? extends Topic> topics = querySet.queries();
    for (String id : topics.keySet()) {
      logger.debug(new LazyString("Considering topic %s (%b/%b/%b)", id, topics.keySet()
          .contains(id), onlyTopics.isEmpty(), onlyTopics
          .contains(id)));
      if (topics.keySet().contains(id)
          && (onlyTopics.isEmpty() || onlyTopics.contains(id))) {
        topicIds.add(id);
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.lazy.LazyString

    this.escapeChar = escapeChar;
  }

  @Override
  public Object copyObject(Object o) {
    return o == null ? null : new LazyString((LazyString)o);
  }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.lazy.LazyString

    this.escapeChar = escapeChar;
  }

  @Override
  public Object copyObject(Object o) {
    return o == null ? null : new LazyString((LazyString) o);
  }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.lazy.LazyString

    this.escapeChar = escapeChar;
  }

  @Override
  public Object copyObject(Object o) {
    return o == null ? null : new LazyString((LazyString) o);
  }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.lazy.LazyString

    expectedKeys.add("k2");
    expectedKeys.add("k3");
    for (Entry<Object,Object> entry : untypedMap.entrySet()) {
      assertNotNull(entry.getKey());
      assertTrue(entry.getKey() instanceof LazyString);
      LazyString key = (LazyString) entry.getKey();

      assertNotNull(entry.getValue());
      assertTrue(entry.getValue() instanceof LazyString);
      LazyString value = (LazyString) entry.getValue();

      String strKey = key.getWritableObject().toString(), strValue = value.getWritableObject()
          .toString();

      assertTrue(expectedKeys.remove(strKey));

      assertEquals(2, strValue.length());
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.lazy.LazyString

    Assert.assertNotNull(valueBytes);

    byteRef.setData(valueBytes);
    LazyStringObjectInspector lazyStringOI = LazyPrimitiveObjectInspectorFactory
        .getLazyStringObjectInspector(false, (byte) 0);
    LazyString lazyString = (LazyString) LazyFactory.createLazyObject(lazyStringOI);
    lazyString.init(byteRef, 0, valueBytes.length);

    Assert.assertEquals(stringValue, lazyString.getWritableObject().toString());

    // boolean
    cqHolder.set("boolean");
    valueBytes = value.getValue(cfText, cqHolder);
    Assert.assertNotNull(valueBytes);
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.lazy.LazyString

    Assert.assertNotNull(valueBytes);

    byteRef.setData(valueBytes);
    LazyStringObjectInspector lazyStringOI = LazyPrimitiveObjectInspectorFactory
        .getLazyStringObjectInspector(false, (byte) 0);
    LazyString lazyString = (LazyString) LazyFactory.createLazyObject(lazyStringOI);
    lazyString.init(byteRef, 0, valueBytes.length);

    Assert.assertEquals(new Text(stringValue), lazyString.getWritableObject());

    // boolean
    cqHolder.set("boolean");
    valueBytes = value.getValue(cfText, cqHolder);
    Assert.assertNotNull(valueBytes);
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.lazy.LazyString

        }
        if(o instanceof Text) {
            return (Text) o;
        }
        if(o instanceof LazyString) {
            LazyString l = (LazyString) o;
            return l.getWritableObject();
        }
        if(o instanceof String) {
            String s = (String) o;
            return new Text(s);
        }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.lazy.LazyString

        assertEquals(map, expectedMap);
    }

    private static LazyString lazyString(String string)
    {
        LazyString lazyString = new LazyString(LAZY_STRING_OBJECT_INSPECTOR);
        lazyString.init(newByteArrayRef(string), 0, string.length());
        return lazyString;
    }
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.