Condividi tramite


CheckpointStore Classe

CheckpointStore gestisce l'interazione con il servizio di archiviazione scelto.

Può elencare e richiedere proprietà delle partizioni, nonché elencare e salvare i checkpoint.

Ereditarietà
builtins.object
CheckpointStore

Costruttore

CheckpointStore()

Metodi

claim_ownership

Prova a richiedere la proprietà per un elenco di partizioni specificate.

list_checkpoints

Elencare i checkpoint aggiornati dal servizio di archiviazione scelto.

list_ownership

Recupera un elenco di proprietà completo dal servizio di archiviazione scelto.

update_checkpoint

Aggiorna il checkpoint usando le informazioni specificate per l'offset, la partizione associata e il gruppo consumer nel servizio di archiviazione scelto.

Nota: se si prevede di implementare un archivio checkpoint personalizzato con l'intenzione di eseguire tra SDK EventHubs multi-language, è consigliabile mantenere il valore di offset come intero.

claim_ownership

Prova a richiedere la proprietà per un elenco di partizioni specificate.

abstract claim_ownership(ownership_list: Iterable[Dict[str, Any]], **kwargs: Any) -> Iterable[Dict[str, Any]]

Parametri

Nome Descrizione
ownership_list
Necessario

Iterabile di dizionari contenenti tutte le proprietà da richiedere.

Restituisce

Tipo Descrizione
Iterable[Dict[str,Any]], Iterable <xref:of> <xref:dictionaries> <xref:containing> <xref:azure.eventhub.amqp.AmqpMessageBodyType.partition> <xref:ownership> <xref:information>:fully_qualified_namespace (str): <xref:The> <xref:fully> <xref:qualified> <xref:namespace> <xref:that> <xref:the> <xref:Event> <xref:Hub> <xref:belongs> <xref:to.> <xref:The> <xref:azure.eventhub.amqp.AmqpMessageBodyType.format> <xref:is> <xref:like> “<<xref:namespace>><xref:.servicebus.windows.net>”<xref:.> eventhub_name (str): <xref:The> <xref:name> <xref:of> <xref:the> <xref:specific> <xref:Event> <xref:Hub> <xref:the> <xref:checkpoint> <xref:is> <xref:associated> <xref:with>, <xref:relative> <xref:to> <xref:the> <xref:Event> <xref:Hubs> <xref:namespace> <xref:that> <xref:contains> <xref:it.> <xref:consumer_group> (str): <xref:The> <xref:name> <xref:of> <xref:the> <xref:consumer> <xref:group> <xref:the> <xref:ownership> <xref:are> <xref:associated> <xref:with.> <xref:partition_id> (str): <xref:The> <xref:azure.eventhub.amqp.AmqpMessageBodyType.partition> <xref:ID> <xref:which> <xref:the> <xref:checkpoint> <xref:is> <xref:created> <xref:for.> <xref:owner_id> (str): <xref:A> <xref:UUID> <xref:representing> <xref:the> <xref:owner> <xref:attempting> <xref:to> <xref:claim> <xref:this> <xref:partition.> <xref:last_modified_time> (<xref:UTC> datetime): <xref:The> <xref:last> time <xref:this> <xref:ownership> <xref:was> <xref:claimed.> <xref:etag> (str): <xref:The> <xref:Etag> <xref:value> <xref:for> <xref:the> <xref:last> time <xref:this> <xref:ownership> <xref:was> <xref:modified.> Optional <xref:depending> <xref:on> <xref:storage> <xref:implementation.>

list_checkpoints

Elencare i checkpoint aggiornati dal servizio di archiviazione scelto.

abstract list_checkpoints(fully_qualified_namespace: str, eventhub_name: str, consumer_group: str, **kwargs: Any) -> Iterable[Dict[str, Any]]

Parametri

Nome Descrizione
fully_qualified_namespace
Necessario
str

Spazio dei nomi completo a cui appartiene l'hub eventi. Il formato è simile a ".servicebus.windows.net".

eventhub_name
Necessario
str

Il nome dell'hub eventi specifico a cui sono associati i checkpoint, rispetto allo spazio dei nomi hub eventi che lo contiene.

consumer_group
Necessario
str

Il nome del gruppo consumer i checkpoint sono associati.

Restituisce

