Top Inners Fields Constructors Methods
io.reactivex.rxjava3.internal.operators.flowable

public final Class FlowableGroupBy<T, K, V>

extends AbstractFlowableWithUpstream<T, GroupedFlowable<K, V>>
Class Inheritance
Imports
java.util.*, java.util.concurrent.*, java.util.concurrent.atomic.*, org.reactivestreams.*, io.reactivex.rxjava3.annotations.Nullable, io.reactivex.rxjava3.core.*, io.reactivex.rxjava3.exceptions.*, io.reactivex.rxjava3.flowables.GroupedFlowable, io.reactivex.rxjava3.functions.*, io.reactivex.rxjava3.internal.subscriptions.*, io.reactivex.rxjava3.internal.util.*, io.reactivex.rxjava3.operators.SpscLinkedArrayQueue, io.reactivex.rxjava3.plugins.RxJavaPlugins

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
public static class
pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv final int
pack-priv final boolean
pack-priv final Function<? super T, ? extends K>
pack-priv final Function<? super Consumer<Object>, ? extends Map<K, Object>>
pack-priv final Function<? super T, ? extends V>
Inherited from io.reactivex.rxjava3.internal.operators.flowable.AbstractFlowableWithUpstream:
source

Constructor Summary

AccessConstructor and Description
public
FlowableGroupBy(Flowable<T> source, Function<? super T, ? extends K> keySelector, Function<? super T, ? extends V> valueSelector, int bufferSize, boolean delayError, Function<? super Consumer<Object>, ? extends Map<K, Object>> mapFactory)

Method Summary

Modifier and TypeMethod and Description
protected void
Inherited from io.reactivex.rxjava3.internal.operators.flowable.AbstractFlowableWithUpstream:
source

Field Detail

bufferSizeback to summary
pack-priv final int bufferSize
delayErrorback to summary
pack-priv final boolean delayError
keySelectorback to summary
pack-priv final Function<? super T, ? extends K> keySelector
mapFactoryback to summary
pack-priv final Function<? super Consumer<Object>, ? extends Map<K, Object>> mapFactory
valueSelectorback to summary
pack-priv final Function<? super T, ? extends V> valueSelector

Constructor Detail

FlowableGroupByback to summary
public FlowableGroupBy(Flowable<T> source, Function<? super T, ? extends K> keySelector, Function<? super T, ? extends V> valueSelector, int bufferSize, boolean delayError, Function<? super Consumer<Object>, ? extends Map<K, Object>> mapFactory)

Method Detail

subscribeActualback to summary
protected void subscribeActual(Subscriber<? super GroupedFlowable<K, V>> s)
Annotations
@Override
@SuppressWarnings:unchecked, rawtypes
io.reactivex.rxjava3.internal.operators.flowable back to summary

pack-priv final Class FlowableGroupBy.EvictionAction<K, V>

extends Object
implements Consumer<FlowableGroupBy.GroupedUnicast<K, V>>
Class Inheritance
  • java.lang.Object
  • io.reactivex.rxjava3.internal.operators.flowable.FlowableGroupBy.EvictionAction
All Implemented Interfaces
io.reactivex.rxjava3.functions.Consumer

Field Summary

Modifier and TypeField and Description
pack-priv final Queue<FlowableGroupBy.GroupedUnicast<K, V>>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
accept(FlowableGroupBy.GroupedUnicast<K, V>
the value
value
)

Implements io.reactivex.rxjava3.functions.Consumer.accept.

Consume the given value.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

evictedGroupsback to summary
pack-priv final Queue<FlowableGroupBy.GroupedUnicast<K, V>> evictedGroups

Constructor Detail

EvictionActionback to summary
pack-priv EvictionAction(Queue<FlowableGroupBy.GroupedUnicast<K, V>> evictedGroups)

Method Detail

acceptback to summary
public void accept(FlowableGroupBy.GroupedUnicast<K, V> value)

Implements io.reactivex.rxjava3.functions.Consumer.accept.

Doc from io.reactivex.rxjava3.functions.Consumer.accept.

Consume the given value.

Parameters
value:FlowableGroupBy.GroupedUnicast<K, V>

the value

Annotations
@Override
io.reactivex.rxjava3.internal.operators.flowable back to summary

public final Class FlowableGroupBy.GroupBySubscriber<T, K, V>

extends AtomicLong
implements FlowableSubscriber<T>, Subscription
Class Inheritance
All Implemented Interfaces
org.reactivestreams.Subscription, io.reactivex.rxjava3.core.FlowableSubscriber, org.reactivestreams.Subscriber

