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

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

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

origin: apache/incubator-slider

@Override
public SecurityStore generate(String hostname, String containerId,
               AggregateConf instanceDefinition,
               MapOperations compOps, String role)
  throws SliderException, IOException {
 SecurityStore truststore = null;
 String password = getStorePassword(
   instanceDefinition.getAppConf().credentials, compOps, role);
 if (password != null) {
  truststore = certificateMgr.generateContainerTruststore(containerId,
                              role, password);
 }
 return truststore;
}
origin: org.apache.slider/slider-core

private void actionDiagnosticApplication(ActionDiagnosticArgs diagnosticArgs)
  throws YarnException, IOException {
 // not using member variable clustername because we want to place
 // application name after --application option and member variable
 // cluster name has to be put behind action
 String clusterName = diagnosticArgs.name;
 requireArgumentSet(Arguments.ARG_NAME, clusterName);
 AggregateConf instanceDefinition = fetchInstanceDefinition(clusterName);
 String clusterDir = instanceDefinition.getAppConfOperations()
   .getGlobalOptions().get(AgentKeys.APP_ROOT);
 String pkgTarball = getApplicationDefinitionPath(instanceDefinition.getAppConfOperations());
 String runAsUser = instanceDefinition.getAppConfOperations()
   .getGlobalOptions().get(AgentKeys.RUNAS_USER);
 log.info("The location of the cluster instance directory in HDFS is: {}", clusterDir);
 log.info("The name of the application package tarball on HDFS is: {}",pkgTarball);
 log.info("The runas user of the application in the cluster is: {}",runAsUser);
 if (diagnosticArgs.verbose) {
  log.info("App config of the application:\n{}",
    instanceDefinition.getAppConf().toJson());
  log.info("Resource config of the application:\n{}",
    instanceDefinition.getResources().toJson());
 }
}
origin: apache/incubator-slider

private void actionDiagnosticApplication(ActionDiagnosticArgs diagnosticArgs)
  throws YarnException, IOException {
 // not using member variable clustername because we want to place
 // application name after --application option and member variable
 // cluster name has to be put behind action
 String clusterName = diagnosticArgs.name;
 requireArgumentSet(Arguments.ARG_NAME, clusterName);
 AggregateConf instanceDefinition = fetchInstanceDefinition(clusterName);
 String clusterDir = instanceDefinition.getAppConfOperations()
   .getGlobalOptions().get(AgentKeys.APP_ROOT);
 String pkgTarball = getApplicationDefinitionPath(instanceDefinition.getAppConfOperations());
 String runAsUser = instanceDefinition.getAppConfOperations()
   .getGlobalOptions().get(AgentKeys.RUNAS_USER);
 log.info("The location of the cluster instance directory in HDFS is: {}", clusterDir);
 log.info("The name of the application package tarball on HDFS is: {}",pkgTarball);
 log.info("The runas user of the application in the cluster is: {}",runAsUser);
 if (diagnosticArgs.verbose) {
  log.info("App config of the application:\n{}",
    instanceDefinition.getAppConf().toJson());
  log.info("Resource config of the application:\n{}",
    instanceDefinition.getResources().toJson());
 }
}
origin: org.apache.slider/slider-core

@Override
public SecurityStore generate(String hostname, String containerId,
               AggregateConf instanceDefinition,
               MapOperations compOps, String role)
  throws SliderException, IOException {
 SecurityStore truststore = null;
 String password = getStorePassword(
   instanceDefinition.getAppConf().credentials, compOps, role);
 if (password != null) {
  truststore = certificateMgr.generateContainerTruststore(containerId,
                              role, password);
 }
 return truststore;
}
origin: org.apache.slider/slider-core

