Package io.tiledb.java.api
Class Config
- java.lang.Object
-
- io.tiledb.java.api.Config
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class Config extends java.lang.Object implements java.lang.AutoCloseable
Sets configuration parameters for a TileDB Context.Example: Config conf = new Config(); conf.set("vfs.s3.region", "us-east-1a"); conf.set("vfs.s3.use_virtual_addressing", "true"); Context ctx = new Context(conf);
-
-
Constructor Summary
Constructors Modifier Constructor Description Config()
Constructor that creates a new config object with default configuration values.protected
Config(SWIGTYPE_p_p_tiledb_config_t configpp)
Constructor from native object handleConfig(java.lang.String filename)
Constructor that takes as input a filename String (URI) that stores the config parameters.Config(java.net.URI uri)
Constructor that takes as input a URI that stores the config parameters.Config(java.util.Map<java.lang.String,java.lang.String> config)
Constructor that takes as input a Map of config string parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Free's native TileDB resources associated with the Config object.java.lang.String
get(java.lang.String parameter)
Get a parameter from the Config by name.protected SWIGTYPE_p_tiledb_config_t
getConfigp()
java.util.HashMap<java.lang.String,java.lang.String>
parameters()
Returns a map of TileDB config parameter, value pairsjava.util.HashMap<java.lang.String,java.lang.String>
parameters(java.lang.String prefix)
Returns a map of TileDB config paramter, value pairs with parameter names starting with a given prefix.void
saveToFile(java.lang.String filename)
Saves config parameters to a local file path.void
saveToFile(java.net.URI uri)
Saves config parameters to a local file system (file://) path.void
set(java.lang.String parameter, java.lang.String value)
Sets a config parameter-value pair.void
unset(java.lang.String parameter)
Resets a config parameter to its default value.
-
-
-
Constructor Detail
-
Config
protected Config(SWIGTYPE_p_p_tiledb_config_t configpp)
Constructor from native object handle- Parameters:
configpp
- A Swig wrapper object to a tiledb_config_t pointer
-
Config
public Config() throws TileDBError
Constructor that creates a new config object with default configuration values.- Throws:
TileDBError
- A TileDB exception
-
Config
public Config(java.lang.String filename) throws TileDBError
Constructor that takes as input a filename String (URI) that stores the config parameters. The file must have the following (text) format:`{parameter} {value}`
Anything following a `#` character is considered a comment and, thus, is ignored.
See `Config.set` for the various TileDB config parameters and allowed values.
- Parameters:
filename
- local path to config file- Throws:
TileDBError
- A TileDB exception
-
Config
public Config(java.net.URI uri) throws TileDBError
Constructor that takes as input a URI that stores the config parameters. The file must have the following (text) format:`{parameter} {value}`
Anything following a `#` character is considered a comment and, thus, is ignored.
See `Config.set` for the various TileDB config parameters and allowed values.
- Parameters:
uri
- path to local config file (file://)- Throws:
TileDBError
- A TileDB exception
-
Config
public Config(java.util.Map<java.lang.String,java.lang.String> config) throws TileDBError
Constructor that takes as input a Map of config string parameters.- Parameters:
config
- map of string, value tiledb config parameters- Throws:
TileDBError
- A TileDB exception
-
-
Method Detail
-
get
public java.lang.String get(java.lang.String parameter) throws TileDBError
- Parameters:
parameter
- parameter name- Returns:
- config parameter string value
- Throws:
TileDBError
- A TileDB exception
-
set
public void set(java.lang.String parameter, java.lang.String value) throws TileDBError
- Parameters:
parameter
- config parameter to setvalue
- config parameter value to set- Throws:
TileDBError
- A TileDB exception
-
unset
public void unset(java.lang.String parameter) throws TileDBError
Resets a config parameter to its default value.- Parameters:
parameter
- config parameter to reset- Throws:
TileDBError
- A TileDB exception
-
parameters
public java.util.HashMap<java.lang.String,java.lang.String> parameters() throws TileDBError
Returns a map of TileDB config parameter, value pairs- Returns:
- HashMap containing all parameters as key/value pairs
- Throws:
TileDBError
- A TileDB exception
-
parameters
public java.util.HashMap<java.lang.String,java.lang.String> parameters(java.lang.String prefix) throws TileDBError
Returns a map of TileDB config paramter, value pairs with parameter names starting with a given prefix.- Parameters:
prefix
- A parameter prefix. Use "" to get all parameters.- Returns:
- HashMap containing all parameters as key-value pairs.
- Throws:
TileDBError
- A TileDB exception
-
saveToFile
public void saveToFile(java.lang.String filename) throws TileDBError
Saves config parameters to a local file path.- Parameters:
filename
- The name of the file where the parameters will be written.- Throws:
TileDBError
- A TileDB exception
-
saveToFile
public void saveToFile(java.net.URI uri) throws TileDBError
Saves config parameters to a local file system (file://) path.- Parameters:
uri
- The URI of the file where the parameters will be written- Throws:
TileDBError
- A TileDB exception
-
getConfigp
protected SWIGTYPE_p_tiledb_config_t getConfigp()
- Returns:
- Swig wrapper object to a tiledb_config_t pointer
-
close
public void close()
Free's native TileDB resources associated with the Config object.- Specified by:
close
in interfacejava.lang.AutoCloseable
-
-