Tipo Descrizione
Iterable[Dict[str,Any]], Iterable <xref:of> <xref:dictionaries> <xref:containing> <xref:azure.eventhub.amqp.AmqpMessageBodyType.partition> <xref:checkpoint> <xref:information>:fully_qualified_namespace (str): <xref:The> <xref:fully> <xref:qualified> <xref:namespace> <xref:that> <xref:the> <xref:Event> <xref:Hub> <xref:belongs> <xref:to.> <xref:The> <xref:azure.eventhub.amqp.AmqpMessageBodyType.format> <xref:is> <xref:like> “<<xref:namespace>><xref:.servicebus.windows.net>”<xref:.> eventhub_name (str): <xref:The> <xref:name> <xref:of> <xref:the> <xref:specific> <xref:Event> <xref:Hub> <xref:the> <xref:checkpoints> <xref:are> <xref:associated> <xref:with>, <xref:relative> <xref:to> <xref:the> <xref:Event> <xref:Hubs> <xref:namespace> <xref:that> <xref:contains> <xref:it.> <xref:consumer_group> (str): <xref:The> <xref:name> <xref:of> <xref:the> <xref:consumer> <xref:group> <xref:the> <xref:checkpoints> <xref:are> <xref:associated> <xref:with.> <xref:partition_id> (str): <xref:The> <xref:azure.eventhub.amqp.AmqpMessageBodyType.partition> <xref:ID> <xref:which> <xref:the> <xref:checkpoint> <xref:is> <xref:created> <xref:for.> sequence_number (int): <xref:The> <xref:sequence> <xref:number> <xref:of> <xref:the> <xref:EventData.> offset (str): <xref:The> offset <xref:of> <xref:the> <xref:EventData.>

list_ownership

Recupera un elenco di proprietà completo dal servizio di archiviazione scelto.

abstract list_ownership(fully_qualified_namespace: str, eventhub_name: str, consumer_group: str, **kwargs: Any) -> Iterable[Dict[str, Any]]

Parametri

Nome Descrizione
fully_qualified_namespace
Necessario
str

Spazio dei nomi completo a cui appartiene l'hub eventi. Il formato è simile a ".servicebus.windows.net".

eventhub_name
Necessario
str

Il nome dell'hub eventi specifico a cui sono associate le proprietà della partizione, rispetto allo spazio dei nomi hub eventi che lo contiene.

consumer_group
Necessario
str

Il nome del gruppo consumer le proprietà sono associate.

Restituisce

Tipo Descrizione
Iterable[Dict[str, Any]], Iterable <xref:of> <xref:dictionaries> <xref:containing> <xref:azure.eventhub.amqp.AmqpMessageBodyType.partition> <xref:ownership> <xref:information>:fully_qualified_namespace (str): <xref:The> <xref:fully> <xref:qualified> <xref:namespace> <xref:that> <xref:the> <xref:Event> <xref:Hub> <xref:belongs> <xref:to.> <xref:The> <xref:azure.eventhub.amqp.AmqpMessageBodyType.format> <xref:is> <xref:like> “<<xref:namespace>><xref:.servicebus.windows.net>”<xref:.> eventhub_name (str): <xref:The> <xref:name> <xref:of> <xref:the> <xref:specific> <xref:Event> <xref:Hub> <xref:the> <xref:checkpoint> <xref:is> <xref:associated> <xref:with>, <xref:relative> <xref:to> <xref:the> <xref:Event> <xref:Hubs> <xref:namespace> <xref:that> <xref:contains> <xref:it.> <xref:consumer_group> (str): <xref:The> <xref:name> <xref:of> <xref:the> <xref:consumer> <xref:group> <xref:the> <xref:ownership> <xref:are> <xref:associated> <xref:with.> <xref:partition_id> (str): <xref:The> <xref:azure.eventhub.amqp.AmqpMessageBodyType.partition> <xref:ID> <xref:which> <xref:the> <xref:checkpoint> <xref:is> <xref:created> <xref:for.> <xref:owner_id> (str): <xref:A> <xref:UUID> <xref:representing> <xref:the> <xref:current> <xref:owner> <xref:of> <xref:this> <xref:partition.> <xref:last_modified_time> (<xref:UTC> datetime): <xref:The> <xref:last> time <xref:this> <xref:ownership> <xref:was> <xref:claimed.> <xref:etag> (str): <xref:The> <xref:Etag> <xref:value> <xref:for> <xref:the> <xref:last> time <xref:this> <xref:ownership> <xref:was> <xref:modified.> Optional <xref:depending> <xref:on> <xref:storage> <xref:implementation.>

update_checkpoint

Aggiorna il checkpoint usando le informazioni specificate per l'offset, la partizione associata e il gruppo consumer nel servizio di archiviazione scelto.

Nota: se si prevede di implementare un archivio checkpoint personalizzato con l'intenzione di eseguire tra SDK EventHubs multi-language, è consigliabile mantenere il valore di offset come intero.

abstract update_checkpoint(checkpoint: Dict[str, str | int | None], **kwargs: Any) -> None

Parametri

Nome Descrizione
checkpoint
Necessario

Un dict contenente informazioni sul checkpoint:

  • fully_qualified_namespace (str): spazio dei nomi completo a cui appartiene l'hub eventi. Il formato è simile a ".servicebus.windows.net".

  • eventhub_name (str): il nome dell'hub eventi specifico associato al checkpoint, rispetto allo spazio dei nomi hub eventi che lo contiene.

  • consumer_group (str): il nome del gruppo di consumer a cui è associato il checkpoint.

  • partition_id (str): ID di partizione per cui viene creato il checkpoint.

  • sequence_number (int): il numero di sequenza del EventData nuovo checkpoint verrà associato.

  • offset (str): l'offset EventData del nuovo checkpoint verrà associato.

Restituisce

Tipo Descrizione