keith-turner commented on code in PR #4199:
URL: https://github.com/apache/accumulo/pull/4199#discussion_r1468035242
##########
test/src/main/java/org/apache/accumulo/test/fate/accumulo/AccumuloStoreReadWriteIT.java:
##########
@@ -127,6 +127,31 @@ public void testReadWrite() throws Exception {
}
}
+ @Test
+ public void testReadWriteTxInfo() throws Exception {
+ final String table = getUniqueNames(1)[0];
+ try (ClientContext client =
+ (ClientContext) Accumulo.newClient().from(getClientProps()).build()) {
+ client.tableOperations().create(table);
+
+ AccumuloStore<TestEnv> store = new AccumuloStore<>(client, table);
+
+ long tid = store.create();
+ FateTxStore<TestEnv> txStore = store.reserve(tid);
+
+ try {
+ // Go through all enum values to verify each TxInfo type will be
properly
+ // written and read from the store
+ for (TxInfo txInfo : TxInfo.values()) {
+ txStore.setTransactionInfo(txInfo, "value: " + txInfo.name());
+ assertEquals("value: " + txInfo.name(),
txStore.getTransactionInfo(txInfo));
+ }
+ } finally {
+ txStore.delete();
Review Comment:
I was trying to think if there is anything that should be checked after
delete, but did not think of anything.
##########
test/src/main/java/org/apache/accumulo/test/fate/accumulo/AccumuloStoreReadWriteIT.java:
##########
@@ -127,6 +127,31 @@ public void testReadWrite() throws Exception {
}
}
+ @Test
+ public void testReadWriteTxInfo() throws Exception {
+ final String table = getUniqueNames(1)[0];
+ try (ClientContext client =
+ (ClientContext) Accumulo.newClient().from(getClientProps()).build()) {
+ client.tableOperations().create(table);
+
+ AccumuloStore<TestEnv> store = new AccumuloStore<>(client, table);
+
+ long tid = store.create();
+ FateTxStore<TestEnv> txStore = store.reserve(tid);
+
+ try {
+ // Go through all enum values to verify each TxInfo type will be
properly
+ // written and read from the store
+ for (TxInfo txInfo : TxInfo.values()) {
+ txStore.setTransactionInfo(txInfo, "value: " + txInfo.name());
Review Comment:
Could add a check before setting to check that case.
```suggestion
assertNull(txStore.getTransactionInfo(txInfo));
txStore.setTransactionInfo(txInfo, "value: " + txInfo.name());
```
--
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]