Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kafka Avro Provider
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BIAS
Providers
Kafka Avro Provider
Commits
0f9ac408
Commit
0f9ac408
authored
1 year ago
by
Valerio Pastore
Browse files
Options
Downloads
Patches
Plain Diff
small fixes
parent
69c0267b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/KafkaAvro_Provider.h
+1
-1
1 addition, 1 deletion
include/KafkaAvro_Provider.h
src/KafkaAvro_Provider.cpp
+6
-2
6 additions, 2 deletions
src/KafkaAvro_Provider.cpp
with
7 additions
and
3 deletions
include/KafkaAvro_Provider.h
+
1
−
1
View file @
0f9ac408
...
...
@@ -27,7 +27,7 @@ protected:
std
::
thread
pollThread
;
/**< Thread for polling Kafka events. */
bool
pollThreadFlag
=
false
;
/**< Flag to indicate if the poll thread is running. */
std
::
mutex
closeMutex
;
/**< Mutex for thread-safe closing of the provider. */
bool
_open
=
false
;
/**< internal variable to check the state of the provider */
class
KafkaDeliveryReportCb
;
/**< Forward declaration of the KafkaDeliveryReportCb class. */
KafkaDeliveryReportCb
*
dr_cb
=
nullptr
;
/**< Pointer to the Kafka delivery report callback object. */
class
KafkaConnectionCallback
;
/**< Forward declaration of the KafkaConnectionCallback class. */
...
...
This diff is collapsed.
Click to expand it.
src/KafkaAvro_Provider.cpp
+
6
−
2
View file @
0f9ac408
...
...
@@ -25,6 +25,7 @@ public:
this
->
prov
=
prov
;
}
void
event_cb
(
RdKafka
::
Event
&
event
)
{
if
(
!
this
->
prov
->
isOpen
())
return
;
if
(
event
.
err
()
==
RdKafka
::
ERR__ALL_BROKERS_DOWN
)
{
time_t
now
=
time
(
nullptr
);
std
::
cerr
<<
"["
...
...
@@ -140,6 +141,7 @@ int KafkaAvroProvider::open() {
&
KafkaAvroProvider
::
pollingThreadFunction
,
this
);
// start polling
pollThreadFlag
=
true
;
}
this
->
_open
=
true
;
return
1
;
}
...
...
@@ -165,13 +167,15 @@ int KafkaAvroProvider::close() {
<<
"]
\t
[KafkaAvro Provider]
\t
"
<<
"Closed"
<<
std
::
endl
;
delete
producer
;
producer
=
nullptr
;
this
->
_open
=
false
;
this
->
closeMutex
.
unlock
();
return
1
;
}
return
1
;
return
-
1
;
}
bool
KafkaAvroProvider
::
isOpen
()
{
return
this
->
producer
!=
nullptr
;
return
this
->
_open
;
}
void
KafkaAvroProvider
::
pollingThreadFunction
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment