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 TypeFieldDescriptionlongThe 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.SchemaA 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.SchemalongGets the value of the 'rewindStartTimestamp' field.org.apache.avro.SchemaGets the value of the 'sourceKafkaServers' field.Gets the value of the 'sourceTopicName' field.org.apache.avro.specific.SpecificDatavoidvoidvoidsetRewindStartTimestamp(long value) Sets the value of the 'rewindStartTimestamp' field.voidsetSourceKafkaServers(List<CharSequence> value) Sets the value of the 'sourceKafkaServers' field.voidsetSourceTopicName(CharSequence value) Sets the value of the 'sourceTopicName' field.voidMethods inherited from class org.apache.avro.specific.SpecificRecordBase
compareTo, customDecode, customEncode, equals, get, getConversion, getConversion, hasCustomCoders, hashCode, put, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:
getSpecificDatain classorg.apache.avro.specific.SpecificRecordBase
-
getSchema
public org.apache.avro.Schema getSchema()- Specified by:
getSchemain interfaceorg.apache.avro.generic.GenericContainer- Specified by:
getSchemain classorg.apache.avro.specific.SpecificRecordBase
-
get
- Specified by:
getin interfaceorg.apache.avro.generic.IndexedRecord- Specified by:
getin classorg.apache.avro.specific.SpecificRecordBase
-
put
- Specified by:
putin interfaceorg.apache.avro.generic.IndexedRecord- Specified by:
putin 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:
writeExternalin interfaceExternalizable- Overrides:
writeExternalin classorg.apache.avro.specific.SpecificRecordBase- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Overrides:
readExternalin classorg.apache.avro.specific.SpecificRecordBase- Throws:
IOException
-