Package co.cask.cdap.common.conf

Examples of co.cask.cdap.common.conf.CConfiguration


    if (data == null) {
      return CConfiguration.create();
    }

    ByteArrayInputStream bin = new ByteArrayInputStream(data);
    CConfiguration cConfiguration = CConfiguration.create();
    cConfiguration.clear();
    cConfiguration.addResource(bin);
    return cConfiguration;
  }
View Full Code Here


  private static Context createContext(Configuration conf) throws IOException {
    // Create context needs to happen only when running in as a MapReduce job.
    // In other cases, ContextManager will be initialized using saveContext method.

    CConfiguration cConf = ConfigurationUtil.get(conf, Constants.Explore.CCONF_KEY, CConfCodec.INSTANCE);
    Configuration hConf = ConfigurationUtil.get(conf, Constants.Explore.HCONF_KEY, HConfCodec.INSTANCE);

    Injector injector = Guice.createInjector(
      new ConfigModule(cConf, hConf),
      new ZKClientModule(),
View Full Code Here

        + this.threads + " threads.");
  }

  public static void main(String[] args) {
    try {
      CConfiguration configuration = CConfiguration.create();
      Configuration hConfiguration = new Configuration();

      new FlumeLogCollector(configuration, hConfiguration).start();
    } catch (Exception e) {
      LOG.error("Failed to start Log Collection Source: " + e.getMessage(), e);
View Full Code Here

  private static void setProgramJarName(String programJarName) {
    hConf.set(HCONF_ATTR_PROGRAM_JAR_NAME, programJarName);
  }

  public CConfiguration getConf() {
    CConfiguration conf = CConfiguration.create();
    conf.addResource(new ByteArrayInputStream(hConf.get(HCONF_ATTR_CCONF).getBytes()));
    return conf;
  }
View Full Code Here

    }
    jobContext.getConfiguration().set(HCONF_ATTR_CCONF, stringWriter.toString());
  }

  public CConfiguration getConf() {
    CConfiguration conf = CConfiguration.create();
    conf.addResource(new ByteArrayInputStream(jobContext.getConfiguration().get(HCONF_ATTR_CCONF).getBytes()));
    return conf;
  }
View Full Code Here

   * @throws IOException If an error occurs while attempting to read the table or the table does not exist.
   */
  public CConfiguration read(Type type, String namespace) throws IOException {
    String tableName = getTableName(namespace);

    CConfiguration conf = null;
    HTable table = null;
    try {
      table = new HTable(hbaseConf, tableName);
      Get get = new Get(Bytes.toBytes(type.name()));
      get.addFamily(FAMILY);
      Result result = table.get(get);
      int propertyCnt = 0;
      if (result != null && !result.isEmpty()) {
        conf = CConfiguration.create();
        conf.clear();
        Map<byte[], byte[]> kvs = result.getFamilyMap(FAMILY);
        for (Map.Entry<byte[], byte[]> e : kvs.entrySet()) {
          conf.set(Bytes.toString(e.getKey()), Bytes.toString(e.getValue()));
          propertyCnt++;
        }
      }
      LOG.info("Read " + propertyCnt + " properties from configuration table = " +
                 tableName + ", row = " + type.name());
View Full Code Here

      System.out.println(String.format("Usage: java %s [streamName]", StreamTailer.class.getName()));
      return;
    }
    String streamName = args[0];

    CConfiguration cConf = CConfiguration.create();
    Configuration hConf = new Configuration();

    Injector injector = Guice.createInjector(new ConfigModule(cConf, hConf),
                                             new DataFabricModules().getDistributedModules(),
                                             new DataSetsModules().getDistributedModule(),
View Full Code Here

    }
  }

  public static void main(String[] args) {
    // create a config and load the gateway properties
    CConfiguration cConf = CConfiguration.create();
    Configuration hConf = new Configuration();
    cConf.copyTxProperties(hConf);

    TransactionManagerDebuggerMain instance = new TransactionManagerDebuggerMain(hConf);
    boolean success = instance.execute(args);
    if (!success) {
      System.exit(1);
View Full Code Here

  @Override
  protected void doInit(TwillContext context) {
    this.user = DEFAULT_USER;

    CConfiguration cConf = getCConfiguration();
    Configuration hConf = getConfiguration();

    // Set the host name to the one provided by Twill
    cConf.set(Constants.Dataset.Executor.ADDRESS, context.getHost().getHostName());

    injector = Guice.createInjector(
      new ConfigModule(cConf, hConf),
      new IOModule(), new ZKClientModule(),
      new KafkaClientModule(),
View Full Code Here

      printHelp(true);
      return;
    }

    try {
      CConfiguration cConf = CConfiguration.create();
      Configuration hConf = HBaseConfiguration.create();

      Injector injector = Guice.createInjector(
        new ConfigModule(cConf, hConf),
        new LocationRuntimeModule().getDistributedModules(),
View Full Code Here

TOP

Related Classes of co.cask.cdap.common.conf.CConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.