public final class MapControlledQueueSwitcher<T,M> extends Object implements QueueSwitcher<T,M>
Constructor and Description |
---|
MapControlledQueueSwitcher(@NotNull Asset asset,
@NotNull QueueCfg queueCfg,
@NotNull Map<Byte,QueueProxyReplica> replicas,
@NotNull MapView<CharSequence,Byte> controlMap,
@NotNull String masterIdKey,
@NotNull String localIdKey) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
localMasterIdSwitchCompleted(byte id)
Notifies that the user of this QueueSwitcher has performed all necessary steps involved with switching to the provided
newMasterHostId . |
void |
masterChangeSubscriber(@NotNull Consumer<? super Byte> masterChangeSubscriber)
Notify of changes made to the control map
|
byte |
masterHostId()
Returns the current master host id.
|
QueueView<T,M> |
queue(byte id)
Returns a QueueView for the sub-queue for the provided
id . |
void |
setMaster(byte master) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
ofMapControlled, setMaster
public MapControlledQueueSwitcher(@NotNull @NotNull Asset asset, @NotNull @NotNull QueueCfg queueCfg, @NotNull @NotNull Map<Byte,QueueProxyReplica> replicas, @NotNull @NotNull MapView<CharSequence,Byte> controlMap, @NotNull @NotNull String masterIdKey, @NotNull @NotNull String localIdKey)
public void masterChangeSubscriber(@NotNull @NotNull Consumer<? super Byte> masterChangeSubscriber)
QueueSwitcher
masterChangeSubscriber
in interface QueueSwitcher<T,M>
masterChangeSubscriber
- subscriberpublic void setMaster(byte master)
setMaster
in interface QueueSwitcher<T,M>
public byte masterHostId()
QueueSwitcher
masterHostId
in interface QueueSwitcher<T,M>
public void localMasterIdSwitchCompleted(byte id)
QueueSwitcher
newMasterHostId
.localMasterIdSwitchCompleted
in interface QueueSwitcher<T,M>
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public QueueView<T,M> queue(byte id)
QueueSwitcher
id
.queue
in interface QueueSwitcher<T,M>
id
Copyright © 2021. All rights reserved.