diff --git a/docs/conf.py b/docs/conf.py index 11c453d..73a0ab9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -50,8 +50,8 @@ # source_suffix = ['.rst', '.md'] source_suffix = ".rst" -# The master toctree document. -master_doc = "index" +# The main toctree document. +main_doc = "index" # General information about the project. project = "photon-pump" @@ -132,7 +132,7 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, "photon-pump.tex", "photon-pump Documentation", "Made.com", "manual") + (main_doc, "photon-pump.tex", "photon-pump Documentation", "Made.com", "manual") ] @@ -140,7 +140,7 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [(master_doc, "photon-pump", "photon-pump Documentation", [author], 1)] +man_pages = [(main_doc, "photon-pump", "photon-pump Documentation", [author], 1)] # -- Options for Texinfo output ------------------------------------------- @@ -150,7 +150,7 @@ # dir menu entry, description, category) texinfo_documents = [ ( - master_doc, + main_doc, "photon-pump", "photon-pump Documentation", author, diff --git a/photonpump/_version.py b/photonpump/_version.py index 9c7f0ca..f165236 100644 --- a/photonpump/_version.py +++ b/photonpump/_version.py @@ -189,7 +189,7 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose): # refs/heads/ and refs/tags/ prefixes that would let us distinguish # between branches and tags. By ignoring refnames without digits, we # filter out many common branch names like "release" and - # "stabilization", as well as "HEAD" and "master". + # "stabilization", as well as "HEAD" and "main". tags = set([r for r in refs if re.search(r'\d', r)]) if verbose: print("discarding '%s', no digits" % ",".join(refs - tags)) diff --git a/photonpump/connection.py b/photonpump/connection.py index bc7744a..fd2518d 100644 --- a/photonpump/connection.py +++ b/photonpump/connection.py @@ -611,7 +611,7 @@ async def publish_event( id: Optional[uuid.UUID] = None, metadata: Optional[Any] = None, expected_version: int = -2, - require_master: bool = False, + require_main: bool = False, ) -> None: """ Publish a single event to the EventStore. @@ -637,7 +637,7 @@ async def publish_event( -1: NoStream. Checks that the stream does not yet exist. 0: EmptyStream. Checks that the stream has been explicitly created but does not yet contain any events. - require_master: If true, slave nodes will reject this message. + require_main: If true, subordinate nodes will reject this message. Examples: @@ -661,7 +661,7 @@ async def publish_event( stream, [event], expected_version=expected_version, - require_master=require_master, + require_main=require_main, credential=self.credential, ) result = await self.dispatcher.start_conversation(conversation) @@ -673,13 +673,13 @@ async def publish( stream: str, events: Sequence[msg.NewEventData], expected_version=msg.ExpectedVersion.Any, - require_master=False, + require_main=False, ): cmd = convo.WriteEvents( stream, events, expected_version=expected_version, - require_master=require_master, + require_main=require_main, credential=self.credential, ) result = await self.dispatcher.start_conversation(cmd) @@ -690,7 +690,7 @@ async def get_event( stream: str, event_number: int, resolve_links=True, - require_master=False, + require_main=False, correlation_id: uuid.UUID = None, ) -> msg.Event: """ @@ -701,8 +701,8 @@ async def get_event( event_number: The sequence number of the event to read. resolve_links (optional): True if eventstore should automatically resolve Link Events, otherwise False. - required_master (optional): True if this command must be - sent direct to the master node, otherwise False. + required_main (optional): True if this command must be + sent direct to the main node, otherwise False. correlation_id (optional): A unique identifer for this command. @@ -721,7 +721,7 @@ async def get_event( stream, event_number, resolve_links, - require_master, + require_main, conversation_id=correlation_id, credential=self.credential, ) @@ -737,7 +737,7 @@ async def get( from_event: int = 0, max_count: int = 100, resolve_links: bool = True, - require_master: bool = False, + require_main: bool = False, correlation_id: uuid.UUID = None, ): """ @@ -753,8 +753,8 @@ async def get( max_count (optional): The maximum number of events to return. resolve_links (optional): True if eventstore should automatically resolve Link Events, otherwise False. - required_master (optional): True if this command must be - sent direct to the master node, otherwise False. + required_main (optional): True if this command must be + sent direct to the main node, otherwise False. correlation_id (optional): A unique identifer for this command. Examples: @@ -785,7 +785,7 @@ async def get( from_event, max_count, resolve_links, - require_master, + require_main, direction=direction, credential=self.credential, ) @@ -799,7 +799,7 @@ async def get_all( from_position: Optional[Union[msg.Position, msg._PositionSentinel]] = None, max_count: int = 100, resolve_links: bool = True, - require_master: bool = False, + require_main: bool = False, correlation_id: uuid.UUID = None, ): """ @@ -814,8 +814,8 @@ async def get_all( max_count (optional): The maximum number of events to return. resolve_links (optional): True if eventstore should automatically resolve Link Events, otherwise False. - required_master (optional): True if this command must be - sent direct to the master node, otherwise False. + required_main (optional): True if this command must be + sent direct to the main node, otherwise False. correlation_id (optional): A unique identifer for this command. Examples: @@ -839,7 +839,7 @@ async def get_all( msg.Position.for_direction(direction, from_position), max_count, resolve_links, - require_master, + require_main, direction=direction, credential=self.credential, ) @@ -854,7 +854,7 @@ async def iter( from_event: int = None, batch_size: int = 100, resolve_links: bool = True, - require_master: bool = False, + require_main: bool = False, correlation_id: uuid.UUID = None, ): """ @@ -869,8 +869,8 @@ async def iter( batch_size: The maximum number of events to read at a time. resolve_links (optional): True if eventstore should automatically resolve Link Events, otherwise False. - required_master (optional): True if this command must be - sent direct to the master node, otherwise False. + required_main (optional): True if this command must be + sent direct to the main node, otherwise False. correlation_id (optional): A unique identifer for this command. @@ -915,7 +915,7 @@ async def iter_all( from_position: Optional[Union[msg.Position, msg._PositionSentinel]] = None, batch_size: int = 100, resolve_links: bool = True, - require_master: bool = False, + require_main: bool = False, correlation_id: Optional[uuid.UUID] = None, ): """ @@ -930,8 +930,8 @@ async def iter_all( batch_size (optional): The maximum number of events to read at a time. resolve_links (optional): True if eventstore should automatically resolve Link Events, otherwise False. - required_master (optional): True if this command must be - sent direct to the master node, otherwise False. + required_main (optional): True if this command must be + sent direct to the main node, otherwise False. correlation_id (optional): A unique identifer for this command. @@ -962,7 +962,7 @@ async def iter_all( msg.Position.for_direction(direction, from_position), batch_size, resolve_links, - require_master, + require_main, direction, self.credential, correlation_id, @@ -1054,8 +1054,8 @@ async def subscribe_to( resolve_links (optional): True if eventstore should automatically resolve Link Events, otherwise False. - required_master (optional): True if this command must be - sent direct to the master node, otherwise False. + required_main (optional): True if this command must be + sent direct to the main node, otherwise False. correlation_id (optional): A unique identifer for this command. batch_size (optioal): The number of events to pull down from @@ -1236,21 +1236,21 @@ def connect( If you're using :meth:`persistent subscriptions ` - you will always want to connect to the master node of the cluster. + you will always want to connect to the main node of the cluster. The selector parameter is a function that chooses an available node from - the gossip result. To select the master node, use the - :func:`photonpump.discovery.prefer_master` function. This function will return - the master node if there is a live master, and a random replica otherwise. - All requests to the server can be made with the require_master flag which - will raise an error if the current node is not a master. + the gossip result. To select the main node, use the + :func:`photonpump.discovery.prefer_main` function. This function will return + the main node if there is a live main, and a random replica otherwise. + All requests to the server can be made with the require_main flag which + will raise an error if the current node is not a main. >>> async with connect( >>> discovery_host="eventstore.test", - >>> selector=discovery.prefer_master, + >>> selector=discovery.prefer_main, >>> ) as c: - >>> await c.ping(require_master=True) + >>> await c.ping(require_main=True) - Conversely, you might want to avoid connecting to the master node for reasons + Conversely, you might want to avoid connecting to the main node for reasons of scalability. For this you can use the :func:`photonpump.discovery.prefer_replica` function. diff --git a/photonpump/conversations.py b/photonpump/conversations.py index 7c546e5..bad2058 100644 --- a/photonpump/conversations.py +++ b/photonpump/conversations.py @@ -149,8 +149,8 @@ async def unhandled_message(self, response) -> None: exn = exceptions.NotReady(self.conversation_id) elif body.reason == NotHandledReason.TooBusy: exn = exceptions.TooBusy(self.conversation_id) - elif body.reason == NotHandledReason.NotMaster: - exn = exceptions.NotMaster(self.conversation_id) + elif body.reason == NotHandledReason.NotMain: + exn = exceptions.NotMain(self.conversation_id) else: exn = exceptions.NotHandled(self.conversation_id, body.reason) @@ -245,8 +245,8 @@ class WriteEvents(Conversation): events: A sequence of events to write. expected_version (optional): The expected version of the target stream used for concurrency control. - required_master (optional): True if this command must be - sent direct to the master node, otherwise False. + required_main (optional): True if this command must be + sent direct to the main node, otherwise False. correlation_id (optional): A unique identifer for this command. @@ -257,7 +257,7 @@ def __init__( stream: str, events: Sequence[NewEvent], expected_version: Union[ExpectedVersion, int] = ExpectedVersion.Any, - require_master: bool = False, + require_main: bool = False, conversation_id: UUID = None, credential=None, loop=None, @@ -265,14 +265,14 @@ def __init__( super().__init__(conversation_id, credential) self._logger = logging.get_named_logger(WriteEvents) self.stream = stream - self.require_master = require_master + self.require_main = require_main self.events = events self.expected_version = expected_version async def start(self, output: Queue) -> None: msg = proto.WriteEvents() msg.event_stream_id = self.stream - msg.require_master = self.require_master + msg.require_main = self.require_main msg.expected_version = self.expected_version for event in self.events: @@ -443,8 +443,8 @@ class ReadEvent(Conversation): event_number: The sequence number of the event to read. resolve_links (optional): True if eventstore should automatically resolve Link Events, otherwise False. - required_master (optional): True if this command must be - sent direct to the master node, otherwise False. + required_main (optional): True if this command must be + sent direct to the main node, otherwise False. correlation_id (optional): A unique identifer for this command. @@ -455,7 +455,7 @@ def __init__( stream: str, event_number: int, resolve_links: bool = True, - require_master: bool = False, + require_main: bool = False, conversation_id: Optional[UUID] = None, credential=None, ) -> None: @@ -463,7 +463,7 @@ def __init__( super().__init__(conversation_id, credential=credential) self.stream = stream self.event_number = event_number - self.require_master = require_master + self.require_main = require_main self.resolve_link_tos = resolve_links self.name = stream @@ -471,7 +471,7 @@ async def start(self, output: Queue) -> None: msg = proto.ReadEvent() msg.event_number = self.event_number msg.event_stream_id = self.stream - msg.require_master = self.require_master + msg.require_main = self.require_main msg.resolve_link_tos = self.resolve_link_tos data = msg.SerializeToString() @@ -505,7 +505,7 @@ def page_stream_message(conversation, from_event): msg.event_stream_id = conversation.stream msg.from_event_number = from_event msg.max_count = conversation.batch_size - msg.require_master = conversation.require_master + msg.require_main = conversation.require_main msg.resolve_link_tos = conversation.resolve_link_tos data = msg.SerializeToString() @@ -525,7 +525,7 @@ def page_all_message(conversation, from_position: Position): msg.commit_position = from_position.commit msg.prepare_position = from_position.prepare msg.max_count = conversation.batch_size - msg.require_master = conversation.require_master + msg.require_main = conversation.require_main msg.resolve_link_tos = conversation.resolve_link_tos data = msg.SerializeToString() @@ -543,8 +543,8 @@ class ReadAllEvents(Conversation): event_number: The sequence number of the event to read. resolve_links (optional): True if eventstore should automatically resolve Link Events, otherwise False. - required_master (optional): True if this command must be - sent direct to the master node, otherwise False. + required_main (optional): True if this command must be + sent direct to the main node, otherwise False. correlation_id (optional): A unique identifer for this command. """ @@ -554,7 +554,7 @@ def __init__( from_position: Optional[Position] = None, max_count: int = 100, resolve_links: bool = True, - require_master: bool = False, + require_main: bool = False, direction: StreamDirection = StreamDirection.Forward, credential=None, conversation_id: UUID = None, @@ -565,7 +565,7 @@ def __init__( self.direction = direction self.from_position = from_position self.batch_size = max_count - self.require_master = require_master + self.require_main = require_main self.resolve_link_tos = resolve_links async def reply(self, message: InboundMessage, output: Queue) -> None: @@ -596,8 +596,8 @@ class ReadStreamEvents(Conversation): event_number: The sequence number of the event to read. resolve_links (optional): True if eventstore should automatically resolve Link Events, otherwise False. - required_master (optional): True if this command must be - sent direct to the master node, otherwise False. + required_main (optional): True if this command must be + sent direct to the main node, otherwise False. correlation_id (optional): A unique identifer for this command. """ @@ -608,7 +608,7 @@ def __init__( from_event: int = 0, max_count: int = 100, resolve_links: bool = True, - require_master: bool = False, + require_main: bool = False, direction: StreamDirection = StreamDirection.Forward, credential=None, conversation_id: UUID = None, @@ -620,7 +620,7 @@ def __init__( self.direction = direction self.from_event = from_event self.batch_size = max_count - self.require_master = require_master + self.require_main = require_main self.resolve_link_tos = resolve_links async def reply(self, message: InboundMessage, output: Queue): @@ -664,8 +664,8 @@ class IterAllEvents(Conversation): batch_size (optional): The maximum number of events to read at a time. resolve_links (optional): True if eventstore should automatically resolve Link Events, otherwise False. - require_master (optional): True if this command must be - sent direct to the master node, otherwise False. + require_main (optional): True if this command must be + sent direct to the main node, otherwise False. direction (optional): Controls whether to read forward or backward through the events. Defaults to StreamDirection.Forward correlation_id (optional): A unique identifer for this @@ -677,7 +677,7 @@ def __init__( from_position: Position = None, batch_size: int = 100, resolve_links: bool = True, - require_master: bool = False, + require_main: bool = False, direction: StreamDirection = StreamDirection.Forward, credential=None, conversation_id: UUID = None, @@ -687,7 +687,7 @@ def __init__( self.batch_size = batch_size self.has_first_page = False self.resolve_link_tos = resolve_links - self.require_master = require_master + self.require_main = require_main self.from_position = from_position or Position(0, 0) self.direction = direction self._logger = logging.get_named_logger(IterAllEvents) @@ -745,8 +745,8 @@ class IterStreamEvents(Conversation): stream: The name of the stream containing the event. resolve_links (optional): True if eventstore should automatically resolve Link Events, otherwise False. - required_master (optional): True if this command must be - sent direct to the master node, otherwise False. + required_main (optional): True if this command must be + sent direct to the main node, otherwise False. correlation_id (optional): A unique identifer for this command. @@ -758,7 +758,7 @@ def __init__( from_event: int = None, batch_size: int = 100, resolve_links: bool = True, - require_master: bool = False, + require_main: bool = False, direction: StreamDirection = StreamDirection.Forward, credential=None, conversation_id: UUID = None, @@ -769,7 +769,7 @@ def __init__( self.has_first_page = False self.stream = stream self.resolve_link_tos = resolve_links - self.require_master = require_master + self.require_main = require_main self.direction = direction self._logger = logging.get_named_logger(IterStreamEvents) self.iterator = StreamingIterator(self.batch_size) @@ -1324,7 +1324,7 @@ def __init__( self.direction = StreamDirection.Forward self.batch_size = batch_size self.has_first_page = False - self.require_master = False + self.require_main = False self.resolve_link_tos = True self.credential = credential self.result = Future() @@ -1439,7 +1439,7 @@ def __init__( self.direction = StreamDirection.Forward self.batch_size = batch_size self.has_first_page = False - self.require_master = False + self.require_main = False self.resolve_link_tos = True self.credential = credential self.result = Future() @@ -1478,7 +1478,7 @@ async def start(self, output): msg.prepare_position = self.from_position.prepare msg.max_count = self.batch_size msg.resolve_link_tos = self.resolve_link_tos - msg.require_master = self.require_master + msg.require_main = self.require_main data = msg.SerializeToString() diff --git a/photonpump/discovery.py b/photonpump/discovery.py index 2f3b6a1..97bef81 100644 --- a/photonpump/discovery.py +++ b/photonpump/discovery.py @@ -18,15 +18,15 @@ class NodeState(IntEnum): PreReplica = 2 CatchingUp = 3 Clone = 4 - Slave = 5 - PreMaster = 6 - Master = 7 + Subordinate = 5 + PreMain = 6 + Main = 7 Manager = 8 ShuttingDown = 9 Shutdown = 10 -ELIGIBLE_STATE = [NodeState.Clone, NodeState.Slave, NodeState.Master] +ELIGIBLE_STATE = [NodeState.Clone, NodeState.Subordinate, NodeState.Main] KEEP_RETRYING = -1 @@ -58,26 +58,26 @@ def first(elems: Iterable): return elem -def prefer_master(nodes: List[DiscoveredNode]) -> Optional[DiscoveredNode]: +def prefer_main(nodes: List[DiscoveredNode]) -> Optional[DiscoveredNode]: """ - Select the master if available, otherwise fall back to a replica. + Select the main if available, otherwise fall back to a replica. """ return max(nodes, key=attrgetter("state")) def prefer_replica(nodes: List[DiscoveredNode]) -> Optional[DiscoveredNode]: """ - Select a random replica if any are available or fall back to the master. + Select a random replica if any are available or fall back to the main. """ - masters = [node for node in nodes if node.state == NodeState.Master] - replicas = [node for node in nodes if node.state != NodeState.Master] + mains = [node for node in nodes if node.state == NodeState.Main] + replicas = [node for node in nodes if node.state != NodeState.Main] if replicas: return random.choice(replicas) else: - # if you have more than one master then you're on your own, bud. + # if you have more than one main then you're on your own, bud. - return masters[0] + return mains[0] def select_random(nodes: List[DiscoveredNode]) -> Optional[DiscoveredNode]: @@ -94,7 +94,7 @@ def select( node for node in gossip if node.is_alive and node.state in ELIGIBLE_STATE ] - selector = selector or prefer_master + selector = selector or prefer_main LOG.debug( "Selecting node using '%s' from gossip members: %r", selector, eligible_nodes ) diff --git a/photonpump/exceptions.py b/photonpump/exceptions.py index bce950a..8e0871b 100644 --- a/photonpump/exceptions.py +++ b/photonpump/exceptions.py @@ -88,9 +88,9 @@ def __init__(self, conversation_id): super().__init__(conversation_id, "Message not handled: Server too busy") -class NotMaster(ConversationException): +class NotMain(ConversationException): def __init__(self, conversation_id): - super().__init__(conversation_id, "Message not handled: Must be sent to master") + super().__init__(conversation_id, "Message not handled: Must be sent to main") class NotHandled(ConversationException): diff --git a/photonpump/messages.py b/photonpump/messages.py index e151a03..900537b 100644 --- a/photonpump/messages.py +++ b/photonpump/messages.py @@ -208,13 +208,13 @@ def __init__( payload: Any, creds: Credential = None, one_way: bool = False, - require_master=False, + require_main=False, ) -> None: self.conversation_id = conversation_id self.command = command self.payload = payload self.creds = creds - self.require_master = require_master + self.require_main = require_main self.data_length = len(payload) self.length = HEADER_LENGTH + self.data_length @@ -229,7 +229,7 @@ def header_bytes(self): struct.pack_into( ".EventStore.Client.Messages.ReadEventCompleted.ReadEventResult\x12?\n\x05\x65vent\x18\x02 \x02(\x0b\x32\x30.EventStore.Client.Messages.ResolvedIndexedEvent\x12\r\n\x05\x65rror\x18\x03 \x01(\t"j\n\x0fReadEventResult\x12\x0b\n\x07Success\x10\x00\x12\x0c\n\x08NotFound\x10\x01\x12\x0c\n\x08NoStream\x10\x02\x12\x11\n\rStreamDeleted\x10\x03\x12\t\n\x05\x45rror\x10\x04\x12\x10\n\x0c\x41\x63\x63\x65ssDenied\x10\x05"\x8b\x01\n\x10ReadStreamEvents\x12\x17\n\x0f\x65vent_stream_id\x18\x01 \x02(\t\x12\x19\n\x11\x66rom_event_number\x18\x02 \x02(\x05\x12\x11\n\tmax_count\x18\x03 \x02(\x05\x12\x18\n\x10resolve_link_tos\x18\x04 \x02(\x08\x12\x16\n\x0erequire_master\x18\x05 \x02(\x08"\xa2\x03\n\x19ReadStreamEventsCompleted\x12@\n\x06\x65vents\x18\x01 \x03(\x0b\x32\x30.EventStore.Client.Messages.ResolvedIndexedEvent\x12V\n\x06result\x18\x02 \x02(\x0e\x32\x46.EventStore.Client.Messages.ReadStreamEventsCompleted.ReadStreamResult\x12\x19\n\x11next_event_number\x18\x03 \x02(\x05\x12\x19\n\x11last_event_number\x18\x04 \x02(\x05\x12\x18\n\x10is_end_of_stream\x18\x05 \x02(\x08\x12\x1c\n\x14last_commit_position\x18\x06 \x02(\x03\x12\r\n\x05\x65rror\x18\x07 \x01(\t"n\n\x10ReadStreamResult\x12\x0b\n\x07Success\x10\x00\x12\x0c\n\x08NoStream\x10\x01\x12\x11\n\rStreamDeleted\x10\x02\x12\x0f\n\x0bNotModified\x10\x03\x12\t\n\x05\x45rror\x10\x04\x12\x10\n\x0c\x41\x63\x63\x65ssDenied\x10\x05"\x87\x01\n\rReadAllEvents\x12\x17\n\x0f\x63ommit_position\x18\x01 \x02(\x03\x12\x18\n\x10prepare_position\x18\x02 \x02(\x03\x12\x11\n\tmax_count\x18\x03 \x02(\x05\x12\x18\n\x10resolve_link_tos\x18\x04 \x02(\x08\x12\x16\n\x0erequire_master\x18\x05 \x02(\x08"\xf9\x02\n\x16ReadAllEventsCompleted\x12\x17\n\x0f\x63ommit_position\x18\x01 \x02(\x03\x12\x18\n\x10prepare_position\x18\x02 \x02(\x03\x12\x39\n\x06\x65vents\x18\x03 \x03(\x0b\x32).EventStore.Client.Messages.ResolvedEvent\x12\x1c\n\x14next_commit_position\x18\x04 \x02(\x03\x12\x1d\n\x15next_prepare_position\x18\x05 \x02(\x03\x12Y\n\x06result\x18\x06 \x01(\x0e\x32@.EventStore.Client.Messages.ReadAllEventsCompleted.ReadAllResult:\x07Success\x12\r\n\x05\x65rror\x18\x07 \x01(\t"J\n\rReadAllResult\x12\x0b\n\x07Success\x10\x00\x12\x0f\n\x0bNotModified\x10\x01\x12\t\n\x05\x45rror\x10\x02\x12\x10\n\x0c\x41\x63\x63\x65ssDenied\x10\x03"\xde\x03\n\x1c\x43reatePersistentSubscription\x12\x1f\n\x17subscription_group_name\x18\x01 \x02(\t\x12\x17\n\x0f\x65vent_stream_id\x18\x02 \x02(\t\x12\x18\n\x10resolve_link_tos\x18\x03 \x02(\x08\x12\x12\n\nstart_from\x18\x04 \x02(\x05\x12$\n\x1cmessage_timeout_milliseconds\x18\x05 \x02(\x05\x12\x19\n\x11record_statistics\x18\x06 \x02(\x08\x12\x18\n\x10live_buffer_size\x18\x07 \x02(\x05\x12\x17\n\x0fread_batch_size\x18\x08 \x02(\x05\x12\x13\n\x0b\x62uffer_size\x18\t \x02(\x05\x12\x17\n\x0fmax_retry_count\x18\n \x02(\x05\x12\x1a\n\x12prefer_round_robin\x18\x0b \x02(\x08\x12\x1d\n\x15\x63heckpoint_after_time\x18\x0c \x02(\x05\x12\x1c\n\x14\x63heckpoint_max_count\x18\r \x02(\x05\x12\x1c\n\x14\x63heckpoint_min_count\x18\x0e \x02(\x05\x12\x1c\n\x14subscriber_max_count\x18\x0f \x02(\x05\x12\x1f\n\x17named_consumer_strategy\x18\x10 \x01(\t"X\n\x1c\x44\x65letePersistentSubscription\x12\x1f\n\x17subscription_group_name\x18\x01 \x02(\t\x12\x17\n\x0f\x65vent_stream_id\x18\x02 \x02(\t"\xde\x03\n\x1cUpdatePersistentSubscription\x12\x1f\n\x17subscription_group_name\x18\x01 \x02(\t\x12\x17\n\x0f\x65vent_stream_id\x18\x02 \x02(\t\x12\x18\n\x10resolve_link_tos\x18\x03 \x02(\x08\x12\x12\n\nstart_from\x18\x04 \x02(\x05\x12$\n\x1cmessage_timeout_milliseconds\x18\x05 \x02(\x05\x12\x19\n\x11record_statistics\x18\x06 \x02(\x08\x12\x18\n\x10live_buffer_size\x18\x07 \x02(\x05\x12\x17\n\x0fread_batch_size\x18\x08 \x02(\x05\x12\x13\n\x0b\x62uffer_size\x18\t \x02(\x05\x12\x17\n\x0fmax_retry_count\x18\n \x02(\x05\x12\x1a\n\x12prefer_round_robin\x18\x0b \x02(\x08\x12\x1d\n\x15\x63heckpoint_after_time\x18\x0c \x02(\x05\x12\x1c\n\x14\x63heckpoint_max_count\x18\r \x02(\x05\x12\x1c\n\x14\x63heckpoint_min_count\x18\x0e \x02(\x05\x12\x1c\n\x14subscriber_max_count\x18\x0f \x02(\x05\x12\x1f\n\x17named_consumer_strategy\x18\x10 \x01(\t"\x97\x02\n%UpdatePersistentSubscriptionCompleted\x12}\n\x06result\x18\x01 \x02(\x0e\x32\x64.EventStore.Client.Messages.UpdatePersistentSubscriptionCompleted.UpdatePersistentSubscriptionResult:\x07Success\x12\x0e\n\x06reason\x18\x02 \x01(\t"_\n"UpdatePersistentSubscriptionResult\x12\x0b\n\x07Success\x10\x00\x12\x10\n\x0c\x44oesNotExist\x10\x01\x12\x08\n\x04\x46\x61il\x10\x02\x12\x10\n\x0c\x41\x63\x63\x65ssDenied\x10\x03"\x98\x02\n%CreatePersistentSubscriptionCompleted\x12}\n\x06result\x18\x01 \x02(\x0e\x32\x64.EventStore.Client.Messages.CreatePersistentSubscriptionCompleted.CreatePersistentSubscriptionResult:\x07Success\x12\x0e\n\x06reason\x18\x02 \x01(\t"`\n"CreatePersistentSubscriptionResult\x12\x0b\n\x07Success\x10\x00\x12\x11\n\rAlreadyExists\x10\x01\x12\x08\n\x04\x46\x61il\x10\x02\x12\x10\n\x0c\x41\x63\x63\x65ssDenied\x10\x03"\x97\x02\n%DeletePersistentSubscriptionCompleted\x12}\n\x06result\x18\x01 \x02(\x0e\x32\x64.EventStore.Client.Messages.DeletePersistentSubscriptionCompleted.DeletePersistentSubscriptionResult:\x07Success\x12\x0e\n\x06reason\x18\x02 \x01(\t"_\n"DeletePersistentSubscriptionResult\x12\x0b\n\x07Success\x10\x00\x12\x10\n\x0c\x44oesNotExist\x10\x01\x12\x08\n\x04\x46\x61il\x10\x02\x12\x10\n\x0c\x41\x63\x63\x65ssDenied\x10\x03"w\n\x1f\x43onnectToPersistentSubscription\x12\x17\n\x0fsubscription_id\x18\x01 \x02(\t\x12\x17\n\x0f\x65vent_stream_id\x18\x02 \x02(\t\x12"\n\x1a\x61llowed_in_flight_messages\x18\x03 \x02(\x05"W\n\x1fPersistentSubscriptionAckEvents\x12\x17\n\x0fsubscription_id\x18\x01 \x02(\t\x12\x1b\n\x13processed_event_ids\x18\x02 \x03(\x0c"\x8b\x02\n\x1fPersistentSubscriptionNakEvents\x12\x17\n\x0fsubscription_id\x18\x01 \x02(\t\x12\x1b\n\x13processed_event_ids\x18\x02 \x03(\x0c\x12\x0f\n\x07message\x18\x03 \x01(\t\x12^\n\x06\x61\x63tion\x18\x04 \x02(\x0e\x32\x45.EventStore.Client.Messages.PersistentSubscriptionNakEvents.NakAction:\x07Unknown"A\n\tNakAction\x12\x0b\n\x07Unknown\x10\x00\x12\x08\n\x04Park\x10\x01\x12\t\n\x05Retry\x10\x02\x12\x08\n\x04Skip\x10\x03\x12\x08\n\x04Stop\x10\x04"v\n"PersistentSubscriptionConfirmation\x12\x1c\n\x14last_commit_position\x18\x01 \x02(\x03\x12\x17\n\x0fsubscription_id\x18\x02 \x02(\t\x12\x19\n\x11last_event_number\x18\x03 \x01(\x05"l\n)PersistentSubscriptionStreamEventAppeared\x12?\n\x05\x65vent\x18\x01 \x02(\x0b\x32\x30.EventStore.Client.Messages.ResolvedIndexedEvent"F\n\x11SubscribeToStream\x12\x17\n\x0f\x65vent_stream_id\x18\x01 \x02(\t\x12\x18\n\x10resolve_link_tos\x18\x02 \x02(\x08"S\n\x18SubscriptionConfirmation\x12\x1c\n\x14last_commit_position\x18\x01 \x02(\x03\x12\x19\n\x11last_event_number\x18\x02 \x01(\x05"O\n\x13StreamEventAppeared\x12\x38\n\x05\x65vent\x18\x01 \x02(\x0b\x32).EventStore.Client.Messages.ResolvedEvent"\x17\n\x15UnsubscribeFromStream"\x06\n\x04Ping"\x06\n\x04Pong"\x8a\x02\n\x13SubscriptionDropped\x12\x64\n\x06reason\x18\x01 \x01(\x0e\x32\x46.EventStore.Client.Messages.SubscriptionDropped.SubscriptionDropReason:\x0cUnsubscribed"\x8c\x01\n\x16SubscriptionDropReason\x12\x10\n\x0cUnsubscribed\x10\x00\x12\x10\n\x0c\x41\x63\x63\x65ssDenied\x10\x01\x12\x0c\n\x08NotFound\x10\x02\x12!\n\x1dPersistentSubscriptionDeleted\x10\x03\x12\x1d\n\x19SubscriberMaxCountReached\x10\x04"\xf6\x02\n\nNotHandled\x12G\n\x06reason\x18\x01 \x02(\x0e\x32\x37.EventStore.Client.Messages.NotHandled.NotHandledReason\x12\x17\n\x0f\x61\x64\x64itional_info\x18\x02 \x01(\x0c\x1a\xc7\x01\n\nMasterInfo\x12\x1c\n\x14\x65xternal_tcp_address\x18\x01 \x02(\t\x12\x19\n\x11\x65xternal_tcp_port\x18\x02 \x02(\x05\x12\x1d\n\x15\x65xternal_http_address\x18\x03 \x02(\t\x12\x1a\n\x12\x65xternal_http_port\x18\x04 \x02(\x05\x12#\n\x1b\x65xternal_secure_tcp_address\x18\x05 \x01(\t\x12 \n\x18\x65xternal_secure_tcp_port\x18\x06 \x01(\x05"<\n\x10NotHandledReason\x12\x0c\n\x08NotReady\x10\x00\x12\x0b\n\x07TooBusy\x10\x01\x12\r\n\tNotMaster\x10\x02"\x12\n\x10ScavengeDatabase"\xed\x01\n\x19ScavengeDatabaseCompleted\x12T\n\x06result\x18\x01 \x02(\x0e\x32\x44.EventStore.Client.Messages.ScavengeDatabaseCompleted.ScavengeResult\x12\r\n\x05\x65rror\x18\x02 \x01(\t\x12\x15\n\rtotal_time_ms\x18\x03 \x02(\x05\x12\x19\n\x11total_space_saved\x18\x04 \x02(\x03"9\n\x0eScavengeResult\x12\x0b\n\x07Success\x10\x00\x12\x0e\n\nInProgress\x10\x01\x12\n\n\x06\x46\x61iled\x10\x02*\xb0\x01\n\x0fOperationResult\x12\x0b\n\x07Success\x10\x00\x12\x12\n\x0ePrepareTimeout\x10\x01\x12\x11\n\rCommitTimeout\x10\x02\x12\x12\n\x0e\x46orwardTimeout\x10\x03\x12\x18\n\x14WrongExpectedVersion\x10\x04\x12\x11\n\rStreamDeleted\x10\x05\x12\x16\n\x12InvalidTransaction\x10\x06\x12\x10\n\x0c\x41\x63\x63\x65ssDenied\x10\x07', + serialized_pb=b'\n\x0emessages.proto\x12\x1a\x45ventStore.Client.Messages"\x8a\x01\n\x08NewEvent\x12\x10\n\x08\x65vent_id\x18\x01 \x02(\x0c\x12\x12\n\nevent_type\x18\x02 \x02(\t\x12\x19\n\x11\x64\x61ta_content_type\x18\x03 \x02(\x05\x12\x1d\n\x15metadata_content_type\x18\x04 \x02(\x05\x12\x0c\n\x04\x64\x61ta\x18\x05 \x02(\x0c\x12\x10\n\x08metadata\x18\x06 \x01(\x0c"\xe4\x01\n\x0b\x45ventRecord\x12\x17\n\x0f\x65vent_stream_id\x18\x01 \x02(\t\x12\x14\n\x0c\x65vent_number\x18\x02 \x02(\x05\x12\x10\n\x08\x65vent_id\x18\x03 \x02(\x0c\x12\x12\n\nevent_type\x18\x04 \x02(\t\x12\x19\n\x11\x64\x61ta_content_type\x18\x05 \x02(\x05\x12\x1d\n\x15metadata_content_type\x18\x06 \x02(\x05\x12\x0c\n\x04\x64\x61ta\x18\x07 \x02(\x0c\x12\x10\n\x08metadata\x18\x08 \x01(\x0c\x12\x0f\n\x07\x63reated\x18\t \x01(\x03\x12\x15\n\rcreated_epoch\x18\n \x01(\x03"\x85\x01\n\x14ResolvedIndexedEvent\x12\x36\n\x05\x65vent\x18\x01 \x02(\x0b\x32\'.EventStore.Client.Messages.EventRecord\x12\x35\n\x04link\x18\x02 \x01(\x0b\x32\'.EventStore.Client.Messages.EventRecord"\xb1\x01\n\rResolvedEvent\x12\x36\n\x05\x65vent\x18\x01 \x02(\x0b\x32\'.EventStore.Client.Messages.EventRecord\x12\x35\n\x04link\x18\x02 \x01(\x0b\x32\'.EventStore.Client.Messages.EventRecord\x12\x17\n\x0f\x63ommit_position\x18\x03 \x02(\x03\x12\x18\n\x10prepare_position\x18\x04 \x02(\x03"\x8e\x01\n\x0bWriteEvents\x12\x17\n\x0f\x65vent_stream_id\x18\x01 \x02(\t\x12\x18\n\x10\x65xpected_version\x18\x02 \x02(\x05\x12\x34\n\x06\x65vents\x18\x03 \x03(\x0b\x32$.EventStore.Client.Messages.NewEvent\x12\x16\n\x0erequire_main\x18\x04 \x02(\x08"\xce\x01\n\x14WriteEventsCompleted\x12;\n\x06result\x18\x01 \x02(\x0e\x32+.EventStore.Client.Messages.OperationResult\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x1a\n\x12\x66irst_event_number\x18\x03 \x02(\x05\x12\x19\n\x11last_event_number\x18\x04 \x02(\x05\x12\x18\n\x10prepare_position\x18\x05 \x01(\x03\x12\x17\n\x0f\x63ommit_position\x18\x06 \x01(\x03"n\n\x0c\x44\x65leteStream\x12\x17\n\x0f\x65vent_stream_id\x18\x01 \x02(\t\x12\x18\n\x10\x65xpected_version\x18\x02 \x02(\x05\x12\x16\n\x0erequire_main\x18\x03 \x02(\x08\x12\x13\n\x0bhard_delete\x18\x04 \x01(\x08"\x98\x01\n\x15\x44\x65leteStreamCompleted\x12;\n\x06result\x18\x01 \x02(\x0e\x32+.EventStore.Client.Messages.OperationResult\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x18\n\x10prepare_position\x18\x03 \x01(\x03\x12\x17\n\x0f\x63ommit_position\x18\x04 \x01(\x03"]\n\x10TransactionStart\x12\x17\n\x0f\x65vent_stream_id\x18\x01 \x02(\t\x12\x18\n\x10\x65xpected_version\x18\x02 \x02(\x05\x12\x16\n\x0erequire_main\x18\x03 \x02(\x08"\x81\x01\n\x19TransactionStartCompleted\x12\x16\n\x0etransaction_id\x18\x01 \x02(\x03\x12;\n\x06result\x18\x02 \x02(\x0e\x32+.EventStore.Client.Messages.OperationResult\x12\x0f\n\x07message\x18\x03 \x01(\t"x\n\x10TransactionWrite\x12\x16\n\x0etransaction_id\x18\x01 \x02(\x03\x12\x34\n\x06\x65vents\x18\x02 \x03(\x0b\x32$.EventStore.Client.Messages.NewEvent\x12\x16\n\x0erequire_main\x18\x03 \x02(\x08"\x81\x01\n\x19TransactionWriteCompleted\x12\x16\n\x0etransaction_id\x18\x01 \x02(\x03\x12;\n\x06result\x18\x02 \x02(\x0e\x32+.EventStore.Client.Messages.OperationResult\x12\x0f\n\x07message\x18\x03 \x01(\t"C\n\x11TransactionCommit\x12\x16\n\x0etransaction_id\x18\x01 \x02(\x03\x12\x16\n\x0erequire_main\x18\x02 \x02(\x08"\xec\x01\n\x1aTransactionCommitCompleted\x12\x16\n\x0etransaction_id\x18\x01 \x02(\x03\x12;\n\x06result\x18\x02 \x02(\x0e\x32+.EventStore.Client.Messages.OperationResult\x12\x0f\n\x07message\x18\x03 \x01(\t\x12\x1a\n\x12\x66irst_event_number\x18\x04 \x02(\x05\x12\x19\n\x11last_event_number\x18\x05 \x02(\x05\x12\x18\n\x10prepare_position\x18\x06 \x01(\x03\x12\x17\n\x0f\x63ommit_position\x18\x07 \x01(\x03"l\n\tReadEvent\x12\x17\n\x0f\x65vent_stream_id\x18\x01 \x02(\t\x12\x14\n\x0c\x65vent_number\x18\x02 \x02(\x05\x12\x18\n\x10resolve_link_tos\x18\x03 \x02(\x08\x12\x16\n\x0erequire_main\x18\x04 \x02(\x08"\xa0\x02\n\x12ReadEventCompleted\x12N\n\x06result\x18\x01 \x02(\x0e\x32>.EventStore.Client.Messages.ReadEventCompleted.ReadEventResult\x12?\n\x05\x65vent\x18\x02 \x02(\x0b\x32\x30.EventStore.Client.Messages.ResolvedIndexedEvent\x12\r\n\x05\x65rror\x18\x03 \x01(\t"j\n\x0fReadEventResult\x12\x0b\n\x07Success\x10\x00\x12\x0c\n\x08NotFound\x10\x01\x12\x0c\n\x08NoStream\x10\x02\x12\x11\n\rStreamDeleted\x10\x03\x12\t\n\x05\x45rror\x10\x04\x12\x10\n\x0c\x41\x63\x63\x65ssDenied\x10\x05"\x8b\x01\n\x10ReadStreamEvents\x12\x17\n\x0f\x65vent_stream_id\x18\x01 \x02(\t\x12\x19\n\x11\x66rom_event_number\x18\x02 \x02(\x05\x12\x11\n\tmax_count\x18\x03 \x02(\x05\x12\x18\n\x10resolve_link_tos\x18\x04 \x02(\x08\x12\x16\n\x0erequire_main\x18\x05 \x02(\x08"\xa2\x03\n\x19ReadStreamEventsCompleted\x12@\n\x06\x65vents\x18\x01 \x03(\x0b\x32\x30.EventStore.Client.Messages.ResolvedIndexedEvent\x12V\n\x06result\x18\x02 \x02(\x0e\x32\x46.EventStore.Client.Messages.ReadStreamEventsCompleted.ReadStreamResult\x12\x19\n\x11next_event_number\x18\x03 \x02(\x05\x12\x19\n\x11last_event_number\x18\x04 \x02(\x05\x12\x18\n\x10is_end_of_stream\x18\x05 \x02(\x08\x12\x1c\n\x14last_commit_position\x18\x06 \x02(\x03\x12\r\n\x05\x65rror\x18\x07 \x01(\t"n\n\x10ReadStreamResult\x12\x0b\n\x07Success\x10\x00\x12\x0c\n\x08NoStream\x10\x01\x12\x11\n\rStreamDeleted\x10\x02\x12\x0f\n\x0bNotModified\x10\x03\x12\t\n\x05\x45rror\x10\x04\x12\x10\n\x0c\x41\x63\x63\x65ssDenied\x10\x05"\x87\x01\n\rReadAllEvents\x12\x17\n\x0f\x63ommit_position\x18\x01 \x02(\x03\x12\x18\n\x10prepare_position\x18\x02 \x02(\x03\x12\x11\n\tmax_count\x18\x03 \x02(\x05\x12\x18\n\x10resolve_link_tos\x18\x04 \x02(\x08\x12\x16\n\x0erequire_main\x18\x05 \x02(\x08"\xf9\x02\n\x16ReadAllEventsCompleted\x12\x17\n\x0f\x63ommit_position\x18\x01 \x02(\x03\x12\x18\n\x10prepare_position\x18\x02 \x02(\x03\x12\x39\n\x06\x65vents\x18\x03 \x03(\x0b\x32).EventStore.Client.Messages.ResolvedEvent\x12\x1c\n\x14next_commit_position\x18\x04 \x02(\x03\x12\x1d\n\x15next_prepare_position\x18\x05 \x02(\x03\x12Y\n\x06result\x18\x06 \x01(\x0e\x32@.EventStore.Client.Messages.ReadAllEventsCompleted.ReadAllResult:\x07Success\x12\r\n\x05\x65rror\x18\x07 \x01(\t"J\n\rReadAllResult\x12\x0b\n\x07Success\x10\x00\x12\x0f\n\x0bNotModified\x10\x01\x12\t\n\x05\x45rror\x10\x02\x12\x10\n\x0c\x41\x63\x63\x65ssDenied\x10\x03"\xde\x03\n\x1c\x43reatePersistentSubscription\x12\x1f\n\x17subscription_group_name\x18\x01 \x02(\t\x12\x17\n\x0f\x65vent_stream_id\x18\x02 \x02(\t\x12\x18\n\x10resolve_link_tos\x18\x03 \x02(\x08\x12\x12\n\nstart_from\x18\x04 \x02(\x05\x12$\n\x1cmessage_timeout_milliseconds\x18\x05 \x02(\x05\x12\x19\n\x11record_statistics\x18\x06 \x02(\x08\x12\x18\n\x10live_buffer_size\x18\x07 \x02(\x05\x12\x17\n\x0fread_batch_size\x18\x08 \x02(\x05\x12\x13\n\x0b\x62uffer_size\x18\t \x02(\x05\x12\x17\n\x0fmax_retry_count\x18\n \x02(\x05\x12\x1a\n\x12prefer_round_robin\x18\x0b \x02(\x08\x12\x1d\n\x15\x63heckpoint_after_time\x18\x0c \x02(\x05\x12\x1c\n\x14\x63heckpoint_max_count\x18\r \x02(\x05\x12\x1c\n\x14\x63heckpoint_min_count\x18\x0e \x02(\x05\x12\x1c\n\x14subscriber_max_count\x18\x0f \x02(\x05\x12\x1f\n\x17named_consumer_strategy\x18\x10 \x01(\t"X\n\x1c\x44\x65letePersistentSubscription\x12\x1f\n\x17subscription_group_name\x18\x01 \x02(\t\x12\x17\n\x0f\x65vent_stream_id\x18\x02 \x02(\t"\xde\x03\n\x1cUpdatePersistentSubscription\x12\x1f\n\x17subscription_group_name\x18\x01 \x02(\t\x12\x17\n\x0f\x65vent_stream_id\x18\x02 \x02(\t\x12\x18\n\x10resolve_link_tos\x18\x03 \x02(\x08\x12\x12\n\nstart_from\x18\x04 \x02(\x05\x12$\n\x1cmessage_timeout_milliseconds\x18\x05 \x02(\x05\x12\x19\n\x11record_statistics\x18\x06 \x02(\x08\x12\x18\n\x10live_buffer_size\x18\x07 \x02(\x05\x12\x17\n\x0fread_batch_size\x18\x08 \x02(\x05\x12\x13\n\x0b\x62uffer_size\x18\t \x02(\x05\x12\x17\n\x0fmax_retry_count\x18\n \x02(\x05\x12\x1a\n\x12prefer_round_robin\x18\x0b \x02(\x08\x12\x1d\n\x15\x63heckpoint_after_time\x18\x0c \x02(\x05\x12\x1c\n\x14\x63heckpoint_max_count\x18\r \x02(\x05\x12\x1c\n\x14\x63heckpoint_min_count\x18\x0e \x02(\x05\x12\x1c\n\x14subscriber_max_count\x18\x0f \x02(\x05\x12\x1f\n\x17named_consumer_strategy\x18\x10 \x01(\t"\x97\x02\n%UpdatePersistentSubscriptionCompleted\x12}\n\x06result\x18\x01 \x02(\x0e\x32\x64.EventStore.Client.Messages.UpdatePersistentSubscriptionCompleted.UpdatePersistentSubscriptionResult:\x07Success\x12\x0e\n\x06reason\x18\x02 \x01(\t"_\n"UpdatePersistentSubscriptionResult\x12\x0b\n\x07Success\x10\x00\x12\x10\n\x0c\x44oesNotExist\x10\x01\x12\x08\n\x04\x46\x61il\x10\x02\x12\x10\n\x0c\x41\x63\x63\x65ssDenied\x10\x03"\x98\x02\n%CreatePersistentSubscriptionCompleted\x12}\n\x06result\x18\x01 \x02(\x0e\x32\x64.EventStore.Client.Messages.CreatePersistentSubscriptionCompleted.CreatePersistentSubscriptionResult:\x07Success\x12\x0e\n\x06reason\x18\x02 \x01(\t"`\n"CreatePersistentSubscriptionResult\x12\x0b\n\x07Success\x10\x00\x12\x11\n\rAlreadyExists\x10\x01\x12\x08\n\x04\x46\x61il\x10\x02\x12\x10\n\x0c\x41\x63\x63\x65ssDenied\x10\x03"\x97\x02\n%DeletePersistentSubscriptionCompleted\x12}\n\x06result\x18\x01 \x02(\x0e\x32\x64.EventStore.Client.Messages.DeletePersistentSubscriptionCompleted.DeletePersistentSubscriptionResult:\x07Success\x12\x0e\n\x06reason\x18\x02 \x01(\t"_\n"DeletePersistentSubscriptionResult\x12\x0b\n\x07Success\x10\x00\x12\x10\n\x0c\x44oesNotExist\x10\x01\x12\x08\n\x04\x46\x61il\x10\x02\x12\x10\n\x0c\x41\x63\x63\x65ssDenied\x10\x03"w\n\x1f\x43onnectToPersistentSubscription\x12\x17\n\x0fsubscription_id\x18\x01 \x02(\t\x12\x17\n\x0f\x65vent_stream_id\x18\x02 \x02(\t\x12"\n\x1a\x61llowed_in_flight_messages\x18\x03 \x02(\x05"W\n\x1fPersistentSubscriptionAckEvents\x12\x17\n\x0fsubscription_id\x18\x01 \x02(\t\x12\x1b\n\x13processed_event_ids\x18\x02 \x03(\x0c"\x8b\x02\n\x1fPersistentSubscriptionNakEvents\x12\x17\n\x0fsubscription_id\x18\x01 \x02(\t\x12\x1b\n\x13processed_event_ids\x18\x02 \x03(\x0c\x12\x0f\n\x07message\x18\x03 \x01(\t\x12^\n\x06\x61\x63tion\x18\x04 \x02(\x0e\x32\x45.EventStore.Client.Messages.PersistentSubscriptionNakEvents.NakAction:\x07Unknown"A\n\tNakAction\x12\x0b\n\x07Unknown\x10\x00\x12\x08\n\x04Park\x10\x01\x12\t\n\x05Retry\x10\x02\x12\x08\n\x04Skip\x10\x03\x12\x08\n\x04Stop\x10\x04"v\n"PersistentSubscriptionConfirmation\x12\x1c\n\x14last_commit_position\x18\x01 \x02(\x03\x12\x17\n\x0fsubscription_id\x18\x02 \x02(\t\x12\x19\n\x11last_event_number\x18\x03 \x01(\x05"l\n)PersistentSubscriptionStreamEventAppeared\x12?\n\x05\x65vent\x18\x01 \x02(\x0b\x32\x30.EventStore.Client.Messages.ResolvedIndexedEvent"F\n\x11SubscribeToStream\x12\x17\n\x0f\x65vent_stream_id\x18\x01 \x02(\t\x12\x18\n\x10resolve_link_tos\x18\x02 \x02(\x08"S\n\x18SubscriptionConfirmation\x12\x1c\n\x14last_commit_position\x18\x01 \x02(\x03\x12\x19\n\x11last_event_number\x18\x02 \x01(\x05"O\n\x13StreamEventAppeared\x12\x38\n\x05\x65vent\x18\x01 \x02(\x0b\x32).EventStore.Client.Messages.ResolvedEvent"\x17\n\x15UnsubscribeFromStream"\x06\n\x04Ping"\x06\n\x04Pong"\x8a\x02\n\x13SubscriptionDropped\x12\x64\n\x06reason\x18\x01 \x01(\x0e\x32\x46.EventStore.Client.Messages.SubscriptionDropped.SubscriptionDropReason:\x0cUnsubscribed"\x8c\x01\n\x16SubscriptionDropReason\x12\x10\n\x0cUnsubscribed\x10\x00\x12\x10\n\x0c\x41\x63\x63\x65ssDenied\x10\x01\x12\x0c\n\x08NotFound\x10\x02\x12!\n\x1dPersistentSubscriptionDeleted\x10\x03\x12\x1d\n\x19SubscriberMaxCountReached\x10\x04"\xf6\x02\n\nNotHandled\x12G\n\x06reason\x18\x01 \x02(\x0e\x32\x37.EventStore.Client.Messages.NotHandled.NotHandledReason\x12\x17\n\x0f\x61\x64\x64itional_info\x18\x02 \x01(\x0c\x1a\xc7\x01\n\nMainInfo\x12\x1c\n\x14\x65xternal_tcp_address\x18\x01 \x02(\t\x12\x19\n\x11\x65xternal_tcp_port\x18\x02 \x02(\x05\x12\x1d\n\x15\x65xternal_http_address\x18\x03 \x02(\t\x12\x1a\n\x12\x65xternal_http_port\x18\x04 \x02(\x05\x12#\n\x1b\x65xternal_secure_tcp_address\x18\x05 \x01(\t\x12 \n\x18\x65xternal_secure_tcp_port\x18\x06 \x01(\x05"<\n\x10NotHandledReason\x12\x0c\n\x08NotReady\x10\x00\x12\x0b\n\x07TooBusy\x10\x01\x12\r\n\tNotMain\x10\x02"\x12\n\x10ScavengeDatabase"\xed\x01\n\x19ScavengeDatabaseCompleted\x12T\n\x06result\x18\x01 \x02(\x0e\x32\x44.EventStore.Client.Messages.ScavengeDatabaseCompleted.ScavengeResult\x12\r\n\x05\x65rror\x18\x02 \x01(\t\x12\x15\n\rtotal_time_ms\x18\x03 \x02(\x05\x12\x19\n\x11total_space_saved\x18\x04 \x02(\x03"9\n\x0eScavengeResult\x12\x0b\n\x07Success\x10\x00\x12\x0e\n\nInProgress\x10\x01\x12\n\n\x06\x46\x61iled\x10\x02*\xb0\x01\n\x0fOperationResult\x12\x0b\n\x07Success\x10\x00\x12\x12\n\x0ePrepareTimeout\x10\x01\x12\x11\n\rCommitTimeout\x10\x02\x12\x12\n\x0e\x46orwardTimeout\x10\x03\x12\x18\n\x14WrongExpectedVersion\x10\x04\x12\x11\n\rStreamDeleted\x10\x05\x12\x16\n\x12InvalidTransaction\x10\x06\x12\x10\n\x0c\x41\x63\x63\x65ssDenied\x10\x07', ) _OPERATIONRESULT = _descriptor.EnumDescriptor( @@ -566,7 +566,7 @@ create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="NotMaster", + name="NotMain", index=2, number=2, serialized_options=None, @@ -1193,8 +1193,8 @@ create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( - name="require_master", - full_name="EventStore.Client.Messages.WriteEvents.require_master", + name="require_main", + full_name="EventStore.Client.Messages.WriteEvents.require_main", index=3, number=4, type=8, @@ -1408,8 +1408,8 @@ create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( - name="require_master", - full_name="EventStore.Client.Messages.DeleteStream.require_master", + name="require_main", + full_name="EventStore.Client.Messages.DeleteStream.require_main", index=2, number=3, type=8, @@ -1604,8 +1604,8 @@ create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( - name="require_master", - full_name="EventStore.Client.Messages.TransactionStart.require_master", + name="require_main", + full_name="EventStore.Client.Messages.TransactionStart.require_main", index=2, number=3, type=8, @@ -1762,8 +1762,8 @@ create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( - name="require_master", - full_name="EventStore.Client.Messages.TransactionWrite.require_master", + name="require_main", + full_name="EventStore.Client.Messages.TransactionWrite.require_main", index=2, number=3, type=8, @@ -1901,8 +1901,8 @@ create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( - name="require_master", - full_name="EventStore.Client.Messages.TransactionCommit.require_master", + name="require_main", + full_name="EventStore.Client.Messages.TransactionCommit.require_main", index=1, number=2, type=8, @@ -2154,8 +2154,8 @@ create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( - name="require_master", - full_name="EventStore.Client.Messages.ReadEvent.require_master", + name="require_main", + full_name="EventStore.Client.Messages.ReadEvent.require_main", index=3, number=4, type=8, @@ -2350,8 +2350,8 @@ create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( - name="require_master", - full_name="EventStore.Client.Messages.ReadStreamEvents.require_master", + name="require_main", + full_name="EventStore.Client.Messages.ReadStreamEvents.require_main", index=4, number=5, type=8, @@ -2622,8 +2622,8 @@ create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( - name="require_master", - full_name="EventStore.Client.Messages.ReadAllEvents.require_master", + name="require_main", + full_name="EventStore.Client.Messages.ReadAllEvents.require_main", index=4, number=5, type=8, @@ -4330,8 +4330,8 @@ _NOTHANDLED_MASTERINFO = _descriptor.Descriptor( - name="MasterInfo", - full_name="EventStore.Client.Messages.NotHandled.MasterInfo", + name="MainInfo", + full_name="EventStore.Client.Messages.NotHandled.MainInfo", filename=None, file=DESCRIPTOR, containing_type=None, @@ -4339,7 +4339,7 @@ fields=[ _descriptor.FieldDescriptor( name="external_tcp_address", - full_name="EventStore.Client.Messages.NotHandled.MasterInfo.external_tcp_address", + full_name="EventStore.Client.Messages.NotHandled.MainInfo.external_tcp_address", index=0, number=1, type=9, @@ -4358,7 +4358,7 @@ ), _descriptor.FieldDescriptor( name="external_tcp_port", - full_name="EventStore.Client.Messages.NotHandled.MasterInfo.external_tcp_port", + full_name="EventStore.Client.Messages.NotHandled.MainInfo.external_tcp_port", index=1, number=2, type=5, @@ -4377,7 +4377,7 @@ ), _descriptor.FieldDescriptor( name="external_http_address", - full_name="EventStore.Client.Messages.NotHandled.MasterInfo.external_http_address", + full_name="EventStore.Client.Messages.NotHandled.MainInfo.external_http_address", index=2, number=3, type=9, @@ -4396,7 +4396,7 @@ ), _descriptor.FieldDescriptor( name="external_http_port", - full_name="EventStore.Client.Messages.NotHandled.MasterInfo.external_http_port", + full_name="EventStore.Client.Messages.NotHandled.MainInfo.external_http_port", index=3, number=4, type=5, @@ -4415,7 +4415,7 @@ ), _descriptor.FieldDescriptor( name="external_secure_tcp_address", - full_name="EventStore.Client.Messages.NotHandled.MasterInfo.external_secure_tcp_address", + full_name="EventStore.Client.Messages.NotHandled.MainInfo.external_secure_tcp_address", index=4, number=5, type=9, @@ -4434,7 +4434,7 @@ ), _descriptor.FieldDescriptor( name="external_secure_tcp_port", - full_name="EventStore.Client.Messages.NotHandled.MasterInfo.external_secure_tcp_port", + full_name="EventStore.Client.Messages.NotHandled.MainInfo.external_secure_tcp_port", index=5, number=6, type=5, @@ -5205,13 +5205,13 @@ "NotHandled", (_message.Message,), { - "MasterInfo": _reflection.GeneratedProtocolMessageType( - "MasterInfo", + "MainInfo": _reflection.GeneratedProtocolMessageType( + "MainInfo", (_message.Message,), { "DESCRIPTOR": _NOTHANDLED_MASTERINFO, "__module__": "messages_pb2" - # @@protoc_insertion_point(class_scope:EventStore.Client.Messages.NotHandled.MasterInfo) + # @@protoc_insertion_point(class_scope:EventStore.Client.Messages.NotHandled.MainInfo) }, ), "DESCRIPTOR": _NOTHANDLED, @@ -5220,7 +5220,7 @@ }, ) _sym_db.RegisterMessage(NotHandled) -_sym_db.RegisterMessage(NotHandled.MasterInfo) +_sym_db.RegisterMessage(NotHandled.MainInfo) ScavengeDatabase = _reflection.GeneratedProtocolMessageType( "ScavengeDatabase", diff --git a/test/conversations/test_catchup.py b/test/conversations/test_catchup.py index 3470653..d42364d 100644 --- a/test/conversations/test_catchup.py +++ b/test/conversations/test_catchup.py @@ -199,7 +199,7 @@ async def test_start_read_phase(): assert body.event_stream_id == "my-stream" assert body.from_event_number == 0 assert body.resolve_link_tos is True - assert body.require_master is False + assert body.require_main is False assert body.max_count == 100 diff --git a/test/conversations/test_catchup_all.py b/test/conversations/test_catchup_all.py index aa84c14..3703120 100644 --- a/test/conversations/test_catchup_all.py +++ b/test/conversations/test_catchup_all.py @@ -195,7 +195,7 @@ async def test_start_read_phase(): assert body.commit_position == 0 assert body.prepare_position == 0 assert body.resolve_link_tos is True - assert body.require_master is False + assert body.require_main is False assert body.max_count == 100 diff --git a/test/conversations/test_error_handling.py b/test/conversations/test_error_handling.py index d8d6bfd..372a0d4 100644 --- a/test/conversations/test_error_handling.py +++ b/test/conversations/test_error_handling.py @@ -115,11 +115,11 @@ async def test_too_busy_message(): @pytest.mark.asyncio -async def test_not_master(): +async def test_not_main(): output = TeeQueue() payload = proto.NotHandled() - payload.reason = msg.NotHandledReason.NotMaster + payload.reason = msg.NotHandledReason.NotMain conversation = Ping() await conversation.respond_to( @@ -129,7 +129,7 @@ async def test_not_master(): output, ) - with pytest.raises(exn.NotMaster) as exc: + with pytest.raises(exn.NotMain) as exc: await conversation.result assert exc.conversation_id == conversation.conversation_id diff --git a/test/conversations/test_iterate_all_conversation.py b/test/conversations/test_iterate_all_conversation.py index a2f7b3b..6d7d8dc 100644 --- a/test/conversations/test_iterate_all_conversation.py +++ b/test/conversations/test_iterate_all_conversation.py @@ -24,7 +24,7 @@ async def test_read_request(): assert body.commit_position == 0 assert body.prepare_position == 0 assert body.resolve_link_tos is True - assert body.require_master is False + assert body.require_main is False assert body.max_count == 100 @@ -42,7 +42,7 @@ async def test_read_backward(): assert request.command is msg.TcpCommand.ReadAllEventsBackward assert body.commit_position == 0 assert body.resolve_link_tos is True - assert body.require_master is False + assert body.require_main is False assert body.max_count == 10 diff --git a/test/conversations/test_iterate_stream_conversation.py b/test/conversations/test_iterate_stream_conversation.py index e09f827..1128da9 100644 --- a/test/conversations/test_iterate_stream_conversation.py +++ b/test/conversations/test_iterate_stream_conversation.py @@ -24,7 +24,7 @@ async def test_read_stream_request(): assert body.event_stream_id == "my-stream" assert body.from_event_number == 0 assert body.resolve_link_tos is True - assert body.require_master is False + assert body.require_main is False assert body.max_count == 100 @@ -45,7 +45,7 @@ async def test_read_stream_backward(): assert body.event_stream_id == "my-stream" assert body.from_event_number == -1 assert body.resolve_link_tos is True - assert body.require_master is False + assert body.require_main is False assert body.max_count == 10 @@ -270,5 +270,5 @@ async def test_reconnect_at_last_event_number(): assert body.event_stream_id == "my-stream" assert body.from_event_number == 33 assert body.resolve_link_tos is True - assert body.require_master is False + assert body.require_main is False assert body.max_count == 100 diff --git a/test/conversations/test_read_all_events_stream_conversation.py b/test/conversations/test_read_all_events_stream_conversation.py index c55f02c..20498c7 100644 --- a/test/conversations/test_read_all_events_stream_conversation.py +++ b/test/conversations/test_read_all_events_stream_conversation.py @@ -24,7 +24,7 @@ async def test_read_all_request(): assert body.commit_position == 10 assert body.prepare_position == 11 assert body.resolve_link_tos is True - assert body.require_master is False + assert body.require_main is False assert body.max_count == 100 @@ -47,7 +47,7 @@ async def test_read_all_backward(): assert body.commit_position == 10 assert body.prepare_position == 11 assert body.resolve_link_tos is True - assert body.require_master is False + assert body.require_main is False assert body.max_count == 20 diff --git a/test/conversations/test_read_event_conversation.py b/test/conversations/test_read_event_conversation.py index 4feac3d..6bab711 100644 --- a/test/conversations/test_read_event_conversation.py +++ b/test/conversations/test_read_event_conversation.py @@ -25,7 +25,7 @@ async def test_read_single_event(): assert body.event_stream_id == "my-stream" assert body.event_number == 23 assert body.resolve_link_tos is True - assert body.require_master is False + assert body.require_main is False @pytest.mark.asyncio diff --git a/test/conversations/test_read_stream_conversation.py b/test/conversations/test_read_stream_conversation.py index a9a2404..2ae55d8 100644 --- a/test/conversations/test_read_stream_conversation.py +++ b/test/conversations/test_read_stream_conversation.py @@ -24,7 +24,7 @@ async def test_read_stream_request(): assert body.event_stream_id == "my-stream" assert body.from_event_number == 23 assert body.resolve_link_tos is True - assert body.require_master is False + assert body.require_main is False assert body.max_count == 100 @@ -45,7 +45,7 @@ async def test_read_stream_backward(): assert body.event_stream_id == "my-stream" assert body.from_event_number == 50 assert body.resolve_link_tos is True - assert body.require_master is False + assert body.require_main is False assert body.max_count == 10 diff --git a/test/conversations/test_write_events_conversation.py b/test/conversations/test_write_events_conversation.py index 2be12c6..1a751c4 100644 --- a/test/conversations/test_write_events_conversation.py +++ b/test/conversations/test_write_events_conversation.py @@ -99,7 +99,7 @@ def _validate_write_request( assert payload.event_stream_id == stream_id assert payload.expected_version == msg.ExpectedVersion.Any assert len(payload.events) == 1 - assert not payload.require_master + assert not payload.require_main [evt] = payload.events assert evt.event_id == event_id.bytes_le diff --git a/test/discovery_test.py b/test/discovery_test.py index 64cdd1c..0874f25 100644 --- a/test/discovery_test.py +++ b/test/discovery_test.py @@ -18,7 +18,7 @@ get_discoverer, read_gossip, select, - prefer_master, + prefer_main, prefer_replica, KEEP_RETRYING, ) @@ -26,7 +26,7 @@ from . import data GOOD_NODE = DiscoveredNode( - state=NodeState.Master, + state=NodeState.Main, is_alive=True, internal_tcp=None, internal_http=None, @@ -77,29 +77,29 @@ def test_selector_with_nodes_in_all_states(): selected = select(gossip) - assert selected.state == NodeState.Master + assert selected.state == NodeState.Main -def test_selector_with_slave_and_clone(): +def test_selector_with_subordinate_and_clone(): gossip = [ GOOD_NODE._replace(state=NodeState.Clone), - GOOD_NODE._replace(state=NodeState.Slave), + GOOD_NODE._replace(state=NodeState.Subordinate), ] selected = select(gossip) - assert selected.state == NodeState.Slave + assert selected.state == NodeState.Subordinate -def test_selector_with_master_and_slave(): +def test_selector_with_main_and_subordinate(): gossip = [ - GOOD_NODE._replace(state=NodeState.Master), - GOOD_NODE._replace(state=NodeState.Slave), + GOOD_NODE._replace(state=NodeState.Main), + GOOD_NODE._replace(state=NodeState.Subordinate), ] selected = select(gossip) - assert selected.state == NodeState.Master + assert selected.state == NodeState.Main def gossip_nodes(nodes: List[NodeService]): @@ -274,7 +274,7 @@ async def wait(self, seed): async def test_prefer_replica(): """ If we ask the discoverer to prefer_replica it should return a replica node - before returning a master. + before returning a main. """ discoverer = get_discoverer(None, None, "10.0.0.1", 2113, prefer_replica) @@ -286,13 +286,13 @@ async def test_prefer_replica(): @pytest.mark.asyncio -async def test_prefer_master(): +async def test_prefer_main(): """ - If we ask the discoverer to prefer_master it should return a master node + If we ask the discoverer to prefer_main it should return a main node before returning a replica. """ - discoverer = get_discoverer(None, None, "10.0.0.1", 2113, prefer_master) + discoverer = get_discoverer(None, None, "10.0.0.1", 2113, prefer_main) gossip = data.make_gossip("10.0.0.1", "10.0.0.2") with aioresponses() as mock: mock.get("http://10.0.0.1:2113/gossip", payload=gossip) diff --git a/versioneer.py b/versioneer.py index 64fea1c..87810ce 100644 --- a/versioneer.py +++ b/versioneer.py @@ -176,7 +176,7 @@ * Source trees which contain multiple subprojects, such as [Buildbot](https://github.com/buildbot/buildbot), which contains both - "master" and "slave" subprojects, each with their own `setup.py`, + "main" and "subordinate" subprojects, each with their own `setup.py`, `setup.cfg`, and `tox.ini`. Projects like these produce multiple PyPI distributions (and upload multiple independently-installable tarballs). * Source trees whose main purpose is to contain a C library, but which also @@ -609,7 +609,7 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose): # refs/heads/ and refs/tags/ prefixes that would let us distinguish # between branches and tags. By ignoring refnames without digits, we # filter out many common branch names like "release" and - # "stabilization", as well as "HEAD" and "master". + # "stabilization", as well as "HEAD" and "main". tags = set([r for r in refs if re.search(r'\d', r)]) if verbose: print("discarding '%%s', no digits" %% ",".join(refs - tags)) @@ -1001,7 +1001,7 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose): # refs/heads/ and refs/tags/ prefixes that would let us distinguish # between branches and tags. By ignoring refnames without digits, we # filter out many common branch names like "release" and - # "stabilization", as well as "HEAD" and "master". + # "stabilization", as well as "HEAD" and "main". tags = set([r for r in refs if re.search(r'\d', r)]) if verbose: print("discarding '%s', no digits" % ",".join(refs - tags))