gpt4 book ai didi

org.apache.druid.java.util.common.guava.Yielder.next()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 10:44:49 25 4
gpt4 key购买 nike

本文整理了Java中org.apache.druid.java.util.common.guava.Yielder.next()方法的一些代码示例,展示了Yielder.next()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Yielder.next()方法的具体详情如下:
包路径:org.apache.druid.java.util.common.guava.Yielder
类名称:Yielder
方法名:next

Yielder.next介绍

[英]Gets the next Yielder in the chain. The argument is used as the accumulator value to pass along to start the accumulation until the next yield() call or iteration completes. Once next() is called on this Yielder object, all further operations on this object are undefined.
[中]获取链中的下一个Yielder。参数用作累加器值,以开始累加,直到下一个yield()调用或迭代完成。在这个对象上调用next()后,这个对象上的所有后续操作都将被取消定义。

代码示例

代码示例来源:origin: apache/incubator-druid

@Override
public Yielder<OutType> next(OutType initValue)
{
 return wrapYielder(yielder.next(initValue), accumulator);
}

代码示例来源:origin: apache/incubator-druid

@Override
public Yielder<OutType> next(OutType initValue)
{
 return wrapYielder(yielder.next(initValue), yielderYielder, accumulator);
}

代码示例来源:origin: apache/incubator-druid

@Override
public Yielder<T> next(T initValue)
{
 return new ExecuteWhenDoneYielder<>(baseYielder.next(initValue), runnable, executor);
}

代码示例来源:origin: apache/incubator-druid

@Override
public Yielder<OutType> next(OutType initValue)
{
 return baseYielder.next(initValue);
}

代码示例来源:origin: apache/incubator-druid

@Override
 public Yielder<OutType> get()
 {
  return new WrappingYielder<>(baseYielder.next(initValue), wrapper);
 }
});

代码示例来源:origin: apache/incubator-druid

@Nullable
@Override
public InputRow nextRow()
{
 final InputRow inputRow = rowYielder.get();
 rowYielder = rowYielder.next(null);
 return transformer.transform(inputRow);
}

代码示例来源:origin: apache/incubator-druid

@Override
public Yielder<OutType> next(OutType initValue)
{
 combiningAccumulator.reset();
 return makeYielder(
   finalYielder == null ? yielder.next(yielder.get()) : finalYielder,
   combiningAccumulator,
   finalFinalValue
 );
}

代码示例来源:origin: apache/incubator-druid

@Override
 public void serialize(Yielder yielder, final JsonGenerator jgen, SerializerProvider provider)
   throws IOException
 {
  try {
   jgen.writeStartArray();
   while (!yielder.isDone()) {
    final Object o = yielder.get();
    jgen.writeObject(o);
    yielder = yielder.next(null);
   }
   jgen.writeEndArray();
  }
  finally {
   yielder.close();
  }
 }
}

代码示例来源:origin: apache/incubator-druid

@Override
public ScanResultValue next()
{
 ScanResultValue batch = yielder.get();
 if (ScanQuery.RESULT_FORMAT_COMPACTED_LIST.equals(resultFormat) ||
   ScanQuery.RESULT_FORMAT_LIST.equals(resultFormat)) {
  List events = (List) batch.getEvents();
  if (events.size() <= limit - count) {
   count += events.size();
   yielder = yielder.next(null);
   return batch;
  } else {
   // last batch
   // single batch length is <= Integer.MAX_VALUE, so this should not overflow
   int left = (int) (limit - count);
   count = limit;
   return new ScanResultValue(batch.getSegmentId(), batch.getColumns(), events.subList(0, left));
  }
 }
 throw new UnsupportedOperationException(ScanQuery.RESULT_FORMAT_VALUE_VECTOR + " is not supported yet");
}

代码示例来源:origin: apache/incubator-druid

public Meta.Frame nextFrame(final long fetchOffset, final int fetchMaxRowCount)
{
 synchronized (lock) {
  ensure(State.RUNNING);
  Preconditions.checkState(fetchOffset == offset, "fetchOffset[%,d] != offset[%,d]", fetchOffset, offset);
  try {
   final List<Object> rows = new ArrayList<>();
   while (!yielder.isDone() && (fetchMaxRowCount < 0 || offset < fetchOffset + fetchMaxRowCount)) {
    rows.add(yielder.get());
    yielder = yielder.next(null);
    offset++;
   }
   final boolean done = yielder.isDone();
   if (done) {
    close();
   }
   return new Meta.Frame(fetchOffset, done, rows);
  }
  catch (Throwable t) {
   this.throwable = t;
   try {
    close();
   }
   catch (Throwable t1) {
    t.addSuppressed(t1);
   }
   throw t;
  }
 }
}

代码示例来源:origin: apache/incubator-druid

Yielder<T> yielder = pQueue.remove();
retVal = accumulator.accumulate(retVal, yielder.get());
yielder = yielder.next(null);
if (yielder.isDone()) {
 try {

代码示例来源:origin: apache/incubator-druid

return makeYielder(yielderYielder.next(null), nextInit, accumulator);

代码示例来源:origin: apache/incubator-druid

} else if (pQueue.isEmpty()) {
 yielder = oldDudeAtCrosswalk.get();
 oldDudeAtCrosswalk = oldDudeAtCrosswalk.next(null);
} else {
 Yielder<T> queueYielder = pQueue.peek();
 } else {
  yielder = oldDudeAtCrosswalk.get();
  oldDudeAtCrosswalk = oldDudeAtCrosswalk.next(null);
yielder = yielder.next(null);
if (yielder.isDone()) {
 try {

代码示例来源:origin: apache/incubator-druid

yielder = yielder.next(null);

代码示例来源:origin: apache/incubator-druid

public <OutType> Yielder<OutType> makeYielder(
  Yielder<Sequence<T>> yielderYielder,
  OutType initValue,
  YieldingAccumulator<OutType, T> accumulator
)
{
 while (!yielderYielder.isDone()) {
  Yielder<OutType> yielder = yielderYielder.get().toYielder(initValue, accumulator);
  if (accumulator.yielded()) {
   return wrapYielder(yielder, yielderYielder, accumulator);
  }
  initValue = yielder.get();
  try {
   yielder.close();
  }
  catch (IOException e) {
   throw Throwables.propagate(e);
  }
  yielderYielder = yielderYielder.next(null);
 }
 return Yielders.done(initValue, yielderYielder);
}

代码示例来源:origin: apache/incubator-druid

yielder = yielder.next(null);

代码示例来源:origin: apache/incubator-druid

private void check(String expected, Sequence<Integer> complex)
{
 List<Integer> combined = complex.toList();
 Assert.assertEquals(expected, combined.toString());
 Yielder<Integer> yielder = complex.toYielder(
   null,
   new YieldingAccumulator<Integer, Integer>()
   {
    @Override
    public Integer accumulate(Integer accumulated, Integer in)
    {
     yield();
     return in;
    }
   }
 );
 List<Integer> combinedByYielder = new ArrayList<>();
 while (!yielder.isDone()) {
  combinedByYielder.add(yielder.get());
  yielder = yielder.next(null);
 }
 Assert.assertEquals(expected, combinedByYielder.toString());
}

代码示例来源:origin: apache/incubator-druid

yielder = yielder.next(0);

代码示例来源:origin: apache/incubator-druid

while (!yielder.isDone()) {
 result.add(yielder.get());
 yielder = yielder.next(null);

代码示例来源:origin: apache/incubator-druid

final Pair<Integer, Integer> actual = yielder.get();
Assert.assertEquals(expectedVal, actual);
yielder = yielder.next(actual);

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com