Package org.apache.hadoop.hbase

Examples of org.apache.hadoop.hbase.TableDescriptor


    if (columns ==null || columns.isEmpty()) return false;
    HTableDescriptor htd = new HTableDescriptor(tableName);
    for (String columnfamimly : columns) {
      htd.addFamily(new HColumnDescriptor(columnfamimly));
    }
    fstd.createTableDescriptor(new TableDescriptor(htd, TableState.State.ENABLED), true);
    return true;
  }
View Full Code Here


        LOG.info("Trying to fix orphan table error: " + tableName);
        if (j < htds.length) {
          if (tableName.equals(htds[j].getTableName())) {
            HTableDescriptor htd = htds[j];
            LOG.info("fixing orphan table: " + tableName + " from cache");
            fstd.createTableDescriptor(new TableDescriptor(htd, TableState.State.ENABLED), true);
            j++;
            iter.remove();
          }
        } else {
          if (fabricateTableInfo(fstd, tableName, entry.getValue())) {
View Full Code Here

    // assume, created table descriptor is for enabling table
    // meta table is a system table, so descriptors are predefined,
    // we should get them from registry.
    FSTableDescriptors fsd = new FSTableDescriptors(c, fs, rd);
    fsd.createTableDescriptor(
        new TableDescriptor(fsd.get(TableName.META_TABLE_NAME), TableState.State.ENABLING));

    return rd;
  }
View Full Code Here

   * @throws FileNotFoundException
   * @throws IOException
   */
  public TableDescriptor getTableDescriptor()
  throws FileNotFoundException, IOException {
    TableDescriptor htd =
      this.masterServices.getTableDescriptors().getDescriptor(tableName);
    if (htd == null) {
      throw new IOException("HTableDescriptor missing for " + tableName);
    }
    return htd;
View Full Code Here

    Path tempdir = fileSystemManager.getTempDir();
    FileSystem fs = fileSystemManager.getFileSystem();

    // 1. Create Table Descriptor
    // using a copy of descriptor, table will be created enabling first
    TableDescriptor underConstruction = new TableDescriptor(
        this.hTableDescriptor, TableState.State.ENABLING);
    Path tempTableDir = FSUtils.getTableDir(tempdir, tableName);
    new FSTableDescriptors(this.conf).createTableDescriptorForTableDirectory(
      tempTableDir, underConstruction, false);
    Path tableDir = FSUtils.getTableDir(fileSystemManager.getRootDir(), tableName);
View Full Code Here

  }

  @Override
  protected void prepareWithTableLock() throws IOException {
    super.prepareWithTableLock();
    TableDescriptor htd = getTableDescriptor();
    if (htd.getHTableDescriptor().hasFamily(familyDesc.getName())) {
      throw new InvalidFamilyOperationException("Family '" +
        familyDesc.getNameAsString() + "' already exists so cannot be added");
    }
  }
View Full Code Here

    FileSystem fs = mfs.getFileSystem();

    AssignmentManager assignmentManager = this.masterServices.getAssignmentManager();

    // 1. Create Table Descriptor
    TableDescriptor underConstruction = new TableDescriptor(
        this.hTableDescriptor, TableState.State.ENABLING);
    Path tempTableDir = FSUtils.getTableDir(tempdir, this.tableName);
    new FSTableDescriptors(server.getConfiguration())
      .createTableDescriptorForTableDirectory(tempTableDir, underConstruction, false);
    Path tableDir = FSUtils.getTableDir(mfs.getRootDir(), this.tableName);
View Full Code Here

    if (getSnapshotFormat(desc) == SnapshotManifestV1.DESCRIPTOR_VERSION) {
      Path rootDir = FSUtils.getRootDir(conf);
      LOG.info("Using old Snapshot Format");
      // write a copy of descriptor to the snapshot directory
      new FSTableDescriptors(conf, fs, rootDir)
        .createTableDescriptorForTableDirectory(workingDir, new TableDescriptor(
            htd, TableState.State.ENABLED), false);
    } else {
      LOG.debug("Convert to Single Snapshot Manifest");
      convertToV2SingleManifest();
    }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.TableDescriptor

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.