Github user ctubbsii commented on a diff in the pull request:
https://github.com/apache/accumulo/pull/77#discussion_r54441134
--- Diff: fate/src/main/java/org/apache/accumulo/fate/ZooStore.java ---
@@ -458,4 +458,43 @@ public Serializable getProperty(long tid, String prop)
{
throw new RuntimeException(e);
}
}
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public List<ReadOnlyRepo<T>> getStack(long tid) {
+ String txpath = getTXPath(tid);
+
+ outer: while (true) {
+ List<String> ops;
+ try {
+ ops = zk.getChildren(txpath);
+ } catch (KeeperException.NoNodeException e) {
+ return null;
+ } catch (KeeperException | InterruptedException e1) {
+ throw new RuntimeException(e1);
+ }
+
+ ops = new ArrayList<String>(ops);
+ Collections.sort(ops, Collections.reverseOrder());
+
+ ArrayList<ReadOnlyRepo<T>> dops = new ArrayList<>();
+
+ for (String child : ops) {
+ if (child.startsWith("repo_")) {
+ byte[] ser;
+ try {
+ ser = zk.getData(txpath + "/" + child, null);
+ dops.add((ReadOnlyRepo<T>) deserialize(ser));
--- End diff --
You can limit the unchecked cast warning suppression to just this
parameter, if you assign it to a variable and put the warnings suppression on
that variable, instead of the whole method.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---