Package io.druid.segment.realtime

Examples of io.druid.segment.realtime.FireHydrant


          indexSchema,
          new OffheapBufferPool(bufferSize)
      );
    }

    final FireHydrant old;
    synchronized (hydrantLock) {
      old = currHydrant;
      currHydrant = new FireHydrant(newIndex, hydrants.size(), getSegment().getIdentifier());
      hydrants.add(currHydrant);
    }

    return old;
  }
View Full Code Here


          if (Ints.tryParse(segmentDir.getName()) == null) {
            continue;
          }

          hydrants.add(
              new FireHydrant(
                  new QueryableIndexSegment(
                      DataSegment.makeDataSegmentIdentifier(
                          schema.getDataSource(),
                          sinkInterval.getStart(),
                          sinkInterval.getEnd(),
View Full Code Here

      }

      private void spillIfSwappable()
      {
        if (theSink.swappable()) {
          final FireHydrant indexToPersist = theSink.swap();
          final int rowsToPersist = indexToPersist.getIndex().size();
          final File dirToPersist = getSpillDir(indexToPersist.getCount());

          log.info("Spilling index[%d] with rows[%d] to: %s", indexToPersist.getCount(), rowsToPersist, dirToPersist);

          try {
            IndexMaker.persist(
                indexToPersist.getIndex(),
                dirToPersist
            );

            indexToPersist.swapSegment(null);

            metrics.incrementRowOutputCount(rowsToPersist);

            spilled.add(dirToPersist);

          }
          catch (Exception e) {
            log.warn(e, "Failed to spill index[%d]", indexToPersist.getCount());
            throw Throwables.propagate(e);
          }
        }
      }
View Full Code Here

            return 0;
          }
        }
    );

    FireHydrant currHydrant = sink.getCurrHydrant();
    Assert.assertEquals(new Interval("2013-01-01/PT1M"), currHydrant.getIndex().getInterval());


    FireHydrant swapHydrant = sink.swap();

    sink.add(
        new InputRow()
        {
          @Override
View Full Code Here

    this.config = config;
    this.interval = interval;
    this.version = version;

    for (int i = 0; i < hydrants.size(); ++i) {
      final FireHydrant hydrant = hydrants.get(i);
      if (hydrant.getCount() != i) {
        throw new ISE("hydrant[%s] not the right count[%s]", hydrant, i);
      }
    }
    this.hydrants.addAll(hydrants);
View Full Code Here

TOP

Related Classes of io.druid.segment.realtime.FireHydrant

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.