Field Summary

Modifier and TypeField and Description
pack-priv final int
pack-priv final AtomicBoolean
pack-priv final boolean
pack-priv boolean
pack-priv final Subscriber<? super GroupedFlowable<K, V>>
pack-priv long
pack-priv final Queue<FlowableGroupBy.GroupedUnicast<K, V>>
pack-priv final AtomicLong
pack-priv final AtomicInteger
pack-priv final Map<Object, FlowableGroupBy.GroupedUnicast<K, V>>
pack-priv final Function<? super T, ? extends K>
pack-priv final int
pack-priv static final Object
private static final long
pack-priv Subscription
pack-priv final Function<? super T, ? extends V>

Constructor Summary

AccessConstructor and Description
public
GroupBySubscriber(Subscriber<? super GroupedFlowable<K, V>> actual, Function<? super T, ? extends K> keySelector, Function<? super T, ? extends V> valueSelector, int bufferSize, boolean delayError, Map<Object, FlowableGroupBy.GroupedUnicast<K, V>> groups, Queue<FlowableGroupBy.GroupedUnicast<K, V>> evictedGroups)

Method Summary

Modifier and TypeMethod and Description
public void
cancel()

Implements org.reactivestreams.Subscription.cancel.

Request the Publisher to stop sending data and clean up resources.
public void
cancel(K key)

private void
pack-priv static MissingBackpressureException
public void
onComplete()

Implements org.reactivestreams.Subscriber.onComplete.

Successful terminal state.
public void
onError(Throwable
the throwable signaled
t
)

Implements org.reactivestreams.Subscriber.onError.

Failed terminal state.
public void
onNext(T
the element signaled
t
)

Implements org.reactivestreams.Subscriber.onNext.

Data notification sent by the Publisher in response to requests to Subscription#request(long).
public void
public void
request(long
the strictly positive number of elements to requests to the upstream Publisher
n
)

Implements org.reactivestreams.Subscription.request.

No events will be sent by a Publisher until demand is signaled via this method.
pack-priv void
requestGroup(long n)

Inherited from java.util.concurrent.atomic.AtomicLong:
accumulateAndGetaddAndGetcompareAndExchangecompareAndExchangeAcquirecompareAndExchangeReleasecompareAndSetdecrementAndGetdoubleValuefloatValuegetgetAcquiregetAndAccumulategetAndAddgetAndDecrementgetAndIncrementgetAndSetgetAndUpdategetOpaquegetPlainincrementAndGetintValuelazySetlongValuesetsetOpaquesetPlainsetReleasetoStringupdateAndGetweakCompareAndSetweakCompareAndSetAcquireweakCompareAndSetPlainweakCompareAndSetReleaseweakCompareAndSetVolatile

Field Detail

bufferSizeback to summary
pack-priv final int bufferSize
cancelledback to summary
pack-priv final AtomicBoolean cancelled
delayErrorback to summary
pack-priv final boolean delayError
doneback to summary
pack-priv boolean done
downstreamback to summary
pack-priv final Subscriber<? super GroupedFlowable<K, V>> downstream
emittedGroupsback to summary
pack-priv long emittedGroups
evictedGroupsback to summary
pack-priv final Queue<FlowableGroupBy.GroupedUnicast<K, V>> evictedGroups
groupConsumedback to summary
pack-priv final AtomicLong groupConsumed
groupCountback to summary
pack-priv final AtomicInteger groupCount
groupsback to summary
pack-priv final Map<Object, FlowableGroupBy.GroupedUnicast<K, V>> groups
keySelectorback to summary
pack-priv final Function<? super T, ? extends K> keySelector
limitback to summary
pack-priv final int limit
NULL_KEYback to summary
pack-priv static final Object NULL_KEY
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.concurrent.atomic.AtomicLong.serialVersionUID.

upstreamback to summary
pack-priv Subscription upstream
valueSelectorback to summary
pack-priv final Function<? super T, ? extends V> valueSelector

Constructor Detail

GroupBySubscriberback to summary
public GroupBySubscriber(Subscriber<? super GroupedFlowable<K, V>> actual, Function<? super T, ? extends K> keySelector, Function<? super T, ? extends V> valueSelector, int bufferSize, boolean delayError, Map<Object, FlowableGroupBy.GroupedUnicast<K, V>> groups, Queue<FlowableGroupBy.GroupedUnicast<K, V>> evictedGroups)

