public class ApiStatePersistenceStore
extends java.lang.Object
implements java.lang.AutoCloseable
Modifier and Type | Class and Description |
---|---|
static class |
ApiStatePersistenceStore.SbkApiStatusKeySerde |
static class |
ApiStatePersistenceStore.SbkApiStatusMessageSerde |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
API_STATE_TOPIC_CLEANUP_POLICY |
Constructor and Description |
---|
ApiStatePersistenceStore(kafka.server.KafkaConfig config,
org.apache.kafka.common.utils.Time time,
java.util.Map<java.lang.String,java.lang.Object> clientProperties) |
Modifier and Type | Method and Description |
---|---|
void |
addBrokerAddStatus(kafka.common.BrokerAddStatus status) |
void |
addBrokerRemovalStateRecord(BrokerRemovalStateRecord stateRecord) |
static void |
checkStartupCondition(KafkaCruiseControlConfig config,
java.util.concurrent.Semaphore abortStartupCheck)
Make sure any condition needed to start this
CruiseControlComponent is satisfied. |
void |
close() |
java.util.Map<java.lang.Integer,kafka.common.BrokerAddStatus> |
getAllBrokerAddStatus() |
java.util.Map<java.lang.Integer,BrokerRemovalStateRecord> |
getAllBrokerRemovalStateRecords() |
kafka.common.BrokerAddStatus |
getBrokerAddStatus(int brokerId) |
BrokerRemovalStateRecord |
getBrokerRemovalStateRecord(int brokerId) |
void |
init(kafka.server.KafkaConfig config,
org.apache.kafka.common.utils.Time time,
java.util.Map<java.lang.String,java.lang.Object> clientProperties) |
void |
save(BrokerRemovalStateRecord removalStateRecord,
boolean isNew)
Save api status passed in as argument
removalStatus to persistence store. |
public static final java.lang.String API_STATE_TOPIC_CLEANUP_POLICY
public ApiStatePersistenceStore(kafka.server.KafkaConfig config, org.apache.kafka.common.utils.Time time, java.util.Map<java.lang.String,java.lang.Object> clientProperties)
public void init(kafka.server.KafkaConfig config, org.apache.kafka.common.utils.Time time, java.util.Map<java.lang.String,java.lang.Object> clientProperties)
public void close()
close
in interface java.lang.AutoCloseable
public void save(BrokerRemovalStateRecord removalStateRecord, boolean isNew) throws java.lang.InterruptedException
removalStatus
to persistence store. If isNew
is set to true, the "startTime" field will be set to current time. This is the case when we acknowledge
the api request to process. Any update to api status will then onward will have this field set and the
isNew
flag should be false.
After adding the removalStatus
to topic, the method flushes the producer and then reads it back,
which may block upto READ_TO_END_TIMEOUT_MS
.java.lang.InterruptedException
public BrokerRemovalStateRecord getBrokerRemovalStateRecord(int brokerId)
public java.util.Map<java.lang.Integer,BrokerRemovalStateRecord> getAllBrokerRemovalStateRecords()
public void addBrokerRemovalStateRecord(BrokerRemovalStateRecord stateRecord)
public kafka.common.BrokerAddStatus getBrokerAddStatus(int brokerId)
public java.util.Map<java.lang.Integer,kafka.common.BrokerAddStatus> getAllBrokerAddStatus()
public void addBrokerAddStatus(kafka.common.BrokerAddStatus status)
public static void checkStartupCondition(KafkaCruiseControlConfig config, java.util.concurrent.Semaphore abortStartupCheck)
CruiseControlComponent
is satisfied.