public class ZkStateWriter extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
ZkStateWriter.ZkWriteCallback |
Modifier and Type | Field and Description |
---|---|
protected ClusterState |
clusterState |
protected boolean |
isClusterStateModified |
protected String |
lastCollectionName |
protected int |
lastStateFormat |
protected long |
lastUpdatedTime |
static ZkWriteCommand |
NO_OP |
protected ZkStateReader |
reader |
protected Overseer.Stats |
stats |
protected Map<String,DocCollection> |
updates |
Constructor and Description |
---|
ZkStateWriter(ZkStateReader zkStateReader,
Overseer.Stats stats) |
Modifier and Type | Method and Description |
---|---|
ClusterState |
enqueueUpdate(ClusterState prevState,
ZkWriteCommand cmd,
ZkStateWriter.ZkWriteCallback callback) |
ClusterState |
getClusterState() |
long |
getLastUpdatedTime() |
boolean |
hasPendingUpdates() |
protected boolean |
maybeFlushAfter(ZkWriteCommand cmd)
Logic to decide a flush after processing a ZkWriteCommand
|
protected boolean |
maybeFlushBefore(ZkWriteCommand cmd)
Logic to decide a flush before processing a ZkWriteCommand
|
ClusterState |
writePendingUpdates() |
public static ZkWriteCommand NO_OP
protected final ZkStateReader reader
protected final Overseer.Stats stats
protected Map<String,DocCollection> updates
protected ClusterState clusterState
protected boolean isClusterStateModified
protected long lastUpdatedTime
protected int lastStateFormat
protected String lastCollectionName
public ZkStateWriter(ZkStateReader zkStateReader, Overseer.Stats stats)
public ClusterState enqueueUpdate(ClusterState prevState, ZkWriteCommand cmd, ZkStateWriter.ZkWriteCallback callback) throws Exception
Exception
protected boolean maybeFlushBefore(ZkWriteCommand cmd)
cmd
- the ZkWriteCommand instanceprotected boolean maybeFlushAfter(ZkWriteCommand cmd)
cmd
- the ZkWriteCommand instancepublic boolean hasPendingUpdates()
public ClusterState writePendingUpdates() throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
public long getLastUpdatedTime()
public ClusterState getClusterState()
Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.