@Override
public SecurityStore generate(String hostname, String containerId,
               AggregateConf instanceDefinition,
               MapOperations compOps, String role)
  throws SliderException, IOException {
 SecurityStore keystore = null;
 String password = getStorePassword(
   instanceDefinition.getAppConf().credentials, compOps, role);
 if (password != null) {
  keystore =
    certificateMgr.generateContainerKeystore(hostname, containerId, role,
                         password);
 }
 return keystore;
}
origin: apache/incubator-slider

@Override
public SecurityStore generate(String hostname, String containerId,
               AggregateConf instanceDefinition,
               MapOperations compOps, String role)
  throws SliderException, IOException {
 SecurityStore keystore = null;
 String password = getStorePassword(
   instanceDefinition.getAppConf().credentials, compOps, role);
 if (password != null) {
  keystore =
    certificateMgr.generateContainerKeystore(hostname, containerId, role,
                         password);
 }
 return keystore;
}
origin: org.apache.slider/slider-core

public AggregateConfResource(AggregateConf conf, UriBuilder uriBuilder) {
 if (uriBuilder != null) {
  this.href = uriBuilder.build().toASCIIString();
  resources = ResourceFactory.createConfTreeResource(conf.getResources(),
         uriBuilder.clone().path("configurations").path("resources"));
  internal = ResourceFactory.createConfTreeResource(conf.getInternal(),
         uriBuilder.clone().path("configurations").path("internal"));
  appConf = ResourceFactory.createConfTreeResource(conf.getAppConf(),
         uriBuilder.clone().path("configurations").path("appConf"));
  initConfMap();
 } else {
  resources = null;
  internal = null;
  appConf = null;
 }
}
origin: apache/incubator-slider

public AggregateConfResource(AggregateConf conf, UriBuilder uriBuilder) {
 if (uriBuilder != null) {
  this.href = uriBuilder.build().toASCIIString();
  resources = ResourceFactory.createConfTreeResource(conf.getResources(),
         uriBuilder.clone().path("configurations").path("resources"));
  internal = ResourceFactory.createConfTreeResource(conf.getInternal(),
         uriBuilder.clone().path("configurations").path("internal"));
  appConf = ResourceFactory.createConfTreeResource(conf.getAppConf(),
         uriBuilder.clone().path("configurations").path("appConf"));
  initConfMap();
 } else {
  resources = null;
  internal = null;
  appConf = null;
 }
}
origin: org.apache.slider/slider-core

 @Override
 public ConfTree refresh() throws Exception {
  AggregateConf aggregateConf =
    unresolved ?
    state.getUnresolvedInstanceDefinition():
    state.getInstanceDefinitionSnapshot();
  ConfTree ct = resources ? aggregateConf.getResources() 
              : aggregateConf.getAppConf();
  return new ConfTreeSerDeser().fromInstance(ct);
 }
}
origin: org.apache.slider/slider-core

private void saveConf(AggregateConf conf) throws IOException {
 confTreeSerDeser.save(fileSystem, internal, conf.getInternal(), true);
 confTreeSerDeser.save(fileSystem, resources, conf.getResources(), true);
 confTreeSerDeser.save(fileSystem, app_conf, conf.getAppConf(), true);
}
origin: apache/incubator-slider

private void saveConf(AggregateConf conf) throws IOException {
 confTreeSerDeser.save(fileSystem, internal, conf.getInternal(), true);
 confTreeSerDeser.save(fileSystem, resources, conf.getResources(), true);
 confTreeSerDeser.save(fileSystem, app_conf, conf.getAppConf(), true);
}
origin: apache/incubator-slider

 @Override
 public ConfTree refresh() throws Exception {
  AggregateConf aggregateConf =
    unresolved ?
    state.getUnresolvedInstanceDefinition():
    state.getInstanceDefinitionSnapshot();
  ConfTree ct = resources ? aggregateConf.getResources() 
              : aggregateConf.getAppConf();
  return new ConfTreeSerDeser().fromInstance(ct);
 }
}
origin: org.apache.slider/slider-core

