Tabnine Logo
AggregateConf.getResourceOperations
Code IndexAdd Tabnine to your IDE (free)

How to use
getResourceOperations
method
in
org.apache.slider.core.conf.AggregateConf

Best Java code snippets using org.apache.slider.core.conf.AggregateConf.getResourceOperations (Showing top 20 results out of 315)

origin: apache/incubator-slider

/**
 * Get the health threshold percent for a specific role, falling back to
 * the global one if not.
 * @param roleGroup role group
 * @return the threshold percent for health
 */
public int getHealthThresholdPercentForRole(String roleGroup) {
 ConfTreeOperations resources = instanceDefinition.getResourceOperations();
 return resources.getComponentOptInt(roleGroup,
   CONTAINER_HEALTH_THRESHOLD_PERCENT, healthThresholdPercent);
}
origin: org.apache.slider/slider-core

/**
 * Get the node failure threshold for a specific role, falling back to
 * the global one if not
 * @param roleGroup role group
 * @return the threshold for failures
 */
private int getNodeFailureThresholdForRole(String roleGroup) {
 ConfTreeOperations resources =
   instanceDefinition.getResourceOperations();
 return resources.getComponentOptInt(roleGroup,
                   NODE_FAILURE_THRESHOLD,
                   nodeFailureThreshold);
}
origin: apache/incubator-slider

/**
 * Get the node failure threshold for a specific role, falling back to
 * the global one if not
 * @param roleGroup role group
 * @return the threshold for failures
 */
private int getNodeFailureThresholdForRole(String roleGroup) {
 ConfTreeOperations resources =
   instanceDefinition.getResourceOperations();
 return resources.getComponentOptInt(roleGroup,
                   NODE_FAILURE_THRESHOLD,
                   nodeFailureThreshold);
}
origin: apache/incubator-slider

/**
 * Get the failure threshold for a specific role, falling back to
 * the global one if not
 * @param roleStatus role
 * @return the threshold for failures
 */
private int getFailureThresholdForRole(RoleStatus roleStatus) {
 ConfTreeOperations resources =
   instanceDefinition.getResourceOperations();
 return resources.getComponentOptInt(roleStatus.getGroup(),
   CONTAINER_FAILURE_THRESHOLD,
   failureThreshold);
}
origin: org.apache.slider/slider-core

/**
 * Get the failure threshold for a specific role, falling back to
 * the global one if not
 * @param roleStatus role
 * @return the threshold for failures
 */
private int getFailureThresholdForRole(RoleStatus roleStatus) {
 ConfTreeOperations resources =
   instanceDefinition.getResourceOperations();
 return resources.getComponentOptInt(roleStatus.getGroup(),
   CONTAINER_FAILURE_THRESHOLD,
   failureThreshold);
}
origin: org.apache.slider/slider-core

public void validateNodeCount(AggregateConf instanceDescription,
               String name, int min, int max) throws
                               BadCommandArgumentsException {
 MapOperations component =
  instanceDescription.getResourceOperations().getComponent(name);
 int count;
 if (component == null) {
  count = 0;
 } else {
  count = component.getOptionInt(ResourceKeys.COMPONENT_INSTANCES, 0);
 }
 validateNodeCount(name, count, min, max);
}

origin: apache/incubator-slider

public void validateNodeCount(AggregateConf instanceDescription,
               String name, int min, int max) throws
                               BadCommandArgumentsException {
 MapOperations component =
  instanceDescription.getResourceOperations().getComponent(name);
 int count;
 if (component == null) {
  count = 0;
 } else {
  count = component.getOptionInt(ResourceKeys.COMPONENT_INSTANCES, 0);
 }
 validateNodeCount(name, count, min, max);
}

origin: org.apache.slider/slider-hbase-provider

/**
 * Validate the instance definition.
 * @param instanceDefinition instance definition
 */
@Override
public void validateInstanceDefinition(AggregateConf instanceDefinition, SliderFileSystem fs) throws
  SliderException {
 super.validateInstanceDefinition(instanceDefinition, fs);
 ConfTreeOperations resources =
  instanceDefinition.getResourceOperations();
 Set<String> unknownRoles = resources.getComponentNames();
 unknownRoles.removeAll(knownRoleNames);
 if (!unknownRoles.isEmpty()) {
  throw new BadCommandArgumentsException("Unknown component: %s",
                      unknownRoles.iterator().next());
 }
 providerUtils.validateNodeCount(instanceDefinition, HBaseKeys.ROLE_WORKER,
                 0, -1);
 providerUtils.validateNodeCount(instanceDefinition, HBaseKeys.ROLE_MASTER,
                 0, -1);
 providerUtils.validateNodeCount(instanceDefinition, HBaseKeys.ROLE_REST_GATEWAY,
  0, -1);
 providerUtils.validateNodeCount(instanceDefinition, HBaseKeys.ROLE_THRIFT_GATEWAY,
  0, -1);
 providerUtils.validateNodeCount(instanceDefinition, HBaseKeys.ROLE_THRIFT2_GATEWAY,
  0, -1);
}
origin: org.apache.slider/slider-core

for (String component : instanceDefinition.getResourceOperations().getComponentNames()) {
 instanceDefinition.getAppConfOperations().getOrAddComponent(component);
ConfTreeOperations resources = instanceDefinition.getResourceOperations();
origin: org.apache.slider/slider-accumulo-provider

@Override
public void validateInstanceDefinition(AggregateConf instanceDefinition, SliderFileSystem fs) throws
  SliderException {
 super.validateInstanceDefinition(instanceDefinition, fs);
 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);
}
origin: org.apache.slider/slider-core

