public class DataplaneAuthStore extends Object implements AuthStore, ConsumerListener<AuthKey,AuthValue>
Constructor and Description |
---|
DataplaneAuthStore(io.confluent.security.rbac.RbacRoles rbacRoles,
org.apache.kafka.common.utils.Time time,
io.confluent.security.authorizer.Scope scope,
org.apache.kafka.server.authorizer.internals.ConfluentAuthorizerServerInfo serverInfo,
int numAuthTopicPartitions) |
DataplaneAuthStore(io.confluent.security.authorizer.Scope scope,
org.apache.kafka.server.authorizer.internals.ConfluentAuthorizerServerInfo serverInfo) |
Modifier and Type | Method and Description |
---|---|
Collection<URL> |
activeNodeUrls(String protocol)
Returns the collection of URLS of currently active nodes.
|
DefaultAuthCache |
authCache()
Returns a cache that stores all data read from the auth topic.
|
void |
close() |
void |
configure(Map<String,?> configs) |
boolean |
isMasterWriter()
Returns true if this node is currently the master writer.
|
Integer |
masterWriterId()
Returns the broker id of the master writer.
|
URL |
masterWriterUrl(String protocol)
Returns the URL of the master writer node for the specified protocol.
|
void |
onConsumerRecord(org.apache.kafka.clients.consumer.ConsumerRecord<AuthKey,AuthValue> record,
AuthValue oldValue)
Notification of new record consumed by local reader
|
CompletionStage<Void> |
startReader()
Starts the metadata reader and returns a completion stage that is completed when
existing metadata from the store has been loaded into the cache.
|
CompletionStage<Void> |
startService(Collection<URL> nodeUrls)
Starts the metadata coordinator and writer.
|
AuthWriter |
writer()
Returns a writer instance that can be used to update this store.
|
public DataplaneAuthStore(io.confluent.security.authorizer.Scope scope, org.apache.kafka.server.authorizer.internals.ConfluentAuthorizerServerInfo serverInfo)
public DataplaneAuthStore(io.confluent.security.rbac.RbacRoles rbacRoles, org.apache.kafka.common.utils.Time time, io.confluent.security.authorizer.Scope scope, org.apache.kafka.server.authorizer.internals.ConfluentAuthorizerServerInfo serverInfo, int numAuthTopicPartitions)
public void configure(Map<String,?> configs)
configure
in interface org.apache.kafka.common.Configurable
public DefaultAuthCache authCache()
AuthStore
public CompletionStage<Void> startReader()
AuthStore
startReader
in interface AuthStore
public CompletionStage<Void> startService(Collection<URL> nodeUrls)
AuthStore
startService
in interface AuthStore
nodeUrls
- The URLs of metadata server hosting this store. Metadata server URLs must be
unique across the cluster since they are used as node ids for master writer
election. The URLs are also used for redirection of update requests to the
current master writer of the metadata service.public AuthWriter writer()
AuthStore
public boolean isMasterWriter()
AuthStore
isMasterWriter
in interface AuthStore
public URL masterWriterUrl(String protocol)
AuthStore
masterWriterUrl
in interface AuthStore
protocol
- The protocol for which master writer is requested, e.g. httpspublic Integer masterWriterId()
AuthStore
masterWriterId
in interface AuthStore
public Collection<URL> activeNodeUrls(String protocol)
AuthStore
activeNodeUrls
in interface AuthStore
protocol
- The protocol for which node urls are requested, e.g. httpspublic void close()
close
in interface Closeable
close
in interface AutoCloseable
public void onConsumerRecord(org.apache.kafka.clients.consumer.ConsumerRecord<AuthKey,AuthValue> record, AuthValue oldValue)
ConsumerListener
onConsumerRecord
in interface ConsumerListener<AuthKey,AuthValue>
record
- the record from consumeroldValue
- old value corresponding to record key from local cache