Method Detail

cancelback to summary
public void cancel()

Implements org.reactivestreams.Subscription.cancel.

Doc from org.reactivestreams.Subscription.cancel.

Request the Publisher to stop sending data and clean up resources.

Data may still be sent to meet previously signalled demand after calling cancel.

Annotations
@Override
cancelback to summary
public void cancel(K key)
completeEvictionsback to summary
private void completeEvictions()
groupHangWarningback to summary
pack-priv static MissingBackpressureException groupHangWarning(long n)
onCompleteback to summary
public void onComplete()

Implements org.reactivestreams.Subscriber.onComplete.

Doc from org.reactivestreams.Subscriber.onComplete.

Successful terminal state.

No further events will be sent even if Subscription#request(long) is invoked again.

Annotations
@Override
onErrorback to summary
public void onError(Throwable t)

Implements org.reactivestreams.Subscriber.onError.

Doc from org.reactivestreams.Subscriber.onError.

Failed terminal state.

No further events will be sent even if Subscription#request(long) is invoked again.

Parameters
t:Throwable

the throwable signaled

Annotations
@Override
onNextback to summary
public void onNext(T t)

Implements org.reactivestreams.Subscriber.onNext.

Doc from org.reactivestreams.Subscriber.onNext.

Data notification sent by the Publisher in response to requests to Subscription#request(long).

Parameters
t:T

the element signaled

Annotations
@Override
onSubscribeback to summary
public void onSubscribe(Subscription s)

Implements org.reactivestreams.Subscriber.onSubscribe.

Doc from org.reactivestreams.Subscriber.onSubscribe.

Invoked after calling Publisher#subscribe(Subscriber).

No data will start flowing until Subscription#request(long) is invoked.

It is the responsibility of this Subscriber instance to call Subscription#request(long) whenever more data is wanted.

The Publisher will send notifications only in response to Subscription#request(long).

Parameters
s:Subscription

the Subscription that allows requesting data via Subscription#request(long)

Annotations
@Override
requestback to summary
public void request(long n)

Implements org.reactivestreams.Subscription.request.

Doc from org.reactivestreams.Subscription.request.

No events will be sent by a Publisher until demand is signaled via this method.

It can be called however often and whenever needed—but if the outstanding cumulative demand ever becomes Long.MAX_VALUE or more, it may be treated by the Publisher as "effectively unbounded".

Whatever has been requested can be sent by the Publisher so only signal demand for what can be safely handled.

A Publisher can send less than is requested if the stream ends but then must emit either Subscriber#onError(Throwable) or Subscriber#onComplete().

Parameters
n:long

the strictly positive number of elements to requests to the upstream Publisher

Annotations
@Override
requestGroupback to summary
pack-priv void requestGroup(long n)
io.reactivex.rxjava3.internal.operators.flowable back to summary

pack-priv final Class FlowableGroupBy.GroupedUnicast<K, T>

extends GroupedFlowable<K, T>
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final FlowableGroupBy.State<T, K>

Constructor Summary

AccessConstructor and Description
protected
GroupedUnicast(K key, FlowableGroupBy.State<T, K> state)

Method Summary

Modifier and TypeMethod and Description
public static <T, K> FlowableGroupBy.GroupedUnicast<K, T>
createWith(K key, int bufferSize, FlowableGroupBy.GroupBySubscriber<?, K, T> parent, boolean delayError)

public void
public void
public void
onNext(T t)

protected void
Inherited from io.reactivex.rxjava3.flowables.GroupedFlowable:
getKey

Field Detail

stateback to summary
pack-priv final FlowableGroupBy.State<T, K> state

Constructor Detail

GroupedUnicastback to summary
protected GroupedUnicast(K key, FlowableGroupBy.State<T, K> state)

Method Detail

createWithback to summary
public static <T, K> FlowableGroupBy.GroupedUnicast<K, T> createWith(K key, int bufferSize, FlowableGroupBy.GroupBySubscriber<?, K, T> parent, boolean delayError)
onCompleteback to summary
public void onComplete()
onErrorback to summary
public void onError(Throwable e)
onNextback to summary
public void onNext(T t)
subscribeActualback to summary
protected void subscribeActual(Subscriber<? super T> s)
Annotations
@Override
io.reactivex.rxjava3.internal.operators.flowable back to summary

pack-priv final Class FlowableGroupBy.State<T, K>

