Skip to content

Commit 7170142

Browse files
Code suggestions
Co-authored-by: Keith Turner <kturner@apache.org>
1 parent 97e9e38 commit 7170142

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/src/main/java/org/apache/accumulo/test/MaxWalReferencedIT.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void testWALMaxReferenced() throws Exception {
7979

8080
SortedSet<Text> splits = new TreeSet<>();
8181
for (int i = 1; i <= 4; i++) {
82-
splits.add(new Text(Integer.toString(i)));
82+
splits.add(new Text(String.format("%03d", i)));
8383
}
8484
client.tableOperations().create(tableName, new NewTableConfiguration().withSplits(splits));
8585

@@ -89,8 +89,10 @@ public void testWALMaxReferenced() throws Exception {
8989
AtomicInteger iteration = new AtomicInteger(0);
9090
Wait.waitFor(() -> {
9191

92+
String rowToWrite = String.format("%03d", iteration.get());
93+
9294
// Write data that should fill or partially fill the WAL
93-
writeData(client, tableName);
95+
writeData(client, tableName, rowToWrite);
9496

9597
// Check the current number of WALs in use
9698
long walCount = getWalCount(getServerContext());
@@ -115,11 +117,11 @@ public void testWALMaxReferenced() throws Exception {
115117
/**
116118
* Writes data to a single tablet until the total written data size exceeds 2 * TSERV_WAL_MAX_SIZE
117119
*/
118-
private void writeData(AccumuloClient client, String table) throws Exception {
120+
private void writeData(AccumuloClient client, String table, String rowToWrite) throws Exception {
119121
try (BatchWriter bw = client.createBatchWriter(table, new BatchWriterConfig())) {
120122
long totalWritten = 0;
121123
while (totalWritten < 2 * hdfsMinBlockSize) {
122-
Mutation m = new Mutation("target_row");
124+
Mutation m = new Mutation(rowToWrite);
123125
m.put("cf", "cq", "value");
124126
bw.addMutation(m);
125127
totalWritten += m.estimatedMemoryUsed();

0 commit comments

Comments
 (0)