/**
 * Start an asychronous launch operation
 * @param assignment container assignment
 * @param clusterSpec cluster spec to use for template
 * @param credentials credentials to use
 */
public void launchRole(ContainerAssignment assignment,
  AggregateConf clusterSpec,
  Credentials credentials) {
 RoleStatus role = assignment.role;
 String roleName = role.getName();
 String roleGroup = role.getGroup();
 // prelaunch safety check
 Preconditions.checkArgument(provider.isSupportedRole(roleName));
 RoleLaunchService.RoleLauncher launcher =
  new RoleLaunchService.RoleLauncher(assignment,
    clusterSpec,
    clusterSpec.getResourceOperations().getOrAddComponent(roleGroup),
    clusterSpec.getAppConfOperations().getOrAddComponent(roleGroup),
    credentials);
 execute(launcher);
}
origin: apache/incubator-slider

/**
 * Start an asychronous launch operation
 * @param assignment container assignment
 * @param clusterSpec cluster spec to use for template
 * @param credentials credentials to use
 */
public void launchRole(ContainerAssignment assignment,
  AggregateConf clusterSpec,
  Credentials credentials) {
 RoleStatus role = assignment.role;
 String roleName = role.getName();
 String roleGroup = role.getGroup();
 // prelaunch safety check
 Preconditions.checkArgument(provider.isSupportedRole(roleName));
 RoleLaunchService.RoleLauncher launcher =
  new RoleLaunchService.RoleLauncher(assignment,
    clusterSpec,
    clusterSpec.getResourceOperations().getOrAddComponent(roleGroup),
    clusterSpec.getAppConfOperations().getOrAddComponent(roleGroup),
    credentials);
 execute(launcher);
}
origin: org.apache.slider/slider-core

instanceDefinition.getResourceOperations();
origin: apache/incubator-slider

instanceDefinition.getResourceOperations();
origin: org.apache.slider/slider-core

 instanceDefinition.getResourceOperations();
for (ProviderRole role : roles) {
 String name = role.name;
origin: apache/incubator-slider

 instanceDefinition.getResourceOperations();
for (ProviderRole role : roles) {
 String name = role.name;
origin: apache/incubator-slider

ConfTreeOperations resTemplate =
 ConfTreeOperations.fromResource(resourceTemplate);
instanceConf.getResourceOperations()
       .mergeWithoutOverwrite(resTemplate.confTree);
origin: org.apache.slider/slider-core

ConfTreeOperations resTemplate =
 ConfTreeOperations.fromResource(resourceTemplate);
instanceConf.getResourceOperations()
       .mergeWithoutOverwrite(resTemplate.confTree);
origin: org.apache.slider/slider-core

private AggregateConf prepareConfForAgentStateTests() {
 ConfTree tree = new ConfTree();
 tree.global.put(InternalKeys.INTERNAL_APPLICATION_IMAGE_PATH, ".");
 AggregateConf instanceDefinition = new AggregateConf();
 instanceDefinition.setInternal(tree);
 instanceDefinition.setAppConf(tree);
 instanceDefinition.getAppConfOperations().getGlobalOptions()
   .put(AgentKeys.APP_DEF, ".");
 instanceDefinition.getAppConfOperations().getGlobalOptions()
   .put(AgentKeys.AGENT_CONF, ".");
 instanceDefinition.getAppConfOperations().getGlobalOptions()
   .put(AgentKeys.AGENT_VERSION, ".");
 instanceDefinition.getResourceOperations().getOrAddComponent(
   "HBASE_MASTER");
 instanceDefinition.getResourceOperations().getOrAddComponent(
   "HBASE_REGIONSERVER");
 return instanceDefinition;
}
origin: apache/incubator-slider

private AggregateConf prepareConfForAgentStateTests() {
 ConfTree tree = new ConfTree();
 tree.global.put(InternalKeys.INTERNAL_APPLICATION_IMAGE_PATH, ".");
 AggregateConf instanceDefinition = new AggregateConf();
 instanceDefinition.setInternal(tree);
 instanceDefinition.setAppConf(tree);
 instanceDefinition.getAppConfOperations().getGlobalOptions()
   .put(AgentKeys.APP_DEF, ".");
 instanceDefinition.getAppConfOperations().getGlobalOptions()
   .put(AgentKeys.AGENT_CONF, ".");
 instanceDefinition.getAppConfOperations().getGlobalOptions()
   .put(AgentKeys.AGENT_VERSION, ".");
 instanceDefinition.getResourceOperations().getOrAddComponent(
   "HBASE_MASTER");
 instanceDefinition.getResourceOperations().getOrAddComponent(
   "HBASE_REGIONSERVER");
 return instanceDefinition;
}
org.apache.slider.core.confAggregateConfgetResourceOperations

Popular methods of AggregateConf

  • getAppConfOperations
  • getInternalOperations
  • <init>
  • getAppConf
  • resolve
  • setAppConf
  • setInternal
  • setName
  • getInternal
  • getName
  • getPassphrase
  • getResources
  • getPassphrase,
  • getResources,
  • isComplete,
  • isVersioned,
  • setResources,
  • toString,
  • validate

Popular in Java

  • Updating database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • getResourceAsStream (ClassLoader)
  • runOnUiThread (Activity)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now