Package co.cask.tigon.conf

Examples of co.cask.tigon.conf.CConfiguration


  private final ConsoleReader consoleReader;

  public DistributedMain(String zkQuorumString, String rootNamespace) throws IOException {
    localDataDir = Files.createTempDir();

    CConfiguration cConf = CConfiguration.create();
    cConf.set(Constants.Zookeeper.QUORUM, zkQuorumString);
    cConf.set(Constants.Location.ROOT_NAMESPACE, rootNamespace);
    cConf.set(Constants.CFG_LOCAL_DATA_DIR, localDataDir.getAbsolutePath());
    cConf.reloadConfiguration();
    Configuration hConf = HBaseConfiguration.create();

    Injector injector = Guice.createInjector(createModules(cConf, hConf));
    flowOperations = injector.getInstance(FlowOperations.class);
    consoleReader = new ConsoleReader();
View Full Code Here


  public StandaloneMain() {
    runLatch = new CountDownLatch(1);
    jarUnpackDir = Files.createTempDir();
    localDataDir = Files.createTempDir();
    CConfiguration cConf = CConfiguration.create();
    cConf.set(Constants.CFG_LOCAL_DATA_DIR, localDataDir.getAbsolutePath());
    Configuration hConf = new Configuration();

    Injector injector = Guice.createInjector(createModules(cConf, hConf));
    txService = injector.getInstance(TransactionManager.class);
    metricsCollectionService = injector.getInstance(MetricsCollectionService.class);
View Full Code Here

  }

  @BeforeClass
  public static void init() throws Exception {
    File localDataDir = tmpFolder.newFolder();
    CConfiguration cConf = CConfiguration.create();
    cConf.set(Constants.CFG_LOCAL_DATA_DIR, localDataDir.getAbsolutePath());

    Configuration hConf = new Configuration();

    Injector injector = Guice.createInjector(
      new DataFabricInMemoryModule(),
View Full Code Here

    this.configTable = new ConfigurationTable(conf);
  }

  @Override
  protected Configuration getSnapshotConfiguration() throws IOException {
    CConfiguration cConf = configTable.read(ConfigurationTable.Type.DEFAULT, tableNamespace);
    Configuration txConf = HBaseConfiguration.create();
    cConf.copyTxProperties(txConf);
    return txConf;
  }
View Full Code Here

   * @throws java.io.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

TOP

Related Classes of co.cask.tigon.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.