Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...


package org.apache.kafka.server;

/**

...

*

...

An

...

interface

...

for

...

enforcing

...

a

...

policy

...

on

...

the

...

records

...

that

...

are

...

accepted

...

by

...

this

...

*

...

broker.

...

*

...


...

*

...

A

...

common

...

use

...

case

...

is

...

for

...

validating

...

that

...

records

...

contain

...

the

...

correct

...

schema

...

*

...

information.

...

*

...


...

*

...

If the broker config <code>record.validation.policy.class.

...

name</code>

...

is

...

defined,

...

Kafka

...

will

...

*

...

create

...

an

...

instance

...

of

...

the

...

specified

...

class

...

using

...

the

...

default

...

constructor

...

and

...

*

...

will

...

then

...

pass

...

the

...

broker

...

configs

...

to

...

its

...

<code>configure()</code>

...

method.

...

*

...

During

...

broker

...

shutdown,

...

the

...

<code>close()</code>

...

method

...

will

...

be

...

invoked

...

so

...

*

...

that

...

resources

...

can

...

be

...

released

...

(if

...

necessary).
*
* If the broker config <code>record.validation.policy.class.path</code> is defined,
* the RecordValidationPolicy implementation and its dependent libraries will be loaded
* by a dedicated classloader which searches this class path before the Kafka broker class path.
* The syntax of this string parameter that of a Java class path.
*/

public interface RecordValidationPolicy extends Configurable, Closeable {

/**
* TopicMetadata describes the topic-partition a record is being produced to.
*/
public interface TopicMetadata {
TopicPartition topicPartition();

/**
* @return the value of the topic config <code>"validation.policy"</code>
*/
String validationPolicy();
}

...

The fully qualified name of a class that implements a record validation policy. If no class name is defined then the defaultbehavior is to perform no validation on the records sent to the broker.

Type: string

Default: null

Valid values:

Importance: low

Update mode: read-only


record.validation.policy.class.path

An optional Java class path for the RecordValidationPolicy implementation. If specified, the RecordValidationPolicy implementation and its dependent libraries will be loaded by a dedicated classloader which searches this class path before the Kafka broker class path. The syntax of this string parameter that of a Java class path.

Type: string

Default: null

...