keith-turner commented on a change in pull request #166:
URL: https://github.com/apache/accumulo-testing/pull/166#discussion_r750637232
##########
File path:
src/main/java/org/apache/accumulo/testing/continuous/ContinuousIngest.java
##########
@@ -179,8 +190,11 @@ public static void main(String[] args) throws Exception {
long rowLong = genLong(rowMin, rowMax, r);
byte[] prevRow = genRow(prevRows[index]);
Review comment:
Maybe the prevRow array could be dropped and nodeMap used instead.
```suggestion
byte[] prevRow = genRow(nodeMap[depth-1][index].row);
```
##########
File path:
src/main/java/org/apache/accumulo/testing/continuous/ContinuousIngest.java
##########
@@ -191,14 +205,36 @@ public static void main(String[] args) throws Exception {
pauseCheck(testProps, r);
}
- // create one big linked list, this makes all of the first inserts
point to something
- for (int index = 0; index < flushInterval - 1; index++) {
- Mutation m = genMutation(firstRows[index], firstColFams[index],
firstColQuals[index], cv,
- ingestInstanceId, count, genRow(prevRows[index + 1]), checksum);
- count++;
- bw.addMutation(m);
+ // random chance that the entries will be deleted
+ boolean delete = r.nextFloat() < deleteProbability;
+
+ // if the previously written entries are scheduled to be deleted
+ if (delete) {
+ log.info("Deleting last portion of written entries");
+ // add delete mutations in the reverse order in which they were
written
+ for (int depth = nodeMap.length - 1; depth >= 0; depth--) {
+ for (int index = nodeMap[0].length - 1; index >= 0; index--) {
+ MutationInfo currentNode = nodeMap[depth][index];
+ Mutation m = new Mutation(genRow(currentNode.row));
+ m.putDelete(genCol(currentNode.cf), genCol(currentNode.cq));
+ count--;
+ bw.addMutation(m);
+ }
+ lastFlushTime = flush(bw, count, flushInterval, lastFlushTime);
+ pauseCheck(testProps, r);
+ }
+ } else {
+ // create one big linked list, this makes all the first inserts
point to something
+ for (int index = 0; index < flushInterval - 1; index++) {
+ MutationInfo currentNode = firstEntries[index];
+ Mutation m = genMutation(currentNode.row, currentNode.cf,
currentNode.cq, cv,
+ ingestInstanceId, count, genRow(prevRows[index + 1]),
checksum);
Review comment:
```suggestion
ingestInstanceId, count, genRow(nodeMap[maxDepth-1][index +
1]), checksum);
```
##########
File path:
src/main/java/org/apache/accumulo/testing/continuous/ContinuousIngest.java
##########
@@ -191,14 +205,36 @@ public static void main(String[] args) throws Exception {
pauseCheck(testProps, r);
}
- // create one big linked list, this makes all of the first inserts
point to something
- for (int index = 0; index < flushInterval - 1; index++) {
- Mutation m = genMutation(firstRows[index], firstColFams[index],
firstColQuals[index], cv,
- ingestInstanceId, count, genRow(prevRows[index + 1]), checksum);
- count++;
- bw.addMutation(m);
+ // random chance that the entries will be deleted
+ boolean delete = r.nextFloat() < deleteProbability;
+
+ // if the previously written entries are scheduled to be deleted
+ if (delete) {
+ log.info("Deleting last portion of written entries");
+ // add delete mutations in the reverse order in which they were
written
+ for (int depth = nodeMap.length - 1; depth >= 0; depth--) {
+ for (int index = nodeMap[0].length - 1; index >= 0; index--) {
Review comment:
```suggestion
for (int index = nodeMap[depth].length - 1; index >= 0; index--)
{
```
##########
File path:
src/main/java/org/apache/accumulo/testing/continuous/ContinuousIngest.java
##########
@@ -191,14 +205,36 @@ public static void main(String[] args) throws Exception {
pauseCheck(testProps, r);
}
- // create one big linked list, this makes all of the first inserts
point to something
- for (int index = 0; index < flushInterval - 1; index++) {
- Mutation m = genMutation(firstRows[index], firstColFams[index],
firstColQuals[index], cv,
- ingestInstanceId, count, genRow(prevRows[index + 1]), checksum);
- count++;
- bw.addMutation(m);
+ // random chance that the entries will be deleted
+ boolean delete = r.nextFloat() < deleteProbability;
+
+ // if the previously written entries are scheduled to be deleted
+ if (delete) {
+ log.info("Deleting last portion of written entries");
+ // add delete mutations in the reverse order in which they were
written
+ for (int depth = nodeMap.length - 1; depth >= 0; depth--) {
+ for (int index = nodeMap[0].length - 1; index >= 0; index--) {
+ MutationInfo currentNode = nodeMap[depth][index];
+ Mutation m = new Mutation(genRow(currentNode.row));
+ m.putDelete(genCol(currentNode.cf), genCol(currentNode.cq));
+ count--;
Review comment:
Not sure we should decrement this. Makes it hard to understand what it
is happening. I think a separate delete counter may be better, then we can see
number of inserts and deletes that have happened.
##########
File path:
src/main/java/org/apache/accumulo/testing/continuous/ContinuousIngest.java
##########
@@ -191,14 +205,36 @@ public static void main(String[] args) throws Exception {
pauseCheck(testProps, r);
}
- // create one big linked list, this makes all of the first inserts
point to something
- for (int index = 0; index < flushInterval - 1; index++) {
- Mutation m = genMutation(firstRows[index], firstColFams[index],
firstColQuals[index], cv,
- ingestInstanceId, count, genRow(prevRows[index + 1]), checksum);
- count++;
- bw.addMutation(m);
+ // random chance that the entries will be deleted
+ boolean delete = r.nextFloat() < deleteProbability;
+
+ // if the previously written entries are scheduled to be deleted
+ if (delete) {
+ log.info("Deleting last portion of written entries");
+ // add delete mutations in the reverse order in which they were
written
+ for (int depth = nodeMap.length - 1; depth >= 0; depth--) {
+ for (int index = nodeMap[0].length - 1; index >= 0; index--) {
+ MutationInfo currentNode = nodeMap[depth][index];
+ Mutation m = new Mutation(genRow(currentNode.row));
+ m.putDelete(genCol(currentNode.cf), genCol(currentNode.cq));
+ count--;
+ bw.addMutation(m);
+ }
+ lastFlushTime = flush(bw, count, flushInterval, lastFlushTime);
+ pauseCheck(testProps, r);
+ }
+ } else {
+ // create one big linked list, this makes all the first inserts
point to something
+ for (int index = 0; index < flushInterval - 1; index++) {
+ MutationInfo currentNode = firstEntries[index];
Review comment:
Could we drop firstEntries and do the following instead?
```suggestion
MutationInfo currentNode = nodeMap[0][index];
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]