Package co.cask.cdap.data2.transaction.queue.hbase

Examples of co.cask.cdap.data2.transaction.queue.hbase.HBaseQueueAdmin


  @Inject
  public MDSStreamMetaStore(CConfiguration conf, final TransactionSystemClient txClient, DatasetFramework framework) {

    final DatasetFramework dsFramework =
      new NamespacedDatasetFramework(framework, new DefaultDatasetNamespace(conf, Namespace.SYSTEM));

    txnl = Transactional.of(
        new TransactionExecutorFactory() {
          @Override
          public TransactionExecutor createExecutor(Iterable<TransactionAware> transactionAwares) {
View Full Code Here


  public MDSDatasetsRegistry(TransactionSystemClient txClient,
                             @Named("datasetMDS") DatasetFramework framework,
                             CConfiguration conf) {
    super(txClient);
    this.dsFramework =
      new NamespacedDatasetFramework(framework, new DefaultDatasetNamespace(conf, Namespace.SYSTEM));
  }
View Full Code Here

                              QueueConstants.QueueType type) {
    this.service = service;
    // todo: we have to do that because queues do not follow dataset semantic fully (yet)
    String unqualifiedTableNamePrefix =
      type == QUEUE ? QueueConstants.QUEUE_TABLE_PREFIX : QueueConstants.STREAM_TABLE_PREFIX;
    this.tableNamePrefix = new DefaultDatasetNamespace(conf, Namespace.SYSTEM).namespace(unqualifiedTableNamePrefix);
  }
View Full Code Here

                                              QueueClientFactory queueClientFactory, StreamAdmin oldStreamAdmin) {
    this.cConf = cConf;
    this.streamAdmin = streamAdmin;
    this.stateStoreFactory = stateStoreFactory;
    this.tablePrefix =
      new DefaultDatasetNamespace(cConf, Namespace.SYSTEM).namespace(QueueConstants.STREAM_TABLE_PREFIX);
    this.queueClientFactory = queueClientFactory;
    this.oldStreamAdmin = oldStreamAdmin;
  }
View Full Code Here

  private LevelDBOrderedTableCore coreTable;

  @Inject
  LevelDBStreamConsumerStateStoreFactory(CConfiguration conf, LevelDBOrderedTableService tableService) {
    this.tableService = tableService;
    this.tableName = new DefaultDatasetNamespace(conf, Namespace.SYSTEM)
      .namespace(QueueConstants.STREAM_TABLE_PREFIX + ".state.store");

  }
View Full Code Here

  @Inject
  public DatasetServiceStore(CConfiguration cConf, DatasetDefinitionRegistryFactory dsRegistryFactory,
                             @Named("serviceModule") DatasetModule datasetModule) throws Exception {
    DatasetFramework dsFramework =
      new NamespacedDatasetFramework(new InMemoryDatasetFramework(dsRegistryFactory),
                                     new DefaultDatasetNamespace(cConf, Namespace.SYSTEM));
    dsFramework.addModule("basicKVTable", datasetModule);
    table = DatasetsUtil.getOrCreateDataset(dsFramework, Constants.Service.SERVICE_INSTANCE_TABLE_NAME,
                                            NoTxKeyValueTable.class.getName(),
                                            DatasetProperties.EMPTY, null, null);
  }
View Full Code Here

                                    final DatasetFramework dsFramework) {
    try {
      this.cConf = cConf;
      this.dsFramework =
        new NamespacedDatasetFramework(dsFramework,
                                       new DefaultDatasetNamespace(cConf, Namespace.SYSTEM));

      this.entityCodecs = CacheBuilder.newBuilder().build(new CacheLoader<String, MetricsEntityCodec>() {
        @Override
        public MetricsEntityCodec load(String namespace) throws Exception {
          String tableName = namespace.toLowerCase() + "." + cConf.get(MetricsConstants.ConfigKeys.ENTITY_TABLE_NAME,
View Full Code Here

      new NamespacedDatasetFramework(framework, new DefaultDatasetNamespace(conf, Namespace.SYSTEM));
  }

  @Override
  public void startUp() throws Exception {
    this.util = new DatasetMetaTableUtil(dsFramework);
    this.util.init();
  }
View Full Code Here

    LOG.info("Creating dataset instance {}, type meta: {}, props: {}", name, typeMetaHeader, propsHeader);

    DatasetProperties props = GSON.fromJson(propsHeader, DatasetProperties.class);
    DatasetTypeMeta typeMeta = GSON.fromJson(typeMetaHeader, DatasetTypeMeta.class);

    DatasetType type = dsFramework.getDatasetType(typeMeta, null);

    if (type == null) {
      String msg = String.format("Cannot instantiate dataset type using provided type meta: %s", typeMeta);
      LOG.error(msg);
      responder.sendError(HttpResponseStatus.BAD_REQUEST, msg);
      return;
    }

    DatasetSpecification spec = type.configure(name, props);
    DatasetAdmin admin = type.getAdmin(spec);
    admin.create();
    responder.sendJson(HttpResponseStatus.OK, spec);
  }
View Full Code Here

    LOG.info("Dropping dataset with spec: {}, type meta: {}", specHeader, typeMetaHeader);

    DatasetSpecification spec = GSON.fromJson(specHeader, DatasetSpecification.class);
    DatasetTypeMeta typeMeta = GSON.fromJson(typeMetaHeader, DatasetTypeMeta.class);

    DatasetType type = dsFramework.getDatasetType(typeMeta, null);

    if (type == null) {
      String msg = String.format("Cannot instantiate dataset type using provided type meta: %s", typeMeta);
      LOG.error(msg);
      responder.sendError(HttpResponseStatus.BAD_REQUEST, msg);
      return;
    }

    DatasetAdmin admin = type.getAdmin(spec);
    admin.drop();
    responder.sendJson(HttpResponseStatus.OK, spec);
  }
View Full Code Here

TOP

Related Classes of co.cask.cdap.data2.transaction.queue.hbase.HBaseQueueAdmin

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.