@Test
public void testContainerKeystoreGenerationViaStoresGeneratorOverrideGlobalSetting() throws Exception {
 AggregateConf instanceDefinition = new AggregateConf();
 MapOperations compOps = setupComponentOptions(true, null,
                        "app1.component1.password.property",
                        null, null);
 instanceDefinition.getAppConf().components.put("component1", compOps);
 instanceDefinition.getAppConf().global.put(
   "app1.component1.password.property", "password");
 instanceDefinition.getAppConf().global.put(SliderKeys.COMP_STORES_REQUIRED_KEY, "false");
 instanceDefinition.resolve();
 SecurityStore[]
   files = StoresGenerator.generateSecurityStores("testhost",
                           "container1",
                           "component1",
                           instanceDefinition,
                           compOps);
 assertEquals("wrong number of stores", 1, files.length);
 validateKeystore(files[0].getFile(), "testhost", "cahost");
}
origin: apache/incubator-slider

@Test
public void testContainerKeystoreGenerationViaStoresGeneratorOverrideGlobalSetting() throws Exception {
 AggregateConf instanceDefinition = new AggregateConf();
 MapOperations compOps = setupComponentOptions(true, null,
                        "app1.component1.password.property",
                        null, null);
 instanceDefinition.getAppConf().components.put("component1", compOps);
 instanceDefinition.getAppConf().global.put(
   "app1.component1.password.property", "password");
 instanceDefinition.getAppConf().global.put(SliderKeys.COMP_STORES_REQUIRED_KEY, "false");
 instanceDefinition.resolve();
 SecurityStore[]
   files = StoresGenerator.generateSecurityStores("testhost",
                           "container1",
                           "component1",
                           instanceDefinition,
                           compOps);
 assertEquals("wrong number of stores", 1, files.length);
 validateKeystore(files[0].getFile(), "testhost", "cahost");
}
origin: org.apache.slider/slider-core

/**
 * Take a snapshot of the configuration
 * @param instanceDefinition source
 * @throws IOException marshalling/copying problems
 */
public AggregateConf(AggregateConf instanceDefinition) throws IOException {
 ConfTreeOperations resourcesSnapshot =
   ConfTreeOperations.fromInstance(instanceDefinition.getResources());
 ConfTreeOperations appConfSnapshot =
   ConfTreeOperations.fromInstance(instanceDefinition.getAppConf());
 ConfTreeOperations internalsSnapshot =
   ConfTreeOperations.fromInstance(instanceDefinition.getInternal());
 //build a new aggregate from the snapshots
 setResources(resourcesSnapshot.confTree);
 setAppConf(appConfSnapshot.confTree);
 setInternal(internalsSnapshot.confTree);
}

origin: apache/incubator-slider

/**
 * Take a snapshot of the configuration
 * @param instanceDefinition source
 * @throws IOException marshalling/copying problems
 */
public AggregateConf(AggregateConf instanceDefinition) throws IOException {
 ConfTreeOperations resourcesSnapshot =
   ConfTreeOperations.fromInstance(instanceDefinition.getResources());
 ConfTreeOperations appConfSnapshot =
   ConfTreeOperations.fromInstance(instanceDefinition.getAppConf());
 ConfTreeOperations internalsSnapshot =
   ConfTreeOperations.fromInstance(instanceDefinition.getInternal());
 //build a new aggregate from the snapshots
 setResources(resourcesSnapshot.confTree);
 setAppConf(appConfSnapshot.confTree);
 setInternal(internalsSnapshot.confTree);
}

origin: org.apache.slider/slider-core

