New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kv parity issues 94, 95, 96 #599
Conversation
… initial end of data marker
… initial end of data marker
… initial end of data marker
@@ -196,7 +193,8 @@ | |||
List<KeyValueEntry> history(String key) throws IOException, JetStreamApiException, InterruptedException; | |||
|
|||
/** | |||
* Remove history from all keys that currently are deleted or purged. | |||
* Remove history from all keys that currently are deleted or purged | |||
* with using a default KeyValuePurgeOptions | |||
* THIS IS A BETA FEATURE AND SUBJECT TO CHANGE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can remove the BETA FEATURE comments if PR makes the KV API GA. Alternatively, that could be another PR - up to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do it on another PR
|
||
import java.time.Duration; | ||
|
||
public class KeyValuePurgeOptions { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need doc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, will do
|
||
NatsKeyValue(NatsConnection connection, String bucketName, KeyValueOptions kvo) throws IOException { | ||
this.bucketName = Validator.validateKvBucketNameRequired(bucketName); | ||
streamName = toStreamName(bucketName); | ||
streamSubject = toStreamSubject(bucketName); | ||
defaultKeyPrefix = toKeyPrefix(bucketName); | ||
rawKeyPrefix = toKeyPrefix(bucketName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick... Could simplify a bit and remove rawKeyPrefix, just assign to pubSubKeyPrefix and reassign if necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rawKeyPrefix is the base. pubSubKeyPrefix varies depending on whether or not there is a JetStream prefix
|
||
ZonedDateTime limit; | ||
if (dmThresh < 0) { | ||
limit = DateTimeUtils.fromNow(600000); // long enough in the future to clear all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May want to assign to a private constant...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or configurable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's the only place it's used. Usually I'm constant crazy, but I like this b/c it stands out, and it's really an arbitrary value anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, have a few suggestions...
nats-io/nats-architecture-and-design#94 Items 1 and 3
nats-io/nats-architecture-and-design#95
nats-io/nats-architecture-and-design#96