extends BasicIntQueueSubscription<T>
implements Publisher<T>
Class Inheritance
All Implemented Interfaces
org.reactivestreams.Publisher

Field Summary

Modifier and TypeField and Description
pack-priv static final int
pack-priv static final int
pack-priv final AtomicReference<Subscriber<? super T>>
pack-priv final AtomicBoolean
pack-priv final boolean
pack-priv volatile boolean
pack-priv Throwable
pack-priv final AtomicBoolean
pack-priv static final int
pack-priv static final int
pack-priv final K
pack-priv final AtomicInteger
pack-priv boolean
pack-priv final FlowableGroupBy.GroupBySubscriber<?, K, T>
pack-priv int
pack-priv final SpscLinkedArrayQueue<T>
pack-priv final AtomicLong
private static final long

Constructor Summary

AccessConstructor and Description
pack-priv
State(int bufferSize, FlowableGroupBy.GroupBySubscriber<?, K, T> parent, K key, boolean delayError)

Method Summary

Modifier and TypeMethod and Description
public void
cancel()

Implements org.reactivestreams.Subscription.cancel.

Request the Publisher to stop sending data and clean up resources.
pack-priv void
pack-priv boolean
checkTerminated(boolean d, boolean empty, Subscriber<? super T> a, boolean delayError, long emitted, boolean polled)

pack-priv void
cleanupQueue(long emitted, boolean polled)

public void
clear()

Implements io.reactivex.rxjava3.operators.SimpleQueue.clear.

Removes all enqueued items from this queue.
pack-priv void
pack-priv void
pack-priv void
public boolean
isEmpty()

Implements io.reactivex.rxjava3.operators.SimpleQueue.isEmpty.

Returns true if the queue is empty.
public void
public void
public void
onNext(T t)

public T
poll()

Implements io.reactivex.rxjava3.operators.SimpleQueue.poll.

Tries to dequeue a value (non-null) or returns null if the queue is empty.
pack-priv void
replenishParent(long emitted, boolean polled)

public void
request(long
the strictly positive number of elements to requests to the upstream Publisher
n
)

Implements org.reactivestreams.Subscription.request.

No events will be sent by a Publisher until demand is signaled via this method.
public int
requestFusion(int
the requested fusion mode, allowed values are SYNC, ASYNC, ANY combined with BOUNDARY (e.g., requestFusion(SYNC | BOUNDARY)).
mode
)

Implements io.reactivex.rxjava3.operators.QueueFuseable.requestFusion.

Request a fusion mode from the upstream.
pack-priv void
requestParent(long e)

public void
subscribe(Subscriber<? super T>
the Subscriber that will consume signals from this Publisher
subscriber
)

Implements org.reactivestreams.Publisher.subscribe.

Request Publisher to start streaming data.
pack-priv boolean
pack-priv boolean
pack-priv void
Inherited from io.reactivex.rxjava3.internal.subscriptions.BasicIntQueueSubscription:
offeroffer

Field Detail

ABANDONEDback to summary
pack-priv static final int ABANDONED
ABANDONED_HAS_SUBSCRIBERback to summary
pack-priv static final int ABANDONED_HAS_SUBSCRIBER
actualback to summary
pack-priv final AtomicReference<Subscriber<? super T>> actual
cancelledback to summary
pack-priv final AtomicBoolean cancelled
delayErrorback to summary
pack-priv final boolean delayError
doneback to summary
pack-priv volatile boolean done
errorback to summary
pack-priv Throwable error
evictOnceback to summary
pack-priv final AtomicBoolean evictOnce
FRESHback to summary
pack-priv static final int FRESH
HAS_SUBSCRIBERback to summary
pack-priv static final int HAS_SUBSCRIBER
keyback to summary
pack-priv final K key
onceback to summary
pack-priv final AtomicInteger once
outputFusedback to summary
pack-priv boolean outputFused
parentback to summary
pack-priv final FlowableGroupBy.GroupBySubscriber<?, K, T> parent
producedback to summary
pack-priv int produced
queueback to summary
pack-priv final SpscLinkedArrayQueue<T> queue
requestedback to summary
pack-priv final AtomicLong requested
serialVersionUIDback to summary
private static final long serialVersionUID

Hides io.reactivex.rxjava3.internal.subscriptions.BasicIntQueueSubscription.serialVersionUID.

Constructor Detail

Stateback to summary
pack-priv State(int bufferSize, FlowableGroupBy.GroupBySubscriber<?, K, T> parent, K key, boolean delayError)

Method Detail

