Creates a snapshot from an existing table.  NOTE: Cloud Bigtable has a cleanup policy

@param snapshotName a {@link String} object.
@param tableName a {@link TableName} object.
@throws IOException if any.
434478
@Override
  public void snapshot(String snapshotName, TableName tableName)
      throws IOException, SnapshotCreationException, IllegalArgumentException {

    Operation operation = snapshotTable(snapshotName, tableName);
    try {
      connection.getSession().getInstanceAdminClient().waitForOperation(operation);
    } catch (TimeoutException e) {
      throw new IOException("Timed out waiting for snapshot creation to finish", e);
    }
  }
1292614
@Override
	public void createTable(ObjectPath tablePath, CatalogBaseTable table, boolean ignoreIfExists)
		throws TableAlreadyExistException, DatabaseNotExistException {
		checkNotNull(tablePath);
		checkNotNull(table);

		if (!databaseExists(tablePath.getDatabaseName())) {
			throw new DatabaseNotExistException(catalogName, tablePath.getDatabaseName());
		}

		if (tableExists(tablePath)) {
			if (!ignoreIfExists) {
				throw new TableAlreadyExistException(catalogName, tablePath);
			}
		} else {
			tables.put(tablePath, table.copy());

			if ((table instanceof CatalogTable) && ((CatalogTable) table).isPartitioned()) {
				partitions.put(tablePath, new LinkedHashMap<>());
			}
		}
	}
1286189
@Deprecated
  public static BigtableTableAdminClient create(
      @Nonnull com.google.bigtable.admin.v2.InstanceName instanceName) throws IOException {
    return create(instanceName.getProject(), instanceName.getInstance());
  }
1164138
private TableName snapshotExists(String snapshotName,
      List<SnapshotDescription> snapshotDescriptions) {
    if (snapshotDescriptions != null) {
      Optional<SnapshotDescription> descriptor =
          snapshotDescriptions.stream()
              .filter(desc -> desc.getName().equals(snapshotName))
              .findFirst();
      return descriptor.isPresent() ? descriptor.get().getTableName() : null;
    }
    return null;
  }
623625
@Override
    @Transactional
    public void deleteSnapshot(String snapshotId) {
        //delete the snapshot
        snapshotContentItemRepo.deleteBySnapshotName(snapshotId);
        snapshotRepo.deleteByName(snapshotId);
        log.info("successfully deleted snapshot: {}", snapshotId);
    }
1270805
public void deleteRow(Object rowKey, String tableName, String columnFamilyName) throws IOException
    {
        hbaseWriter.delete(gethTable(tableName), rowKey, columnFamilyName);
    }
