Package co.cask.cdap.data2.dataset2

Examples of co.cask.cdap.data2.dataset2.NamespacedDatasetFramework


    datasetFramework.addInstance(DatasetInstanceMDS.class.getName(),
                                 DatasetMetaTableUtil.INSTANCE_TABLE_NAME, DatasetProperties.EMPTY);
  }

  private static void addTypes(DatasetFramework framework) throws DatasetManagementException {
    framework.addModule("typeMDSModule", new SingleTypeModule(DatasetTypeMDS.class));
    framework.addModule("instanceMDSModule", new SingleTypeModule(DatasetInstanceMDS.class));
  }
View Full Code Here


    public void add(DatasetDefinition def) {
      String typeName = def.getName();
      if (datasets.getTypeMDS().getType(typeName) != null) {
        String msg = "Cannot add dataset type: it already exists: " + typeName;
        LOG.error(msg);
        throw new TypeConflictException(msg);
      }
      types.add(typeName);
      registry.add(def);
    }
View Full Code Here

      if (namespace.fromNamespaced(tableName) != null) {
        System.out.println(String.format("Upgrading hbase table: %s, desc: %s", tableName, desc.toString()));

        final boolean supportsIncrement =
          "true".equalsIgnoreCase(desc.getValue(OrderedTable.PROPERTY_READLESS_INCREMENT));
        DatasetAdmin admin = new AbstractHBaseDataSetAdmin(tableName, hConf, hBaseTableUtil) {
          @Override
          protected CoprocessorJar createCoprocessorJar() throws IOException {
            return HBaseOrderedTableAdmin.createCoprocessorJarInternal(cConf,
                                                                       injector.getInstance(LocationFactory.class),
                                                                       hBaseTableUtil,
                                                                       supportsIncrement);
          }

          @Override
          protected boolean upgradeTable(HTableDescriptor tableDescriptor) {
            // we don't do any other changes apart from coprocessors upgrade
            return false;
          }

          @Override
          public void create() throws IOException {
            // no-op
            throw new UnsupportedOperationException("This DatasetAdmin is only used for upgrade() operation");
          }
        };
        admin.upgrade();
        System.out.println(String.format("Upgraded hbase table: %s", tableName));
      }
    }
  }
View Full Code Here

  @Override
  public void upgrade(String name, Properties properties) throws Exception {
    QueueName queueName = QueueName.from(URI.create(name));
    String hBaseTableName = getActualTableName(queueName);
    AbstractHBaseDataSetAdmin dsAdmin = new DatasetAdmin(hBaseTableName, hConf, tableUtil);
    try {
      dsAdmin.upgrade();
    } finally {
      dsAdmin.close();
    }
  }
View Full Code Here

    // Create the config table first so that in case the queue table coprocessor runs, it can access the config table.
    createConfigTable();

    String hBaseTableName = getActualTableName(queueName);
    AbstractHBaseDataSetAdmin dsAdmin = new DatasetAdmin(hBaseTableName, hConf, tableUtil);
    try {
      dsAdmin.create();
    } finally {
      dsAdmin.close();
    }
  }
View Full Code Here

        // NOTE: order is important due to dependencies between modules
        Map<String, DatasetModule> defaultModules = Maps.newLinkedHashMap();
        defaultModules.put("orderedTable-memory", new InMemoryOrderedTableModule());
        defaultModules.put("metricsTable-memory", new InMemoryMetricsTableModule());
        defaultModules.put("core", new CoreDatasetsModule());
        defaultModules.put("aclTable", new ACLTableModule());

        bind(new TypeLiteral<Map<String, ? extends DatasetModule>>() { })
          .annotatedWith(Names.named("defaultDatasetModules")).toInstance(defaultModules);

        install(new FactoryModuleBuilder()
View Full Code Here

        // NOTE: order is important due to dependencies between modules
        Map<String, DatasetModule> defaultModules = Maps.newLinkedHashMap();
        defaultModules.put("orderedTable-leveldb", new LevelDBOrderedTableModule());
        defaultModules.put("metricsTable-leveldb", new LevelDBMetricsTableModule());
        defaultModules.put("core", new CoreDatasetsModule());
        defaultModules.put("aclTable", new ACLTableModule());

        bind(new TypeLiteral<Map<String, ? extends DatasetModule>>() { })
          .annotatedWith(Names.named("defaultDatasetModules")).toInstance(defaultModules);

        install(new FactoryModuleBuilder()
View Full Code Here

        // NOTE: order is important due to dependencies between modules
        Map<String, DatasetModule> defaultModules = Maps.newLinkedHashMap();
        defaultModules.put("orderedTable-hbase", new HBaseOrderedTableModule());
        defaultModules.put("metricsTable-hbase", new HBaseMetricsTableModule());
        defaultModules.put("core", new CoreDatasetsModule());
        defaultModules.put("aclTable", new ACLTableModule());

        bind(new TypeLiteral<Map<String, ? extends DatasetModule>>() { })
          .annotatedWith(Names.named("defaultDatasetModules")).toInstance(defaultModules);

        install(new FactoryModuleBuilder()
View Full Code Here

      protected void configure() {
        // NOTE: order is important due to dependencies between modules
        Map<String, DatasetModule> defaultModules = Maps.newLinkedHashMap();
        defaultModules.put("orderedTable-memory", new InMemoryOrderedTableModule());
        defaultModules.put("metricsTable-memory", new InMemoryMetricsTableModule());
        defaultModules.put("core", new CoreDatasetsModule());
        defaultModules.put("aclTable", new ACLTableModule());

        bind(new TypeLiteral<Map<String, ? extends DatasetModule>>() { })
          .annotatedWith(Names.named("defaultDatasetModules")).toInstance(defaultModules);
View Full Code Here

      protected void configure() {
        // NOTE: order is important due to dependencies between modules
        Map<String, DatasetModule> defaultModules = Maps.newLinkedHashMap();
        defaultModules.put("orderedTable-leveldb", new LevelDBOrderedTableModule());
        defaultModules.put("metricsTable-leveldb", new LevelDBMetricsTableModule());
        defaultModules.put("core", new CoreDatasetsModule());
        defaultModules.put("aclTable", new ACLTableModule());

        bind(new TypeLiteral<Map<String, ? extends DatasetModule>>() { })
          .annotatedWith(Names.named("defaultDatasetModules")).toInstance(defaultModules);
View Full Code Here

TOP

Related Classes of co.cask.cdap.data2.dataset2.NamespacedDatasetFramework

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.