Skip to content
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

properly convert insertcount from string #1579

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
convert insertcount from int to long
  • Loading branch information
tarzanek committed Nov 29, 2021
commit 5b8b1127bb10c79f31ea8e52110f3b6e0ac9e1e5
12 changes: 6 additions & 6 deletions core/src/main/java/site/ycsb/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -408,18 +408,18 @@ private static List<ClientThread> initDb(String dbname, Properties props, int th

final List<ClientThread> clients = new ArrayList<>(threadcount);
try (final TraceScope span = tracer.newScope(CLIENT_INIT_SPAN)) {
int opcount;
long opcount;
if (dotransactions) {
opcount = Integer.parseInt(props.getProperty(OPERATION_COUNT_PROPERTY, "0"));
opcount = Long.parseLong(props.getProperty(OPERATION_COUNT_PROPERTY, "0"));
} else {
if (props.containsKey(INSERT_COUNT_PROPERTY)) {
opcount = Integer.parseInt(props.getProperty(INSERT_COUNT_PROPERTY, "0"));
opcount = Long.parseLong(props.getProperty(INSERT_COUNT_PROPERTY, "0"));
} else {
opcount = Integer.parseInt(props.getProperty(RECORD_COUNT_PROPERTY, DEFAULT_RECORD_COUNT));
opcount = Long.parseLong(props.getProperty(RECORD_COUNT_PROPERTY, DEFAULT_RECORD_COUNT));
}
}
if (threadcount > opcount && opcount > 0){
threadcount = opcount;
threadcount = new Long(opcount).intValue();
System.out.println("Warning: the threadcount is bigger than recordcount, the threadcount will be recordcount!");
}
for (int threadid = 0; threadid < threadcount; threadid++) {
Expand All @@ -432,7 +432,7 @@ private static List<ClientThread> initDb(String dbname, Properties props, int th
break;
}

int threadopcount = opcount / threadcount;
int threadopcount = new Long(opcount / threadcount).intValue();

// ensure correct number of operations, in case opcount is not a multiple of threadcount
if (threadid < opcount % threadcount) {
Expand Down