@Test
public void testContainerKeystoreGenerationViaStoresGenerator() throws Exception {
 AggregateConf instanceDefinition = new AggregateConf();
 MapOperations compOps = new MapOperations();
 instanceDefinition.getAppConf().components.put("component1", compOps);
 compOps.put(SliderKeys.COMP_KEYSTORE_PASSWORD_PROPERTY_KEY,
       "app1.component1.password.property");
 compOps.put(SliderKeys.COMP_STORES_REQUIRED_KEY, "true");
 instanceDefinition.getAppConf().global.put(
   "app1.component1.password.property", "password");
 instanceDefinition.resolve();
 SecurityStore[]
   files = StoresGenerator.generateSecurityStores("testhost",
                           "container1",
                           "component1",
                           instanceDefinition,
                           compOps);
 assertEquals("wrong number of stores", 1, files.length);
 validateKeystore(files[0].getFile(), "testhost", "cahost");
}
origin: apache/incubator-slider

@Test
public void testContainerKeystoreGenerationViaStoresGenerator() throws Exception {
 AggregateConf instanceDefinition = new AggregateConf();
 MapOperations compOps = new MapOperations();
 instanceDefinition.getAppConf().components.put("component1", compOps);
 compOps.put(SliderKeys.COMP_KEYSTORE_PASSWORD_PROPERTY_KEY,
       "app1.component1.password.property");
 compOps.put(SliderKeys.COMP_STORES_REQUIRED_KEY, "true");
 instanceDefinition.getAppConf().global.put(
   "app1.component1.password.property", "password");
 instanceDefinition.resolve();
 SecurityStore[]
   files = StoresGenerator.generateSecurityStores("testhost",
                           "container1",
                           "component1",
                           instanceDefinition,
                           compOps);
 assertEquals("wrong number of stores", 1, files.length);
 validateKeystore(files[0].getFile(), "testhost", "cahost");
}
origin: apache/incubator-slider

@Test
public void testContainerKeystoreGenerationViaStoresGeneratorUsingGlobalProps() throws Exception {
 AggregateConf instanceDefinition = new AggregateConf();
 MapOperations compOps = new MapOperations();
 instanceDefinition.getAppConf().components.put("component1", compOps);
 compOps.put(SliderKeys.COMP_KEYSTORE_PASSWORD_PROPERTY_KEY,
       "app1.component1.password.property");
 instanceDefinition.getAppConf().global.put(SliderKeys.COMP_STORES_REQUIRED_KEY, "true");
 compOps.put(
   "app1.component1.password.property", "password");
 instanceDefinition.resolve();
 SecurityStore[]
   files = StoresGenerator.generateSecurityStores("testhost",
                           "container1",
                           "component1",
                           instanceDefinition,
                           compOps);
 assertEquals("wrong number of stores", 1, files.length);
 validateKeystore(files[0].getFile(), "testhost", "cahost");
}
origin: org.apache.slider/slider-core

@Test
public void testContainerKeystoreGenerationViaStoresGeneratorUsingGlobalProps() throws Exception {
 AggregateConf instanceDefinition = new AggregateConf();
 MapOperations compOps = new MapOperations();
 instanceDefinition.getAppConf().components.put("component1", compOps);
 compOps.put(SliderKeys.COMP_KEYSTORE_PASSWORD_PROPERTY_KEY,
       "app1.component1.password.property");
 instanceDefinition.getAppConf().global.put(SliderKeys.COMP_STORES_REQUIRED_KEY, "true");
 compOps.put(
   "app1.component1.password.property", "password");
 instanceDefinition.resolve();
 SecurityStore[]
   files = StoresGenerator.generateSecurityStores("testhost",
                           "container1",
                           "component1",
                           instanceDefinition,
                           compOps);
 assertEquals("wrong number of stores", 1, files.length);
 validateKeystore(files[0].getFile(), "testhost", "cahost");
}
org.apache.slider.core.confAggregateConfgetAppConf

Popular methods of AggregateConf

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

Popular in Java

  • Reading from database using SQL prepared statement
  • setScale (BigDecimal)
  • getSupportFragmentManager (FragmentActivity)
  • getSystemService (Context)
  • Socket (java.net)
    Provides a client-side TCP socket.
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JComboBox (javax.swing)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • CodeWhisperer alternatives
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