Examples of Utf8


Examples of org.apache.avro.util.Utf8

    GenericArray<CharSequence> l2 =
      new GenericData.Array<CharSequence>(1,s.getFields().get(0).schema());
    String foo = "foo";
    l0.add(new StringBuffer(foo));
    l1.add(foo);
    l2.add(new Utf8(foo));
    r0.put(0, l0);
    r1.put(0, l1);
    r2.put(0, l2);
    assertEquals(r0, r1);
    assertEquals(r0, r2);
View Full Code Here

Examples of org.apache.avro.util.Utf8

  public abstract void reduceFlush(MID record, Collector<OUT> collector)
    throws IOException;

  /** Call to update task status. */
  public void status(String message) {
    outputClient.status(new Utf8(message));
  }
View Full Code Here

Examples of org.apache.avro.util.Utf8

    outputClient.status(new Utf8(message));
  }

  /** Call to increment a counter. */
  public void count(String group, String name, long amount) {
    outputClient.count(new Utf8(group), new Utf8(name), amount);
  }
View Full Code Here

Examples of org.apache.avro.util.Utf8

    outputClient.count(new Utf8(group), new Utf8(name), amount);
  }

  /** Call to fail the task. */
  public void fail(String message) {
    outputClient.fail(new Utf8(message));
    close();
  }
View Full Code Here

Examples of org.apache.avro.util.Utf8

  @Test
  public void testString() throws Exception {
    assertEquals(Schema.create(Type.STRING), Schema.parse("\"string\""));
    assertEquals(Schema.create(Type.STRING),
                 Schema.parse("{\"type\":\"string\"}"));
    check("\"string\"", "\"foo\"", new Utf8("foo"));
  }
View Full Code Here

Examples of org.apache.avro.util.Utf8

  }

  @Test
  public void testMap() throws Exception {
    HashMap<Utf8,Long> map = new HashMap<Utf8,Long>();
    map.put(new Utf8("a"), 1L);
    check("{\"type\":\"map\", \"values\":\"long\"}", "{\"a\":1}", map);
    checkParseError("{\"type\":\"map\"}");        // values required
  }
View Full Code Here

Examples of org.apache.avro.util.Utf8

    String fixed = "{\"type\":\"fixed\",\"name\":\"Bar\",\"size\": 1}";
    String enu = "{\"type\":\"enum\",\"name\":\"Baz\",\"symbols\": [\"X\"]}";
    Schema union = Schema.parse("[\"null\",\"string\","
                                +record+","+ enu+","+fixed+"]");
    checkJson(union, null, "null");
    checkJson(union, new Utf8("foo"), "{\"string\":\"foo\"}");
    checkJson(union,
              new GenericData.Record(Schema.parse(record)),
              "{\"Foo\":{}}");
    checkJson(union,
              new GenericData.Fixed(new byte[]{(byte)'a'}),
View Full Code Here

Examples of org.apache.avro.util.Utf8

  public static class TestImpl implements TestNamespace {
    public TestRecord echo(TestRecord record) { return record; }
    public Void error() throws AvroRemoteException {
      TestError error = new TestError();
      error.message = new Utf8("an error");
      throw error;
    }
View Full Code Here

Examples of org.apache.avro.util.Utf8

      new SaslSocketTransceiver(new InetSocketAddress(s.getPort()));
    GenericRequestor requestor = new GenericRequestor(PROTOCOL, c);
    GenericRecord params =
      new GenericData.Record(PROTOCOL.getMessages().get("hello").getRequest());
    params.put("greeting", "bob");
    Utf8 response = (Utf8)requestor.request("hello", params);
    assertEquals(new Utf8("goodbye"), response);
    s.close();
    c.close();
  }
View Full Code Here

Examples of org.apache.avro.util.Utf8

      (new InetSocketAddress(server.getPort()), saslClient);
    GenericRequestor requestor = new GenericRequestor(PROTOCOL, c);
    GenericRecord params =
      new GenericData.Record(PROTOCOL.getMessages().get("hello").getRequest());
    params.put("greeting", "bob");
    Utf8 response = (Utf8)requestor.request("hello", params);
    assertEquals(new Utf8("goodbye"), response);
    s.close();
    c.close();
  }
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.