Class TopicSwitch
java.lang.Object
org.apache.avro.specific.SpecificRecordBase
com.linkedin.venice.kafka.protocol.TopicSwitch
- All Implemented Interfaces:
Externalizable
,Serializable
,Comparable<org.apache.avro.specific.SpecificRecord>
,org.apache.avro.generic.GenericContainer
,org.apache.avro.generic.GenericRecord
,org.apache.avro.generic.IndexedRecord
,org.apache.avro.specific.SpecificRecord
public class TopicSwitch
extends org.apache.avro.specific.SpecificRecordBase
implements org.apache.avro.specific.SpecificRecord
This ControlMessage is sent by the Controller, once per partition; it will only be used in leader/follower state transition model; this control message will indicate the leader to switch to a new source topic and start consuming from offset with a specific timestamp.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionlong
The creation time of this control message in parent controller minus the rewind time of the corresponding store; leaders in different fabrics will get the offset of the source topic by the same start timestamp and start consuming from there; if timestamp is 0, leader will start consuming from the beginning of the source topic.static final org.apache.avro.Schema
A list of Kafka bootstrap servers URLs where the new source topic exists; currently there will be only one URL in the list, but the list opens up the possibility for leader to consume from different fabrics in active-active replication mode.Name of new the source topic. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.TopicSwitch
(List<CharSequence> sourceKafkaServers, CharSequence sourceTopicName, Long rewindStartTimestamp) All-args constructor. -
Method Summary
Modifier and TypeMethodDescriptionget
(int field$) static org.apache.avro.Schema
long
Gets the value of the 'rewindStartTimestamp' field.org.apache.avro.Schema
Gets the value of the 'sourceKafkaServers' field.Gets the value of the 'sourceTopicName' field.org.apache.avro.specific.SpecificData
void
void
void
setRewindStartTimestamp
(long value) Sets the value of the 'rewindStartTimestamp' field.void
setSourceKafkaServers
(List<CharSequence> value) Sets the value of the 'sourceKafkaServers' field.void
setSourceTopicName
(CharSequence value) Sets the value of the 'sourceTopicName' field.void
Methods inherited from class org.apache.avro.specific.SpecificRecordBase
compareTo, customDecode, customEncode, equals, get, getConversion, getConversion, hasCustomCoders, hashCode, put, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.avro.generic.GenericRecord
hasField
-
Field Details
-
SCHEMA$
public static final org.apache.avro.Schema SCHEMA$ -
sourceKafkaServers
A list of Kafka bootstrap servers URLs where the new source topic exists; currently there will be only one URL in the list, but the list opens up the possibility for leader to consume from different fabrics in active-active replication mode. -
sourceTopicName
Name of new the source topic. -
rewindStartTimestamp
public long rewindStartTimestampThe creation time of this control message in parent controller minus the rewind time of the corresponding store; leaders in different fabrics will get the offset of the source topic by the same start timestamp and start consuming from there; if timestamp is 0, leader will start consuming from the beginning of the source topic. if timestmap is -2 then leader will calculate the timestamp itself based on SOP/EOP's producer timestamp
-
-
Constructor Details
-
TopicSwitch
public TopicSwitch()Default constructor. Note that this does not initialize fields to their default values from the schema. If that is desired then one should usenewBuilder()
. -
TopicSwitch
public TopicSwitch(List<CharSequence> sourceKafkaServers, CharSequence sourceTopicName, Long rewindStartTimestamp) All-args constructor.- Parameters:
sourceKafkaServers
- A list of Kafka bootstrap servers URLs where the new source topic exists; currently there will be only one URL in the list, but the list opens up the possibility for leader to consume from different fabrics in active-active replication mode.sourceTopicName
- Name of new the source topic.rewindStartTimestamp
- The creation time of this control message in parent controller minus the rewind time of the corresponding store; leaders in different fabrics will get the offset of the source topic by the same start timestamp and start consuming from there; if timestamp is 0, leader will start consuming from the beginning of the source topic. if timestmap is -2 then leader will calculate the timestamp itself based on SOP/EOP's producer timestamp
-
-
Method Details
-
getClassSchema
public static org.apache.avro.Schema getClassSchema() -
getSpecificData
public org.apache.avro.specific.SpecificData getSpecificData()- Overrides:
getSpecificData
in classorg.apache.avro.specific.SpecificRecordBase
-
getSchema
public org.apache.avro.Schema getSchema()- Specified by:
getSchema
in interfaceorg.apache.avro.generic.GenericContainer
- Specified by:
getSchema
in classorg.apache.avro.specific.SpecificRecordBase
-
get
- Specified by:
get
in interfaceorg.apache.avro.generic.IndexedRecord
- Specified by:
get
in classorg.apache.avro.specific.SpecificRecordBase
-
put
- Specified by:
put
in interfaceorg.apache.avro.generic.IndexedRecord
- Specified by:
put
in classorg.apache.avro.specific.SpecificRecordBase
-
getSourceKafkaServers
Gets the value of the 'sourceKafkaServers' field.- Returns:
- A list of Kafka bootstrap servers URLs where the new source topic exists; currently there will be only one URL in the list, but the list opens up the possibility for leader to consume from different fabrics in active-active replication mode.
-
setSourceKafkaServers
Sets the value of the 'sourceKafkaServers' field. A list of Kafka bootstrap servers URLs where the new source topic exists; currently there will be only one URL in the list, but the list opens up the possibility for leader to consume from different fabrics in active-active replication mode.- Parameters:
value
- the value to set.
-
getSourceTopicName
Gets the value of the 'sourceTopicName' field.- Returns:
- Name of new the source topic.
-
setSourceTopicName
Sets the value of the 'sourceTopicName' field. Name of new the source topic.- Parameters:
value
- the value to set.
-
getRewindStartTimestamp
public long getRewindStartTimestamp()Gets the value of the 'rewindStartTimestamp' field.- Returns:
- The creation time of this control message in parent controller minus the rewind time of the corresponding store; leaders in different fabrics will get the offset of the source topic by the same start timestamp and start consuming from there; if timestamp is 0, leader will start consuming from the beginning of the source topic. if timestmap is -2 then leader will calculate the timestamp itself based on SOP/EOP's producer timestamp
-
setRewindStartTimestamp
public void setRewindStartTimestamp(long value) Sets the value of the 'rewindStartTimestamp' field. The creation time of this control message in parent controller minus the rewind time of the corresponding store; leaders in different fabrics will get the offset of the source topic by the same start timestamp and start consuming from there; if timestamp is 0, leader will start consuming from the beginning of the source topic. if timestmap is -2 then leader will calculate the timestamp itself based on SOP/EOP's producer timestamp- Parameters:
value
- the value to set.
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Overrides:
writeExternal
in classorg.apache.avro.specific.SpecificRecordBase
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Overrides:
readExternal
in classorg.apache.avro.specific.SpecificRecordBase
- Throws:
IOException
-