Class RouteLayer.RouteLayerBuilder
java.lang.Object
org.apache.opendal.NativeObject
org.apache.opendal.layer.RouteLayer.RouteLayerBuilder
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
RouteLayer
Collects ordered routes and builds one layer.
-
Field Summary
Fields inherited from class NativeObject
nativeHandle -
Method Summary
Modifier and TypeMethodDescriptionbuild()Compiles the route patterns and closes this builder, including when compilation fails.voidclose()protected voiddisposeInternal(long handle) Deletes underlying native object pointer.route(String pattern, AsyncOperator target) Adds a route for paths matching the given glob.Methods inherited from class NativeObject
isDisposed
-
Method Details
-
route
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 roottarget- the operator to use for matching paths- Returns:
- this builder
- Throws:
NullPointerException- if the pattern or target is nullIllegalStateException- if the builder or target is closed
-
build
Compiles the route patterns and closes this builder, including when compilation fails.- Returns:
- the route layer
- Throws:
OpenDALException- with codeConfigInvalidif a glob pattern is invalidIllegalStateException- if the builder is closed
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classNativeObject
-
disposeInternal
protected void disposeInternal(long handle) Description copied from class:NativeObjectDeletes underlying native object pointer.- Specified by:
disposeInternalin classNativeObject- Parameters:
handle- to the native object pointer
-