Package io.druid.data.input

Examples of io.druid.data.input.Firehose


            return new MyUpdateStream(ImmutableMap.<String,Object>of("item1", "value1", "item2", 2, "time", "2013-07-08"));
          }
        },
        null
    );
    Firehose firehose2 = webbie2.connect(null);
    if (firehose2.hasMore()) {
      long milliSeconds = firehose2.nextRow().getTimestampFromEpoch();
      DateTime date = new DateTime("2013-07-08");
      Assert.assertEquals(date.getMillis(), milliSeconds);
    } else {
      Assert.assertFalse("hasMore returned false", true);
    }
View Full Code Here


  }

  @Test
  public void testAutoMilliSecondsTimeStamp() throws Exception
  {
    Firehose firehose3 = webbie1.connect(null);
    if (firehose3.hasMore()) {
      long milliSeconds = firehose3.nextRow().getTimestampFromEpoch();
      DateTime date = new DateTime("2013-07-08");
      Assert.assertEquals(date.getMillis(), milliSeconds);
    } else {
      Assert.assertFalse("hasMore returned false", true);
    }
View Full Code Here

  @Test
  public void testGetDimension() throws Exception
  {
    InputRow inputRow;
    Firehose firehose = webbie1.connect(null);
    if (firehose.hasMore()) {
      inputRow = firehose.nextRow();
    } else {
      throw new RuntimeException("queue is empty");
    }

    List<String> column1 = Lists.newArrayList();
View Full Code Here

  @Test
  public void testGetFloatMetric() throws Exception
  {
    InputRow inputRow;
    Firehose firehose = webbie1.connect(null);
    if (firehose.hasMore()) {
      inputRow = firehose.nextRow();
    } else {
      throw new RuntimeException("queue is empty");
    }

    Assert.assertEquals((float) 2.0, inputRow.getFloatMetric("item2"), 0.0f);
View Full Code Here

    }

    final KafkaStream<Message> stream = streamList.get(0);
    final Iterator<MessageAndMetadata<Message>> iter = stream.iterator();

    return new Firehose()
    {
      @Override
      public boolean hasMore()
      {
        return iter.hasNext();
View Full Code Here

        Arrays.<FirehoseFactory>asList(
            new ListFirehoseFactory(list1),
            new ListFirehoseFactory(list2)
        )
    );
    final Firehose firehose = combiningFactory.connect(null);
    for (int i = 1; i < 6; i++) {
      Assert.assertTrue(firehose.hasMore());
      final InputRow inputRow = firehose.nextRow();
      Assert.assertEquals(i, inputRow.getTimestampFromEpoch());
      Assert.assertEquals(i, inputRow.getFloatMetric("test"), 0);
    }
    Assert.assertFalse(firehose.hasMore());
  }
View Full Code Here

    @Override
    public Firehose connect(InputRowParser inputRowParser) throws IOException, ParseException
    {
      final Iterator<InputRow> iterator = rows.iterator();
      return new Firehose()
      {
        @Override
        public boolean hasMore()
        {
          return iterator.hasNext();
View Full Code Here

            throw new RuntimeException("Unable to connect to server", e);
          }
        });


    return new Firehose()
    {
      InputRow nextRow = null;

      @Override
      public boolean hasMore()
View Full Code Here

    return new FirehoseFactory()
    {
      @Override
      public Firehose connect(InputRowParser parser) throws IOException
      {
        return new Firehose()
        {
          @Override
          public boolean hasMore()
          {
            return true;
View Full Code Here

      @Override
      public Firehose connect(InputRowParser parser) throws IOException
      {
        final Iterator<InputRow> inputRowIterator = inputRows.iterator();

        return new Firehose()
        {
          @Override
          public boolean hasMore()
          {
            return inputRowIterator.hasNext();
View Full Code Here

TOP

Related Classes of io.druid.data.input.Firehose

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.