Skip to content

Conversation

@brfrn169
Copy link
Collaborator

Description

This PR updates the sensor workload to use the scanner API introduced in scalar-labs/scalardb#2729.

Related issues and/or PRs

Changes made

  • Updated the sensor workload to use the scanner API

Checklist

The following is a best-effort checklist. If any items in this checklist are not applicable to this PR or are dependent on other, unmerged PRs, please still mark the checkboxes after you have read and understood each item.

  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes.
  • Any remaining open issues linked to this PR are documented and up-to-date (Jira, GitHub, etc.).
  • Tests (unit, integration, etc.) have been added for the changes.
  • My changes generate no new warnings.
  • Any dependent changes in other PRs have been merged and published.

Additional notes (optional)

N/A

@brfrn169 brfrn169 requested a review from Copilot June 16, 2025 14:02
@brfrn169 brfrn169 self-assigned this Jun 16, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the sensor workload to use the new scanner API in Scalar DB. Key changes include:

  • In SensorProcessor.java, adding logic to alternate between using scan() and getScanner() via an AtomicInteger counter.
  • In SensorCommon.java, making getRevisionFromResult() public to support usage in the sensor workload.
  • Minor error message text updates in SensorChecker.java and schema updates in tx_sensor.cql to add a new keyspace and table.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
scalardb-test/src/main/java/kelpie/scalardb/sensor/SensorProcessor.java Alternates between scan() and getScanner() based on an attempt counter.
scalardb-test/src/main/java/kelpie/scalardb/sensor/SensorCommon.java Changes getRevisionFromResult() from private to public.
scalardb-test/src/main/java/kelpie/scalardb/sensor/SensorChecker.java Updates error message string to correct spelling and formatting.
scalardb-test/schema/tx_sensor.cql Adds a new keyspace and table to support the updated sensor workload.
Comments suppressed due to low confidence (3)

scalardb-test/src/main/java/kelpie/scalardb/sensor/SensorCommon.java:58

  • Since getRevisionFromResult is now part of the public API, consider adding JavaDoc to clarify its expected input, behavior, and any potential exceptions.
public static int getRevisionFromResult(Result result) {

scalardb-test/src/main/java/kelpie/scalardb/sensor/SensorChecker.java:43

  • [nitpick] Consider removing the extra space before the exclamation mark for a cleaner error message.
logError("Duplication happened !");

scalardb-test/schema/tx_sensor.cql:5

  • Consider updating the project schema documentation to include the new keyspace and table definitions added in this PR.
CREATE KEYSPACE IF NOT EXISTS scalardb WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1 };

@brfrn169 brfrn169 force-pushed the use-scanner-in-sensor branch from 5ed00b1 to 51851c2 Compare June 16, 2025 15:49
Copy link
Contributor

@feeblefakie feeblefakie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you!

Copy link

@Torch3333 Torch3333 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

Copy link
Contributor

@komamitsu komamitsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

@brfrn169 brfrn169 merged commit 2742a73 into master Jun 17, 2025
@brfrn169 brfrn169 deleted the use-scanner-in-sensor branch June 17, 2025 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants