/** * Returns the instance name given at system initialization time. * * @return current instance name */ public String getInstanceName() { ensureOpen(); return info.getInstanceName(); }
/** * Returns a unique string that identifies this instance of accumulo. * * @return a UUID */ @Override public String getInstanceID() { ensureOpen(); final String instanceName = info.getInstanceName(); if (instanceId == null) { // want the instance id to be stable for the life of this instance object, // so only get it once String instanceNamePath = Constants.ZROOT + Constants.ZINSTANCES + "/" + instanceName; byte[] iidb = zooCache.get(instanceNamePath); if (iidb == null) { throw new RuntimeException( "Instance name " + instanceName + " does not exist in zookeeper. " + "Run \"accumulo org.apache.accumulo.server.util.ListInstances\" to see a list."); } instanceId = new String(iidb, UTF_8); } if (zooCache.get(Constants.ZROOT + "/" + instanceId) == null) { if (instanceName == null) throw new RuntimeException("Instance id " + instanceId + " does not exist in zookeeper"); throw new RuntimeException("Instance id " + instanceId + " pointed to by the name " + instanceName + " does not exist in zookeeper"); } return instanceId; }
public String getDefaultPrompt() { Objects.nonNull(accumuloClient); ClientInfo info = ClientInfo.from(accumuloClient.properties()); return accumuloClient.whoami() + "@" + info.getInstanceName() + (getTableName().isEmpty() ? "" : " ") + getTableName() + "> "; }
private ServerContext(SiteConfiguration siteConfig, ClientInfo info) { this(new ServerInfo(siteConfig, info.getInstanceName(), info.getZooKeepers(), info.getZooKeepersSessionTimeOut())); }
public void printInfo() throws IOException { ClientInfo info = ClientInfo.from(accumuloClient.properties()); reader.print("\n" + SHELL_DESCRIPTION + "\n" + "- \n" + "- version: " + Constants.VERSION + "\n" + "- instance name: " + info.getInstanceName() + "\n" + "- instance id: " + accumuloClient.getInstanceID() + "\n" + "- \n" + "- type 'help' for a list of available commands\n" + "- \n"); reader.flush(); }