Class RouteLayer.RouteLayerBuilder

java.lang.Object
org.apache.opendal.NativeObject
org.apache.opendal.layer.RouteLayer.RouteLayerBuilder
All Implemented Interfaces:
AutoCloseable
Enclosing class:
RouteLayer

public static final class RouteLayer.RouteLayerBuilder extends NativeObject
Collects ordered routes and builds one layer.
  • Method Details

    • route

      public RouteLayer.RouteLayerBuilder route(String pattern, AsyncOperator target)
      Adds a route for paths matching the given glob. The target can be closed after this method returns.
      Parameters:
      pattern - the glob to match against paths relative to the operator root
      target - the operator to use for matching paths
      Returns:
      this builder
      Throws:
      NullPointerException - if the pattern or target is null
      IllegalStateException - if the builder or target is closed
    • build

      public RouteLayer build()
      Compiles the route patterns and closes this builder, including when compilation fails.
      Returns:
      the route layer
      Throws:
      OpenDALException - with code ConfigInvalid if a glob pattern is invalid
      IllegalStateException - if the builder is closed
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Overrides:
      close in class NativeObject
    • disposeInternal

      protected void disposeInternal(long handle)
      Description copied from class: NativeObject
      Deletes underlying native object pointer.
      Specified by:
      disposeInternal in class NativeObject
      Parameters:
      handle - to the native object pointer