public class Context
extends java.lang.Object
implements java.lang.AutoCloseable
Example: Context ctx = new Context(); // Use ctx when creating other objects: ArraySchema schema = new ArraySchema(ctx, tiledb_array_type_t.TILEDB_SPARSE); // Set a custom error handler: ctx.setErrorHandler(new MyContextCallback()); //Context custom callback class example private static class MyContextCallback extends ContextCallback { @Override public void call(String msg) throws TileDBError { System.out.println("Callback error message: " + msg); } }
Constructor and Description |
---|
Context()
Constructor.
|
Context(Config config)
Creates a TileDB context with the given TileDB config object.
|
Context(java.util.Map<java.lang.String,java.lang.String> config)
Creates a TileDB context with the given TileDB parameter, value settings.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the context and delete all native objects.
|
Config |
getConfig() |
protected SWIGTYPE_p_tiledb_ctx_t |
getCtxp() |
void |
handleError(int rc)
Error handler for the TileDB C API (JNI) calls.
|
boolean |
isSupportedFs(Filesystem fs)
Checks if the filesystem backend is supported.
|
void |
setErrorHandler(ContextCallback errorHandler)
Sets the error handler using a subclass of ContextCallback.
|
void |
setTag(java.lang.String key,
java.lang.String value)
Set context tasks
|
public Context() throws TileDBError
TileDBError
- if construction failspublic Context(Config config) throws TileDBError
config
- A TileDB Config objectTileDBError
- if construction failspublic Context(java.util.Map<java.lang.String,java.lang.String> config) throws TileDBError
config
- A Map of TileDB setting, value string pairsTileDBError
- if construction failspublic void setErrorHandler(ContextCallback errorHandler)
errorHandler
- A custom ContextCallback error handlerpublic void handleError(int rc) throws TileDBError
rc
- If != TILEDB_OK, call error handlerTileDBError
- A TileDB exceptionpublic boolean isSupportedFs(Filesystem fs) throws TileDBError
fs
- TileDB filesystem enumTileDBError
- A TileDB exceptionprotected SWIGTYPE_p_tiledb_ctx_t getCtxp()
public Config getConfig() throws TileDBError
TileDBError
public void setTag(java.lang.String key, java.lang.String value) throws TileDBError
key
- to setvalue
- value to setTileDBError
public void close()
close
in interface java.lang.AutoCloseable