Package co.cask.cdap.data2.dataset2.lib.hbase

Examples of co.cask.cdap.data2.dataset2.lib.hbase.AbstractHBaseDataSetAdmin


  @Override
  public KafkaConsumerMetaTable createKafkaConsumerMeta(String namespace) {
    try {
      String tableName = namespace.toLowerCase() + "." + cConf.get(MetricsConstants.ConfigKeys.KAFKA_META_TABLE,
                                                     MetricsConstants.DEFAULT_KAFKA_META_TABLE);
      MetricsTable table = getOrCreateMetricsTable(tableName, DatasetProperties.EMPTY);
      LOG.info("KafkaConsumerMetaTable created: {}", tableName);
      return new KafkaConsumerMetaTable(table);
    } catch (Exception e) {
      LOG.error("Exception in creating KafkaConsumerMetaTable.", e);
      throw Throwables.propagate(e);
View Full Code Here


* Registers HBase-backed implementations of the metrics system datasets
*/
public class HBaseMetricsTableModule implements DatasetModule {
  @Override
  public void register(DatasetDefinitionRegistry registry) {
    registry.add(new HBaseMetricsTableDefinition(HBaseMetricsTable.class.getName()));
    registry.add(new HBaseMetricsTableDefinition(MetricsTable.class.getName()));
  }
View Full Code Here

* Registers HBase-backed implementations of the basic datasets
*/
public class HBaseOrderedTableModule implements DatasetModule {
  @Override
  public void register(DatasetDefinitionRegistry registry) {
    registry.add(new HBaseOrderedTableDefinition("orderedTable"));
    // so that it can be resolved via @Dataset
    registry.add(new HBaseOrderedTableDefinition(OrderedTable.class.getName()));
  }
View Full Code Here

* Registers in-memory implementations of the metrics system datasets
*/
public class InMemoryMetricsTableModule implements DatasetModule {
  @Override
  public void register(DatasetDefinitionRegistry registry) {
    registry.add(new InMemoryMetricsTableDefinition(InMemoryMetricsTable.class.getName()));
    registry.add(new InMemoryMetricsTableDefinition(MetricsTable.class.getName()));
  }
View Full Code Here

* Registers in-memory implementations of the basic datasets
*/
public class InMemoryOrderedTableModule implements DatasetModule {
  @Override
  public void register(DatasetDefinitionRegistry registry) {
    registry.add(new InMemoryOrderedTableDefinition("orderedTable"));
    // so that it can be resolved via @Dataset
    registry.add(new InMemoryOrderedTableDefinition(OrderedTable.class.getName()));
  }
View Full Code Here

    registry.add(new CounterTimeseriesTableDefinition("counterTimeseriesTable", tableDef));
    registry.add(new CounterTimeseriesTableDefinition(CounterTimeseriesTable.class.getName(), tableDef));

    // in-memory table
    InMemoryOrderedTableDefinition inMemoryOrderedTable = new InMemoryOrderedTableDefinition("inMemoryOrderedTable");
    registry.add(new TableDefinition(MemoryTable.class.getName(), inMemoryOrderedTable));
    registry.add(new TableDefinition("memoryTable", inMemoryOrderedTable));
  }
View Full Code Here

    public byte[] get(byte[] key) {
      return getTable().get(createKey(key));
    }

    private static byte[] createKey(byte[] rowKey) {
      return new KeyValue(rowKey, DATA_COLFAM, DEFAULT_COLUMN, 1, KeyValue.Type.Put).getKey();
    }
View Full Code Here

* Registers LevelDB-based implementations of the metrics system datasets
*/
public class LevelDBMetricsTableModule implements DatasetModule {
  @Override
  public void register(DatasetDefinitionRegistry registry) {
    registry.add(new LevelDBMetricsTableDefinition(LevelDBMetricsTable.class.getName()));
    registry.add(new LevelDBMetricsTableDefinition(MetricsTable.class.getName()));
  }
View Full Code Here

  @Override
  public QueueConsumer createConsumer(QueueName queueName, ConsumerConfig consumerConfig, int numGroups)
    throws IOException {
    LevelDBQueueAdmin admin = ensureTableExists(queueName);
    LevelDBOrderedTableCore core = new LevelDBOrderedTableCore(admin.getActualTableName(queueName), service);
    // only the first consumer of each group runs eviction; and only if the number of consumers is known (> 0).
    QueueEvictor evictor = (numGroups <= 0 || consumerConfig.getInstanceId() != 0) ? QueueEvictor.NOOP :
      new LevelDBQueueEvictor(core, queueName, numGroups, evictionExecutor);
    return new LevelDBQueueConsumer(core, getQueueLock(queueName.toString()), consumerConfig, queueName, evictor);
  }
View Full Code Here

  @Override
  public QueueProducer createProducer(QueueName queueName, QueueMetrics queueMetrics) throws IOException {
    LevelDBQueueAdmin admin = ensureTableExists(queueName);
    return new LevelDBQueueProducer(
      new LevelDBOrderedTableCore(admin.getActualTableName(queueName), service), queueName, queueMetrics);
  }
View Full Code Here

TOP

Related Classes of co.cask.cdap.data2.dataset2.lib.hbase.AbstractHBaseDataSetAdmin

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.