1022613
public static void createTables( Connection connection ) throws IOException, SQLException {
        StringBuilder sB = new StringBuilder();
        sB.append("CREATE TABLE ");
        sB.append(TABLE_IMAGES);
        sB.append(" (");
        sB.append(ImageTableFields.COLUMN_ID.getFieldName());
        sB.append(" INTEGER PRIMARY KEY, ");
        sB.append(ImageTableFields.COLUMN_LON.getFieldName()).append(" REAL NOT NULL, ");
        sB.append(ImageTableFields.COLUMN_LAT.getFieldName()).append(" REAL NOT NULL,");
        sB.append(ImageTableFields.COLUMN_ALTIM.getFieldName()).append(" REAL NOT NULL,");
        sB.append(ImageTableFields.COLUMN_AZIM.getFieldName()).append(" REAL NOT NULL,");
        sB.append(ImageTableFields.COLUMN_IMAGEDATA_ID.getFieldName());
        sB.append(" INTEGER NOT NULL ");
        sB.append("CONSTRAINT " + ImageTableFields.COLUMN_IMAGEDATA_ID.getFieldName() + " REFERENCES ");
        sB.append(TABLE_IMAGE_DATA);
        sB.append("(");
        sB.append(ImageDataTableFields.COLUMN_ID);
        sB.append(") ON DELETE CASCADE,");
        sB.append(ImageTableFields.COLUMN_TS.getFieldName()).append(" DATE NOT NULL,");
        sB.append(ImageTableFields.COLUMN_TEXT.getFieldName()).append(" TEXT NOT NULL,");
        sB.append(ImageTableFields.COLUMN_NOTE_ID.getFieldName()).append(" INTEGER,");
        sB.append(ImageTableFields.COLUMN_ISDIRTY.getFieldName()).append(" INTEGER NOT NULL");
        sB.append(");");
        String CREATE_TABLE_IMAGES = sB.toString();

        sB = new StringBuilder();
        sB.append("CREATE INDEX images_ts_idx ON ");
        sB.append(TABLE_IMAGES);
        sB.append(" ( ");
        sB.append(ImageTableFields.COLUMN_TS.getFieldName());
        sB.append(" );");
        String CREATE_INDEX_IMAGES_TS = sB.toString();

        sB = new StringBuilder();
        sB.append("CREATE INDEX images_x_by_y_idx ON ");
        sB.append(TABLE_IMAGES);
        sB.append(" ( ");
        sB.append(ImageTableFields.COLUMN_LON.getFieldName());
        sB.append(", ");
        sB.append(ImageTableFields.COLUMN_LAT.getFieldName());
        sB.append(" );");
        String CREATE_INDEX_IMAGES_X_BY_Y = sB.toString();

        sB = new StringBuilder();
        sB.append("CREATE INDEX images_noteid_idx ON ");
        sB.append(TABLE_IMAGES);
        sB.append(" ( ");
        sB.append(ImageTableFields.COLUMN_NOTE_ID.getFieldName());
        sB.append(" );");
        String CREATE_INDEX_IMAGES_NOTEID = sB.toString();

        sB = new StringBuilder();
        sB.append("CREATE INDEX images_isdirty_idx ON ");
        sB.append(TABLE_IMAGES);
        sB.append(" ( ");
        sB.append(ImageTableFields.COLUMN_ISDIRTY.getFieldName());
        sB.append(" );");
        String CREATE_INDEX_IMAGES_ISDIRTY = sB.toString();

        sB = new StringBuilder();
        sB.append("CREATE TABLE ");
        sB.append(TABLE_IMAGE_DATA);
        sB.append(" (");
        sB.append(ImageDataTableFields.COLUMN_ID.getFieldName());
        sB.append(" INTEGER PRIMARY KEY, ");
        sB.append(ImageDataTableFields.COLUMN_IMAGE.getFieldName()).append(" BLOB NOT NULL,");
        sB.append(ImageDataTableFields.COLUMN_THUMBNAIL.getFieldName()).append(" BLOB NOT NULL");
        sB.append(");");
        String CREATE_TABLE_IMAGEDATA = sB.toString();

        try (Statement statement = connection.createStatement()) {
            statement.setQueryTimeout(30); // set timeout to 30 sec.

            statement.executeUpdate(CREATE_TABLE_IMAGES);
            statement.executeUpdate(CREATE_INDEX_IMAGES_TS);
            statement.executeUpdate(CREATE_INDEX_IMAGES_X_BY_Y);
            statement.executeUpdate(CREATE_INDEX_IMAGES_NOTEID);
            statement.executeUpdate(CREATE_INDEX_IMAGES_ISDIRTY);
            statement.executeUpdate(CREATE_TABLE_IMAGEDATA);
        } catch (Exception e) {
            throw new IOException(e.getLocalizedMessage());
        }
    }
1102854
public BulkMutation createBulkMutation(BigtableTableName tableName) {
    if (options.useGCJClient()) {
      LOG.warn("Using cloud-bigtable-client's implementation of BulkMutation.");
    }
    return new BulkMutation(
        tableName,
        throttlingDataClient,
        BigtableSessionSharedThreadPools.getInstance().getRetryExecutor(),
        options.getBulkOptions());
  }
