How to keep context in the RetryPolicy thread created by datastax driverDatastax Driver Mapping APIDatastax Cassandra Driver throwing CodecNotFoundExceptionDatastax Cassandra java driver RetryPolicy for Statement with pagingDatastax Cassandra driver with Scala - Codecs not foundDatastax Java Driver failed to scan an entire tableUsage of the LOCAL_QUORUM consistency level in Datastax driverHow to create a materialized view using datastax libraryHow to rollback using Datastax driver 3.0Cassandra Datastax driver not giving error when update failscassandra datastax driver- difference between session.execute() and cassandraTemplate.execute()
What to do as a player when ranger animal companion dies
What is the word for a person who destroys monuments?
Can Brexit be undone in an emergency?
Why would a fighter use the afterburner and air brakes at the same time?
What's the purpose of autocorrelation?
Do you add your strength modifier once or twice to an unarmed strike?
Does battery condition have anything to do with macbook pro performance?
How is underwater propagation of sound possible?
Debussy as term for bathroom?
Specifying BOM substitutions / alternatives with Contract Manufacturer (CM)
I was cheated into a job and want to leave ASAP, what do I tell my interviewers?
How was ownership of property managed during the Black Death, when so many original owners had died?
Which museums have artworks of all four ninja turtles' namesakes?
How to influence manager to not schedule team meetings during lunch?
How does one calculate the distribution of the Matt Colville way of rolling stats?
Madrid to London w/ Expired 90/180 days stay as US citizen
Is the name of an interval between two notes unique and absolute?
How does a married couple pay bills when one gets paid twice a month and the other will be getting paid every week?
Audire, with accusative or dative?
Did slaves have slaves?
What did the controller say during my approach to land (audio clip)?
Is there a connection between IT and Ghostbusters?
I reverse the source code, you negate the output!
Is there an in-universe reason Harry says this or is this simply a Rowling mistake?
How to keep context in the RetryPolicy thread created by datastax driver
Datastax Driver Mapping APIDatastax Cassandra Driver throwing CodecNotFoundExceptionDatastax Cassandra java driver RetryPolicy for Statement with pagingDatastax Cassandra driver with Scala - Codecs not foundDatastax Java Driver failed to scan an entire tableUsage of the LOCAL_QUORUM consistency level in Datastax driverHow to create a materialized view using datastax libraryHow to rollback using Datastax driver 3.0Cassandra Datastax driver not giving error when update failscassandra datastax driver- difference between session.execute() and cassandraTemplate.execute()
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am customizing the retry policy by implementing the datastax RetryPolicy. I've noticed that when triggered, the retry policy is executed in a new thread created by the datastax framework. Thus, I am losing my context and cannot link between the original query execution, and the current retry execution (my relevant context data is stored on ThreadLocal.)
Is there a way to register/pass data into the retry policy to be able to utilize information from the original query?
My end game is to be able to log relevant context information from the flow of the original query.
cassandra-3.0 datastax-java-driver
add a comment
|
I am customizing the retry policy by implementing the datastax RetryPolicy. I've noticed that when triggered, the retry policy is executed in a new thread created by the datastax framework. Thus, I am losing my context and cannot link between the original query execution, and the current retry execution (my relevant context data is stored on ThreadLocal.)
Is there a way to register/pass data into the retry policy to be able to utilize information from the original query?
My end game is to be able to log relevant context information from the flow of the original query.
cassandra-3.0 datastax-java-driver
add a comment
|
I am customizing the retry policy by implementing the datastax RetryPolicy. I've noticed that when triggered, the retry policy is executed in a new thread created by the datastax framework. Thus, I am losing my context and cannot link between the original query execution, and the current retry execution (my relevant context data is stored on ThreadLocal.)
Is there a way to register/pass data into the retry policy to be able to utilize information from the original query?
My end game is to be able to log relevant context information from the flow of the original query.
cassandra-3.0 datastax-java-driver
I am customizing the retry policy by implementing the datastax RetryPolicy. I've noticed that when triggered, the retry policy is executed in a new thread created by the datastax framework. Thus, I am losing my context and cannot link between the original query execution, and the current retry execution (my relevant context data is stored on ThreadLocal.)
Is there a way to register/pass data into the retry policy to be able to utilize information from the original query?
My end game is to be able to log relevant context information from the flow of the original query.
cassandra-3.0 datastax-java-driver
cassandra-3.0 datastax-java-driver
asked Mar 28 at 14:09
JonathanSJonathanS
11 bronze badge
11 bronze badge
add a comment
|
add a comment
|
1 Answer
1
active
oldest
votes
Indeed retry policy methods are invoked on an internal driver thread, so you can't use a ThreadLocal
to share context.
What you can do instead is wrap your statements in a custom StatementWrapper that stores that information in final fields.
add a comment
|
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55399666%2fhow-to-keep-context-in-the-retrypolicy-thread-created-by-datastax-driver%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Indeed retry policy methods are invoked on an internal driver thread, so you can't use a ThreadLocal
to share context.
What you can do instead is wrap your statements in a custom StatementWrapper that stores that information in final fields.
add a comment
|
Indeed retry policy methods are invoked on an internal driver thread, so you can't use a ThreadLocal
to share context.
What you can do instead is wrap your statements in a custom StatementWrapper that stores that information in final fields.
add a comment
|
Indeed retry policy methods are invoked on an internal driver thread, so you can't use a ThreadLocal
to share context.
What you can do instead is wrap your statements in a custom StatementWrapper that stores that information in final fields.
Indeed retry policy methods are invoked on an internal driver thread, so you can't use a ThreadLocal
to share context.
What you can do instead is wrap your statements in a custom StatementWrapper that stores that information in final fields.
answered Apr 5 at 15:43
Olivier MichallatOlivier Michallat
1,9947 silver badges12 bronze badges
1,9947 silver badges12 bronze badges
add a comment
|
add a comment
|
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55399666%2fhow-to-keep-context-in-the-retrypolicy-thread-created-by-datastax-driver%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown