Delete a Layer

To delete a layer, use the deleteLayer method of AdminApi provided by the data-client module. You have to pass the catalog's HRN to which a layer belongs and the layer ID:

val layerId = "layer-3"
adminApi.deleteLayer(catalogHrn, layerId).flatMap { _ =>"deleted $layerId from $catalogHrn")
String layerId = "layer-2";
CompletionStage<CompletionStage<HRN>> layerDeletionStage =
        .deleteLayer(catalogHrn, layerId)
            done -> {
    "deleted `" + layerId + "` from catalog`" + catalogHrn + "`");
              CompletableFuture<HRN> retval = new CompletableFuture<HRN>();
              return retval;

Warning: Data Loss

Once a layer is deleted, all the associated data and metadata is also deleted. There is no mechanism to undo the operation. Therefore, this should be done with caution.

You can delete volatile, stream and index layers.

Note: Deletion of Versioned Layers

You cannot delete versioned layers. If you try to delete a versioned layer, a DataClientException will be thrown.

results matching ""

    No results matching ""