Class TopicSwitch
- java.lang.Object
-
- org.apache.avro.specific.SpecificRecordBase
-
- com.linkedin.venice.kafka.protocol.TopicSwitch
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable,java.lang.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.SpecificRecordThis 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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description longrewindStartTimestampThe 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 org.apache.avro.SchemaSCHEMA$java.util.List<java.lang.CharSequence>sourceKafkaServersA 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.java.lang.CharSequencesourceTopicNameName of new the source topic.
-
Constructor Summary
Constructors Constructor Description TopicSwitch()Default constructor.TopicSwitch(java.util.List<java.lang.CharSequence> sourceKafkaServers, java.lang.CharSequence sourceTopicName, java.lang.Long rewindStartTimestamp)All-args constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectget(int field$)static org.apache.avro.SchemagetClassSchema()longgetRewindStartTimestamp()Gets the value of the 'rewindStartTimestamp' field.org.apache.avro.SchemagetSchema()java.util.List<java.lang.CharSequence>getSourceKafkaServers()Gets the value of the 'sourceKafkaServers' field.java.lang.CharSequencegetSourceTopicName()Gets the value of the 'sourceTopicName' field.org.apache.avro.specific.SpecificDatagetSpecificData()voidput(int field$, java.lang.Object value$)voidreadExternal(java.io.ObjectInput in)voidsetRewindStartTimestamp(long value)Sets the value of the 'rewindStartTimestamp' field.voidsetSourceKafkaServers(java.util.List<java.lang.CharSequence> value)Sets the value of the 'sourceKafkaServers' field.voidsetSourceTopicName(java.lang.CharSequence value)Sets the value of the 'sourceTopicName' field.voidwriteExternal(java.io.ObjectOutput out)-
Methods inherited from class org.apache.avro.specific.SpecificRecordBase
compareTo, customDecode, customEncode, equals, get, getConversion, getConversion, hasCustomCoders, hashCode, put, toString
-
-
-
-
Field Detail
-
SCHEMA$
public static final org.apache.avro.Schema SCHEMA$
-
sourceKafkaServers
public java.util.List<java.lang.CharSequence> 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
public java.lang.CharSequence sourceTopicName
Name of new the source topic.
-
rewindStartTimestamp
public long 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
-
-
Constructor Detail
-
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(java.util.List<java.lang.CharSequence> sourceKafkaServers, java.lang.CharSequence sourceTopicName, java.lang.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 Detail
-
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
public java.lang.Object get(int field$)
- Specified by:
getin interfaceorg.apache.avro.generic.IndexedRecord- Specified by:
getin classorg.apache.avro.specific.SpecificRecordBase
-
put
public void put(int field$, java.lang.Object value$)- Specified by:
putin interfaceorg.apache.avro.generic.IndexedRecord- Specified by:
putin classorg.apache.avro.specific.SpecificRecordBase
-
getSourceKafkaServers
public java.util.List<java.lang.CharSequence> 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
public void setSourceKafkaServers(java.util.List<java.lang.CharSequence> value)
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
public java.lang.CharSequence getSourceTopicName()
Gets the value of the 'sourceTopicName' field.- Returns:
- Name of new the source topic.
-
setSourceTopicName
public void setSourceTopicName(java.lang.CharSequence value)
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
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException- Specified by:
writeExternalin interfacejava.io.Externalizable- Overrides:
writeExternalin classorg.apache.avro.specific.SpecificRecordBase- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException- Specified by:
readExternalin interfacejava.io.Externalizable- Overrides:
readExternalin classorg.apache.avro.specific.SpecificRecordBase- Throws:
java.io.IOException
-
-