@Override public void validateInstanceDefinition(AggregateConf instanceDefinition) throws SliderException { super.validateInstanceDefinition(instanceDefinition); ConfTreeOperations resources = instanceDefinition.getResourceOperations(); Set<String> unknownRoles = resources.getComponentNames(); unknownRoles.removeAll(knownRoleNames); if (!unknownRoles.isEmpty()) { throw new BadCommandArgumentsException( "There is unknown role: %s", unknownRoles.iterator().next()); } providerUtils.validateNodeCount(instanceDefinition, AccumuloKeys.ROLE_TABLET, 1, -1); providerUtils.validateNodeCount(instanceDefinition, AccumuloKeys.ROLE_MASTER, 1, -1); providerUtils.validateNodeCount(instanceDefinition, AccumuloKeys.ROLE_GARBAGE_COLLECTOR, 0, -1); providerUtils.validateNodeCount(instanceDefinition, AccumuloKeys.ROLE_MONITOR, 0, -1); providerUtils.validateNodeCount(instanceDefinition, AccumuloKeys.ROLE_TRACER, 0, -1); MapOperations globalAppConfOptions = instanceDefinition.getAppConfOperations().getGlobalOptions(); globalAppConfOptions.verifyOptionSet(AccumuloKeys.OPTION_ZK_HOME); globalAppConfOptions.verifyOptionSet(AccumuloKeys.OPTION_HADOOP_HOME); }
/** * Build the accumulo-site.xml file This the configuration used by Accumulo directly * * @param instanceDescription this is the cluster specification used to define this * @return a map of the dynamic bindings for this Slider instance */ public Map<String, String> buildSiteConfFromInstance(AggregateConf instanceDescription) throws BadConfigException { ConfTreeOperations appconf = instanceDescription.getAppConfOperations(); MapOperations globalAppOptions = appconf.getGlobalOptions(); MapOperations globalInstanceOptions = instanceDescription.getInternalOperations().getGlobalOptions(); Map<String, String> sitexml = new HashMap<String, String>(); providerUtils.propagateSiteOptions(globalAppOptions, sitexml); propagateClientFSBinding(sitexml); setDatabasePath( sitexml, globalInstanceOptions.getMandatoryOption(InternalKeys.INTERNAL_DATA_DIR_PATH)); String quorum = globalAppOptions.getMandatoryOption(OptionKeys.ZOOKEEPER_QUORUM); sitexml.put(AccumuloConfigFileOptions.ZOOKEEPER_HOST, quorum); return sitexml; }