milleruntime commented on a change in pull request #2233:
URL: https://github.com/apache/accumulo/pull/2233#discussion_r690316919
##########
File path:
server/base/src/main/java/org/apache/accumulo/server/ServerContext.java
##########
@@ -279,4 +300,139 @@ public Ample getAmple() {
public Set<String> getRecoveryDirs() {
return serverConstants.getRecoveryDirs();
}
+
+ /**
+ * Check to see if this version of Accumulo can run against or upgrade the
passed in data version.
+ */
+ public static void ensureDataVersionCompatible(int dataVersion) {
+ if (!(ServerConstants.CAN_RUN.contains(dataVersion))) {
+ throw new IllegalStateException("This version of accumulo (" +
Constants.VERSION
+ + ") is not compatible with files stored using data version " +
dataVersion);
+ }
+ }
+
+ public void waitForZookeeperAndHdfs() {
+ log.info("Attempting to talk to zookeeper");
+ while (true) {
+ try {
+ getZooReaderWriter().getChildren(Constants.ZROOT);
+ break;
+ } catch (InterruptedException e) {
+ // ignored
+ } catch (KeeperException ex) {
Review comment:
I am not sure. This code was just moved. But your suggestion is
definitely better.
--
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]