-
Notifications
You must be signed in to change notification settings - Fork 3
CBL-7448 : Update Test App to use CBL android 4.0 API #157
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
Conversation
Aniket392
commented
Sep 24, 2025
- Updated replicationConfiguration constructor to take updated paramaters
- Updated LogConfiguration to LogSink and its method
- Removed API for adding collection as per new APIs
- Changed the logic to update collectionconfig and update replconfig
| .setDirectory(directory); | ||
| if (maxRotateCount > 1) { | ||
| config.setMaxRotateCount(maxRotateCount); | ||
| builder.setMaxKeptFiles(maxRotateCount-1); |
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.
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.
Updated maxKeptFiles = maxRotateCount + 1
| public int getMaxRotateCount(Args args) { | ||
| return Database.log.getFile().getConfig().getMaxRotateCount(); | ||
| FileLogSink sink = LogSinks.get().getFile(); | ||
| return sink != null ? sink.getMaxKeptFiles() - 1 : 0; |
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.
This is correct.
| .setMaxFileSize(currentSink.getMaxFileSize()) | ||
| .setMaxKeptFiles(currentSink.getMaxKeptFiles()) | ||
| .setPlainText(currentSink.isPlainText()) | ||
| .build(); |
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.
There is public Builder(@nonnull FileLogSink sink) that you can use here instead of re-setting everything.
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.
Updated the FileLogSink Builder with builder of logSink parameter
|
|
||
| if (currentSink == null) return null; | ||
|
|
||
| FileLogSink newSink = new FileLogSink.Builder() |
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.
There is public Builder(@nonnull FileLogSink sink) that you can use here instead of re-setting everything.
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.
Updated the FileLogSink Builder with builder of logSink parameter
|
|
||
| if (currentSink == null) return null; | ||
|
|
||
| FileLogSink newSink = new FileLogSink.Builder() |
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.
There is public Builder(@nonnull FileLogSink sink) that you can use here instead of re-setting everything.
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.
Updated the FileLogSink Builder with builder of logSink parameter
| ReplicatorConfiguration replicatorConfiguration = args.get("configuration"); | ||
| return replicatorConfiguration.getChannels(); | ||
| CollectionConfiguration collectionConfiguration = args.get("configuration"); | ||
| return collectionConfiguration.getChannels(); |
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.
ReplicatorConfiguration replicatorConfiguration = args.get("configuration");
return replicatorConfiguration.collections.get(0).getChannels();
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.
Updated as
replicatorConfiguration.getCollections().stream().findFirst().map(CollectionConfiguration::getChannels).orElse(null);
| ReplicatorConfiguration replicatorConfiguration = args.get("configuration"); | ||
| return replicatorConfiguration.getDatabase(); | ||
| CollectionConfiguration collectionConfiguration = args.get("configuration"); | ||
| return collectionConfiguration.getCollection().getDatabase(); |
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.
ReplicatorConfiguration replicatorConfiguration = args.get("configuration");
return replicatorConfiguration.collections.get(0).getCollection().getDatabase();
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.
Updated as
replicatorConfiguration.getCollections().stream().findFirst().map(it -> it.getCollection().getDatabase()).orElse(null);
| ReplicatorConfiguration replicatorConfiguration = args.get("configuration"); | ||
| return replicatorConfiguration.getDocumentIDs(); | ||
| CollectionConfiguration collectionConfigurationConfiguration = args.get("configuration"); | ||
| return collectionConfigurationConfiguration.getDocumentIDs(); |
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.
ReplicatorConfiguration replicatorConfiguration = args.get("configuration");
return replicatorConfiguration.collections.get(0).getDocumentIDs();
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.
Updated as
replicatorConfiguration.getCollections().stream().findFirst().map(CollectionConfiguration::getDocumentIDs).orElse(null)
| } | ||
|
|
||
| public void setChannels(Args args) { | ||
| ReplicatorConfiguration replicatorConfiguration = args.get("configuration"); |
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.
Not sure that it should be removed.
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.
Both setChannels and setDocument are needed to change or remove as discussed in #156 (comment)
| CollectionConfiguration collectionConfigurationConfiguration = args.get("configuration"); | ||
| List<String> documentIds = args.get("documentIds"); | ||
| replicatorConfiguration.setDocumentIDs(documentIds); | ||
| collectionConfigurationConfiguration.setDocumentIDs(documentIds); |
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.
ReplicatorConfiguration replicatorConfiguration = args.get("configuration");
return replicatorConfiguration.collections.get(0).setDocumentIDs(documentIds);
Need to confirm that replicatorConfiguration.collections doesn't return a copy otherwise this will not work. I couldn't think about the alternative though.
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.
Both setChannels and setDocument are needed to change or remove as discussed in #156 (comment)
…questHandler APIs
pasin
left a comment
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.
Look good to me.
Need @sanjivanipatrax @barkha06 to review about removing setting document ids / channels filter and addCollections endpoints as those will not be available anymore.