cancelback to summary
public void cancel()

Implements org.reactivestreams.Subscription.cancel.

Doc from org.reactivestreams.Subscription.cancel.

Request the Publisher to stop sending data and clean up resources.

Data may still be sent to meet previously signalled demand after calling cancel.

Annotations
@Override
cancelParentback to summary
pack-priv void cancelParent()
checkTerminatedback to summary
pack-priv boolean checkTerminated(boolean d, boolean empty, Subscriber<? super T> a, boolean delayError, long emitted, boolean polled)
cleanupQueueback to summary
pack-priv void cleanupQueue(long emitted, boolean polled)
clearback to summary
public void clear()

Implements io.reactivex.rxjava3.operators.SimpleQueue.clear.

Doc from io.reactivex.rxjava3.operators.SimpleQueue.clear.

Removes all enqueued items from this queue.

Annotations
@Override
drainback to summary
pack-priv void drain()
drainFusedback to summary
pack-priv void drainFused()
drainNormalback to summary
pack-priv void drainNormal()
isEmptyback to summary
public boolean isEmpty()

Implements io.reactivex.rxjava3.operators.SimpleQueue.isEmpty.

Doc from io.reactivex.rxjava3.operators.SimpleQueue.isEmpty.

Returns true if the queue is empty.

Note however that due to potential fused functions in poll() it is possible this method returns false but then poll() returns null because the fused function swallowed the available item(s).

Returns:boolean

true if the queue is empty

Annotations
@Override
onCompleteback to summary
public void onComplete()
onErrorback to summary
public void onError(Throwable e)
onNextback to summary
public void onNext(T t)
pollback to summary
public T poll()

Implements io.reactivex.rxjava3.operators.SimpleQueue.poll.

Doc from io.reactivex.rxjava3.operators.SimpleQueue.poll.

Tries to dequeue a value (non-null) or returns null if the queue is empty.

If the producer uses offer(Object, Object) and when polling in pairs, if the first poll() returns a non-null item, the second poll() is guaranteed to return a non-null item as well.

Returns:T

the item or null to indicate an empty queue

Annotations
@Nullable
@Override
replenishParentback to summary
pack-priv void replenishParent(long emitted, boolean polled)
requestback to summary
public void request(long n)

Implements org.reactivestreams.Subscription.request.

Doc from org.reactivestreams.Subscription.request.

No events will be sent by a Publisher until demand is signaled via this method.

It can be called however often and whenever needed—but if the outstanding cumulative demand ever becomes Long.MAX_VALUE or more, it may be treated by the Publisher as "effectively unbounded".

Whatever has been requested can be sent by the Publisher so only signal demand for what can be safely handled.

A Publisher can send less than is requested if the stream ends but then must emit either Subscriber#onError(Throwable) or Subscriber#onComplete().

Parameters
n:long

the strictly positive number of elements to requests to the upstream Publisher

Annotations
@Override
requestFusionback to summary
public int requestFusion(int mode)

Implements io.reactivex.rxjava3.operators.QueueFuseable.requestFusion.

Doc from io.reactivex.rxjava3.operators.QueueFuseable.requestFusion.

Request a fusion mode from the upstream.

This should be called before onSubscribe returns.

Calling this method multiple times or after onSubscribe finished is not allowed and may result in undefined behavior.

Parameters
mode:int

the requested fusion mode, allowed values are SYNC, ASYNC, ANY combined with BOUNDARY (e.g., requestFusion(SYNC | BOUNDARY)).

Returns:int

the established fusion mode: NONE, SYNC, ASYNC.

Annotations
@Override
requestParentback to summary
pack-priv void requestParent(long e)
subscribeback to summary
public void subscribe(Subscriber<? super T> subscriber)

Implements org.reactivestreams.Publisher.subscribe.

Doc from org.reactivestreams.Publisher.subscribe.

Request Publisher to start streaming data.

This is a "factory method" and can be called multiple times, each time starting a new Subscription.

Each Subscription will work for only a single Subscriber.

A Subscriber should only subscribe once to a single Publisher.

If the Publisher rejects the subscription attempt or otherwise fails it will signal the error via Subscriber#onError(Throwable).

Parameters
subscriber:Subscriber<? super T>

the Subscriber that will consume signals from this Publisher

Annotations
@Override
tryAbandonback to summary
pack-priv boolean tryAbandon()
tryCompleteback to summary
pack-priv boolean tryComplete()
tryReplenishback to summary
pack-priv void tryReplenish()