Codota Logo
AggregateConf.getAppConf
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
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 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: 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: 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

  • Finding current android device location
  • startActivity (Activity)
  • findViewById (Activity)
  • orElseThrow (Optional)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • TreeSet (java.util)
    A NavigableSet implementation based on a TreeMap. The elements are ordered using their Comparable, o
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • JButton (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now