284827
public CompletableFuture<Void> removeEntry(String tableName, String key) {
        log.trace("remove entry called for : {} key : {}", tableName, key);

        List<TableKey<byte[]>> keys = Collections.singletonList(new TableKeyImpl<>(key.getBytes(Charsets.UTF_8), null));
        return expectingDataNotFound(withRetries(() -> segmentHelper.removeTableKeys(
                tableName, keys, authToken.get(), RequestTag.NON_EXISTENT_ID), 
                () -> String.format("remove entry: key: %s table: %s", key, tableName)), null)
                .thenAcceptAsync(v -> log.trace("entry for key {} removed from table {}", key, tableName), executor);
    }
751459
public Table createTable(String tableName, String fieldName) {
    // [START ]
    Schema schema = Schema.of(Field.of(fieldName, LegacySQLTypeName.STRING));
    StandardTableDefinition definition =
        StandardTableDefinition.newBuilder()
            .setSchema(schema)
            .setTimePartitioning(TimePartitioning.of(TimePartitioning.Type.DAY))
            .build();
    Table table = dataset.create(tableName, definition);
    // [END ]
    return table;
  }
1139807
public static Table getTable(DatabaseMetaData metadata, String tableName) throws Exception {
        return new Table(
            tableName,
            getPrimaryKey(metadata, tableName),
            getForeignKeys(metadata, tableName),
            getExportedKeys(metadata, tableName),
            getColumns(metadata, tableName)
        );
    }
786710
public BulkRead createBulkRead(BigtableTableName tableName) {
    return new BulkRead(getDataClientWrapper(), tableName,
        options.getBulkOptions().getBulkMaxRowKeyCount(),
        BigtableSessionSharedThreadPools.getInstance().getBatchThreadPool()
    );
  }
1078461
public static <T> T run(HTablePool pool, byte[] tableName, HTableRunnable<T> runnable)
            throws IOException {
        HTableInterface hTable = null;
        try {
            hTable = pool.getTable(tableName);
            return runnable.runWith(hTable);
        } catch (Exception e) {
            if (e instanceof IOException) {
                throw (IOException) e;
            } else {
                throw new RuntimeException(e);
            }
        } finally {
            if (hTable != null) {
                pool.putTable(hTable);
            }
        }
    }
882033
public int deleteByTableName(String tableName) throws SQLException {
		DeleteBuilder<ContentsId, Long> db = deleteBuilder();
		db.where().eq(ContentsId.COLUMN_TABLE_NAME, tableName);
		PreparedDelete<ContentsId> deleteQuery = db.prepare();
		int deleted = delete(deleteQuery);
		return deleted;
	}
463444
public int deleteByTableName(String tableName) throws SQLException {
		DeleteBuilder<MetadataReference, Void> db = deleteBuilder();
		db.where().eq(MetadataReference.COLUMN_TABLE_NAME, tableName);
		PreparedDelete<MetadataReference> deleteQuery = db.prepare();
		int deleted = delete(deleteQuery);
		return deleted;
	}
438796
public int delete(String tableName) {
		DeleteBuilder<GriddedTile, Long> db = deleteBuilder();

		int deleted = 0;

		try {
			db.where().eq(GriddedTile.COLUMN_TABLE_NAME, tableName);

			PreparedDelete<GriddedTile> deleteQuery = db.prepare();
			deleted = delete(deleteQuery);
		} catch (SQLException e) {
			throw new GeoPackageException(
					"Failed to delete Gridded Tile by Table Name: " + tableName,
					e);
		}

		return deleted;
	}
754985
private void createOrUpdateTable(String tablename, HTableDescriptor hTableDescriptor)
    {
        try
        {
            if (admin.isTableAvailable(tablename))
            {
                admin.modifyTable(tablename, hTableDescriptor);
            }
            else
            {
                admin.createTable(hTableDescriptor);
            }
        }
        catch (IOException ioex)
        {
            logger.error("Either table isn't in enabled state or some network problem, Caused by: ", ioex);
            throw new SchemaGenerationException(ioex, "Either table isn't in enabled state or some network problem.");
        }
    }