Commit e9bcce7b authored by Morten Ofstad's avatar Morten Ofstad
Browse files

Merge branch wip/julien.lacoste/JavaBindingAdaptiveParams with...

Merge branch wip/julien.lacoste/JavaBindingAdaptiveParams with refs/heads/master into refs/merge-requests/540/train
parents 2add46af 4346fa36
Pipeline #88622 passed with stages
in 27 minutes and 40 seconds
......@@ -57,10 +57,12 @@ set(JAVA_SOURCE_FILES
java/src/org/opengroup/openvds/VolumeIndexer4D.java
java/src/org/opengroup/openvds/VolumeIndexer5D.java
java/src/org/opengroup/openvds/VolumeIndexer6D.java
java/src/org/opengroup/openvds/WaveletAdaptiveMode.java
java/demo/AWSSliceDumpDemo.java
java/demo/CreateVDS.java
java/demo/OpenVdsDemo.java
java/demo/SliceDump.java
#java/experimental/OpenVdsDemoWithArrayIntoBuffers.java
#java/experimental/OpenVdsDemoWithBuffers.java
......
......@@ -70,7 +70,7 @@ static OpenVDS::VDS *generate(const OpenVDS::AzureOpenOptions& opts, int32_t sam
float intOffset = 0.f;
for (int i = 0; i < channels.size(); i++) {
channelDescriptors.emplace_back(format, OpenVDS::VolumeDataChannelDescriptor::Components_1,
channelDescriptors.emplace_back(format, OpenVDS::VolumeDataComponents::Components_1,
channels[i].c_str(), units[i].c_str(), rangeMin, rangeMax, OpenVDS::VolumeDataMapping::Direct, 1,
OpenVDS::VolumeDataChannelDescriptor::Default, std::numeric_limits<float>::lowest(), intScale, intOffset);
}
......
......@@ -81,7 +81,7 @@ static OpenVDS::VDS *generateSimpleInMemory3DVDS(int32_t samplesX = 100, int32_t
float intScale;
float intOffset;
getScaleOffsetForFormat(rangeMin, rangeMax, true, format, intScale, intOffset);
channelDescriptors.emplace_back(format, OpenVDS::VolumeDataChannelDescriptor::Components_1, AMPLITUDE_ATTRIBUTE_NAME, "", rangeMin, rangeMax, OpenVDS::VolumeDataMapping::Direct, 1, OpenVDS::VolumeDataChannelDescriptor::Default, 0.f, intScale, intOffset);
channelDescriptors.emplace_back(format, OpenVDS::VolumeDataComponents::Components_1, AMPLITUDE_ATTRIBUTE_NAME, "", rangeMin, rangeMax, OpenVDS::VolumeDataMapping::Direct, 1, OpenVDS::VolumeDataChannelDescriptor::Default, 0.f, intScale, intOffset);
OpenVDS::InMemoryOpenOptions options;
OpenVDS::Error error;
......
......@@ -47,14 +47,15 @@ jlong openVDSOrThrowJavaIOException(JNIEnv *env, const OpenVDS::OpenOptions &ope
/*
* Class: org_opengroup_openvds_OpenVDS
* Method: cpOpenAWS
* Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IIZ)J
* Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IIZIFF)J
*/
JNIEXPORT jlong JNICALL Java_org_opengroup_openvds_OpenVDS_cpOpenAWS
(JNIEnv * env, jclass,
jstring jBucket, jstring jKey, jstring jRegion, jstring jEndpointOverride,
jstring jAccessKeyID, jstring jSecretKeyID,
jstring jSessionToken, jstring jExpiration, jstring jLogFilenamePrefix, jstring jLogLevel,
jint jConnectionTimeOutMs, jint jRequestTimeOutMs, jboolean jDisableInitAPI)
jint jConnectionTimeOutMs, jint jRequestTimeOutMs, jboolean jDisableInitAPI,
jint jWaveletAdaptiveMode, jfloat jWaveletAdaptiveTolerance, jfloat jWaveletAdaptiveRatio)
{
OpenVDS::AWSOpenOptions openOptions;
......@@ -72,12 +73,22 @@ JNIEXPORT jlong JNICALL Java_org_opengroup_openvds_OpenVDS_cpOpenAWS
openOptions.requestTimeoutMs = jRequestTimeOutMs;
openOptions.disableInitApi = jDisableInitAPI;
// wavelet adaptive parameters
openOptions.waveletAdaptiveMode = OpenVDS::WaveletAdaptiveMode(jWaveletAdaptiveMode);
openOptions.waveletAdaptiveTolerance = jWaveletAdaptiveTolerance;
openOptions.waveletAdaptiveRatio = jWaveletAdaptiveRatio;
return openVDSOrThrowJavaIOException(env, openOptions);
}
jlong JNICALL Java_org_opengroup_openvds_OpenVDS_cpOpenAzure
/*
* Class: org_opengroup_openvds_OpenVDS
* Method: cpOpenAzure
* Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IIIFF)J
*/
JNIEXPORT jlong JNICALL Java_org_opengroup_openvds_OpenVDS_cpOpenAzure
(JNIEnv *env, jclass, jstring jConnectionString, jstring jContainer, jstring jBlob, jint jParallelismFactor,
jint jMaxExecutionTime) {
jint jMaxExecutionTime, jint jWaveletAdaptiveMode, jfloat jWaveletAdaptiveTolerance, jfloat jWaveletAdaptiveRatio) {
OpenVDS::AzureOpenOptions openOptions;
......@@ -87,45 +98,72 @@ jlong JNICALL Java_org_opengroup_openvds_OpenVDS_cpOpenAzure
openOptions.parallelism_factor = jParallelismFactor;
openOptions.max_execution_time = jMaxExecutionTime;
// wavelet adaptive parameters
openOptions.waveletAdaptiveMode = OpenVDS::WaveletAdaptiveMode(jWaveletAdaptiveMode);
openOptions.waveletAdaptiveTolerance = jWaveletAdaptiveTolerance;
openOptions.waveletAdaptiveRatio = jWaveletAdaptiveRatio;
return openVDSOrThrowJavaIOException(env, openOptions);
}
jlong JNICALL Java_org_opengroup_openvds_OpenVDS_cpOpenGoogle
(JNIEnv *env, jclass, jstring jbucket, jstring jpathPrefix) {
/*
* Class: org_opengroup_openvds_OpenVDS
* Method: cpOpenGoogle
* Signature: (Ljava/lang/String;Ljava/lang/String;IFF)J
*/
JNIEXPORT jlong JNICALL Java_org_opengroup_openvds_OpenVDS_cpOpenGoogle
(JNIEnv *env, jclass, jstring jbucket, jstring jpathPrefix,
jint jWaveletAdaptiveMode, jfloat jWaveletAdaptiveTolerance, jfloat jWaveletAdaptiveRatio) {
OpenVDS::GoogleOpenOptions openOptions;
openOptions.bucket = JStringToString(env, jbucket);
openOptions.pathPrefix= JStringToString(env, jpathPrefix);
// wavelet adaptive parameters
openOptions.waveletAdaptiveMode = OpenVDS::WaveletAdaptiveMode(jWaveletAdaptiveMode);
openOptions.waveletAdaptiveTolerance = jWaveletAdaptiveTolerance;
openOptions.waveletAdaptiveRatio = jWaveletAdaptiveRatio;
return openVDSOrThrowJavaIOException(env, openOptions);
}
/*
* Class: org_opengroup_openvds_OpenVDS
* Method: cpOpenVDSFile
* Signature: (Ljava/lang/String;)J
* Signature: (Ljava/lang/String;IFF)J
*/
JNIEXPORT jlong JNICALL Java_org_opengroup_openvds_OpenVDS_cpOpenVDSFile
(JNIEnv *env, jclass, jstring jfilepath) {
(JNIEnv *env, jclass, jstring jfilepath, jint jWaveletAdaptiveMode, jfloat jWaveletAdaptiveTolerance, jfloat jWaveletAdaptiveRatio) {
OpenVDS::VDSFileOpenOptions openOptions;
openOptions.fileName = JStringToString(env, jfilepath);
// wavelet adaptive parameters
openOptions.waveletAdaptiveMode = OpenVDS::WaveletAdaptiveMode(jWaveletAdaptiveMode);
openOptions.waveletAdaptiveTolerance = jWaveletAdaptiveTolerance;
openOptions.waveletAdaptiveRatio = jWaveletAdaptiveRatio;
return openVDSOrThrowJavaIOException(env, openOptions);
}
/*
* Class: org_opengroup_openvds_OpenVDS
* Method: cpOpenAzurePresigned
* Signature: (Ljava/lang/String;Ljava/lang/String;)J
* Signature: (Ljava/lang/String;Ljava/lang/String;IFF)J
*/
JNIEXPORT jlong JNICALL Java_org_opengroup_openvds_OpenVDS_cpOpenAzurePresigned
(JNIEnv *env, jclass, jstring baseUrl, jstring urlSuffix) {
(JNIEnv *env, jclass, jstring baseUrl, jstring urlSuffix,
jint jWaveletAdaptiveMode, jfloat jWaveletAdaptiveTolerance, jfloat jWaveletAdaptiveRatio) {
OpenVDS::AzureOpenOptions openOptions;
openOptions.connectionString = JStringToString(env, baseUrl);
openOptions.container = JStringToString(env, urlSuffix);
// wavelet adaptive parameters
openOptions.waveletAdaptiveMode = OpenVDS::WaveletAdaptiveMode(jWaveletAdaptiveMode);
openOptions.waveletAdaptiveTolerance = jWaveletAdaptiveTolerance;
openOptions.waveletAdaptiveRatio = jWaveletAdaptiveRatio;
return openVDSOrThrowJavaIOException(env, openOptions);
}
......@@ -144,6 +182,36 @@ JNIEXPORT jlong JNICALL Java_org_opengroup_openvds_OpenVDS_cpOpenConnection
return (jlong) pVds;
}
/*
* Class: org_opengroup_openvds_OpenVDS
* Method: cpOpenConnectionWithAdaptiveCompressionRatio
* Signature: (Ljava/lang/String;Ljava/lang/String;F)J
*/
JNIEXPORT jlong JNICALL Java_org_opengroup_openvds_OpenVDS_cpOpenConnectionWithAdaptiveCompressionRatio
(JNIEnv * env, jclass, jstring url, jstring connectionString, jfloat jWaveletAdaptiveRatio) {
OpenVDS::Error error;
OpenVDS::VDSHandle pVds = OpenVDS::OpenWithAdaptiveCompressionRatio(JStringToString(env, url), JStringToString(env, connectionString), jWaveletAdaptiveRatio, error);
if (pVds == nullptr) {
throwJavaIOException(env, error);
}
return (jlong) pVds;
}
/*
* Class: org_opengroup_openvds_OpenVDS
* Method: cpOpenConnectionWithAdaptiveCompressionTolerance
* Signature: (Ljava/lang/String;Ljava/lang/String;F)J
*/
JNIEXPORT jlong JNICALL Java_org_opengroup_openvds_OpenVDS_cpOpenConnectionWithAdaptiveCompressionTolerance
(JNIEnv * env, jclass, jstring url, jstring connectionString, jfloat jWaveletAdaptiveTolerance) {
OpenVDS::Error error;
OpenVDS::VDSHandle pVds = OpenVDS::OpenWithAdaptiveCompressionTolerance(JStringToString(env, url), JStringToString(env, connectionString), jWaveletAdaptiveTolerance, error);
if (pVds == nullptr) {
throwJavaIOException(env, error);
}
return (jlong) pVds;
}
static std::vector<OpenVDS::VolumeDataChannelDescriptor>
getVolumeDataChannelDescriptor(JNIEnv *env, jobjectArray obj, std::multiset<std::string>& string_buffer)
{
......@@ -174,14 +242,14 @@ getVolumeDataChannelDescriptor(JNIEnv *env, jobjectArray obj, std::multiset<std:
if (isusenovalue) {
OpenVDS::VolumeDataChannelDescriptor tmp(static_cast<OpenVDS::VolumeDataChannelDescriptor::Format>(format),
static_cast<OpenVDS::VolumeDataChannelDescriptor::Components>(components), name->c_str(), unit->c_str(),
static_cast<OpenVDS::VolumeDataComponents>(components), name->c_str(), unit->c_str(),
valuerangemin, valuerangemax, static_cast<OpenVDS::VolumeDataMapping>(mapping), mappedvaluecount,
static_cast<OpenVDS::VolumeDataChannelDescriptor::Flags>(flags), novalue, integerscale, integeroffset);
result.emplace_back(tmp);
}
else {
OpenVDS::VolumeDataChannelDescriptor tmp(static_cast<OpenVDS::VolumeDataChannelDescriptor::Format>(format),
static_cast<OpenVDS::VolumeDataChannelDescriptor::Components>(components), name->c_str(), unit->c_str(),
static_cast<OpenVDS::VolumeDataComponents>(components), name->c_str(), unit->c_str(),
valuerangemin, valuerangemax, static_cast<OpenVDS::VolumeDataMapping>(mapping), mappedvaluecount,
static_cast<OpenVDS::VolumeDataChannelDescriptor::Flags>(flags), integerscale, integeroffset);
result.emplace_back(tmp);
......
This diff is collapsed.
......@@ -60,6 +60,25 @@ public class AWSOpenOptions extends OpenOptions {
endPointOverride = pEndpointOverride;
}
/**
* Constructor.
*
* @param pBucket the bucket of the VDS
* @param pKey the key prefix of the VDS
* @param pRegion the region of the bucket of the VDS
* @param pEndpointOverride This parameter allows to override the endpoint url
* @apram wam wavelet adaptive method
* @param wat wavelet adaptive tolerance
* @param war wavelet adaptive ratio
*/
public AWSOpenOptions(String pBucket, String pKey, String pRegion, String pEndpointOverride, WaveletAdaptiveMode wam, float wat, float war) {
super(ConnectionType.AWS, wam, wat, war);
bucket = pBucket;
key = pKey;
region = pRegion;
endPointOverride = pEndpointOverride;
}
/**
* Constructor.
*
......@@ -70,5 +89,19 @@ public class AWSOpenOptions extends OpenOptions {
public AWSOpenOptions(String pBucket, String pKey, String pRegion) {
this(pBucket, pKey, pRegion, null);
}
/**
* Constructor with adaptive wavelet parameters
*
* @param pBucket the bucket of the VDS
* @param pKey the key prefix of the VDS
* @param pRegion the region of the bucket of the VDS
* @apram wam wavelet adaptive method
* @param wat wavelet adaptive tolerance
* @param war wavelet adaptive ratio
*/
public AWSOpenOptions(String pBucket, String pKey, String pRegion, WaveletAdaptiveMode wam, float wat, float war) {
this(pBucket, pKey, pRegion, null, wam, wat, war);
}
}
......@@ -47,6 +47,23 @@ public class AzureOpenOptions extends OpenOptions {
blob = pBlob;
}
/**
* Constructor with wavelet adaptive parameters
*
* @param pConnectionString the connectionString for the VDS
* @param pContainer the container of the VDS
* @param pBlob the blob prefix of the VDS
* @apram wam wavelet adaptive method
* @param wat wavelet adaptive tolerance
* @param war wavelet adaptive ratio
*/
public AzureOpenOptions(String pConnectionString, String pContainer, String pBlob, WaveletAdaptiveMode wam, float wat, float war) {
super(ConnectionType.Azure, wam, wat, war);
connectionString = pConnectionString;
container = pContainer;
blob = pBlob;
}
/**
* Constructor.
*
......@@ -58,8 +75,7 @@ public class AzureOpenOptions extends OpenOptions {
* @param pMaxExecutionTime the max execution time setting for the Azure
* Blob Storage library
*/
public AzureOpenOptions(String pConnectionString, String pContainer, String pBlob,
int pParallelismFactor, int pMaxExecutionTime) {
public AzureOpenOptions(String pConnectionString, String pContainer, String pBlob, int pParallelismFactor, int pMaxExecutionTime) {
super(ConnectionType.Azure);
connectionString = pConnectionString;
container = pContainer;
......@@ -67,4 +83,28 @@ public class AzureOpenOptions extends OpenOptions {
parallelism_factor = pParallelismFactor;
max_execution_time = pMaxExecutionTime;
}
/**
* Constructor with wavelet adaptive parameters
*
* @param pConnectionString the connectionString for the VDS
* @param pContainer the container of the VDS
* @param pBlob the blob prefix of the VDS
* @param pParallelismFactor the parallelism factor setting for the Azure
* Blob Storage library
* @param pMaxExecutionTime the max execution time setting for the Azure
* Blob Storage library
* @apram wam wavelet adaptive method
* @param wat wavelet adaptive tolerance
* @param war wavelet adaptive ratio
*/
public AzureOpenOptions(String pConnectionString, String pContainer, String pBlob, int pParallelismFactor, int pMaxExecutionTime,
WaveletAdaptiveMode wam, float wat, float war) {
super(ConnectionType.Azure, wam, wat, war);
connectionString = pConnectionString;
container = pContainer;
blob = pBlob;
parallelism_factor = pParallelismFactor;
max_execution_time = pMaxExecutionTime;
}
}
......@@ -43,4 +43,19 @@ public class AzurePresignedOpenOptions extends OpenOptions {
this.baseUrl = baseUrl;
this.urlSuffix = urlSuffix;
}
/**
* Constructor with wavelet adaptive parameters
*
* @param baseUrl the connectionString for the VDS
* @param urlSuffix the container of the VDS
* @apram wam wavelet adaptive method
* @param wat wavelet adaptive tolerance
* @param war wavelet adaptive ratio
*/
public AzurePresignedOpenOptions(String baseUrl, String urlSuffix, WaveletAdaptiveMode wam, float wat, float war) {
super(ConnectionType.AzurePresigned, wam, wat, war);
this.baseUrl = baseUrl;
this.urlSuffix = urlSuffix;
}
}
......@@ -41,7 +41,23 @@ public class GoogleOpenOptions extends OpenOptions {
public GoogleOpenOptions(String pBucket, String pathPrefix) {
super(ConnectionType.Google);
bucket = pBucket;
pathPrefix = pathPrefix;
this.pathPrefix = pathPrefix;
}
/**
* Constructor with wavelet adaptive paramters
*
* @param pBucket the bucket of the VDS
* @param pathPrefix the prefix of the VDS
* @apram wam wavelet adaptive method
* @param wat wavelet adaptive tolerance
* @param war wavelet adaptive ratio
*/
public GoogleOpenOptions(String pBucket, String pathPrefix, WaveletAdaptiveMode wam, float wat, float war) {
super(ConnectionType.Google, wam, wat, war);
bucket = pBucket;
this.pathPrefix = pathPrefix;
}
}
......@@ -28,4 +28,16 @@ public class InMemoryOpenOptions extends OpenOptions {
public InMemoryOpenOptions() {
super(ConnectionType.InMemory);
}
/**
* Constructor with wavelet adaptive parameters
*
* @apram wam wavelet adaptive method
* @param wat wavelet adaptive tolerance
* @param war wavelet adaptive ratio
*/
public InMemoryOpenOptions(WaveletAdaptiveMode wam, float wat, float war) {
super(ConnectionType.InMemory, wam, wat, war);
}
}
......@@ -21,6 +21,7 @@ package org.opengroup.openvds;
* Base class for options for opening a VDS
*/
public class OpenOptions {
public enum ConnectionType {
AWS,
Azure,
......@@ -32,12 +33,31 @@ public class OpenOptions {
public int connectionType;
public WaveletAdaptiveMode waveletAdaptiveMode = WaveletAdaptiveMode.BestQuality;
public float waveletAdaptiveTolerance = 0.01f;
public float waveletAdaptiveRatio = 1.0f;
/**
* Constructor.
*
* @param cType the connection type (see static members of this class)
*/
protected OpenOptions(ConnectionType cType) {
connectionType = cType.ordinal();
}
/**
* Constructor.
*
* @param ctype the connection type (see static members of this class)
* @param cType the connection type (see static members of this class)
* @apram wam wavelet adaptive method
* @param wat wavelet adaptive tolerance
* @param war wavelet adaptive ratio
*/
protected OpenOptions(ConnectionType ctype) {
connectionType = ctype.ordinal();
protected OpenOptions(ConnectionType cType, WaveletAdaptiveMode wam, float wat, float war) {
connectionType = cType.ordinal();
waveletAdaptiveMode = wam;
waveletAdaptiveTolerance = wat;
waveletAdaptiveRatio = war;
}
}
......@@ -22,20 +22,26 @@ import java.io.IOException;
public class OpenVDS extends VdsHandle {
private static native long cpOpenAWS(String bucket, String key, String region, String endPointOverride, String accessKeyId, String secretKey,
String sessionToken, String expiration,
String logFilenamePrefix, String loglevel, int connectionTimeoutMs, int requestTimeoutMs, boolean disableInitApi) throws IOException;
String logFilenamePrefix, String loglevel, int connectionTimeoutMs, int requestTimeoutMs, boolean disableInitApi,
int waveletAdaptiveMode, float waveletAdaptiveTolerance, float waveletAdaptiveRatio) throws IOException;
private static native long cpOpenAzure(String pConnectionString, String pContainer, String pBlob,
int pParallelismFactor, int pMaxExecutionTime) throws IOException;
int pParallelismFactor, int pMaxExecutionTime,
int waveletAdaptiveMode, float waveletAdaptiveTolerance, float waveletAdaptiveRatio) throws IOException;
private static native long cpOpenGoogle(String bucket, String pathPrefix) throws IOException;
private static native long cpOpenGoogle(String bucket, String pathPrefix, int waveletAdaptiveMode, float waveletAdaptiveTolerance, float waveletAdaptiveRatio) throws IOException;
private static native long cpOpenAzurePresigned(String baseUrl, String urlSuffix) throws IOException;
private static native long cpOpenAzurePresigned(String baseUrl, String urlSuffix, int waveletAdaptiveMode, float waveletAdaptiveTolerance, float waveletAdaptiveRatio) throws IOException;
private static native long cpOpenConnection(String url, String connectionString) throws IOException;
private static native long cpOpenConnectionWithAdaptiveCompressionRatio(String url, String connectionString, float adaptiveRatio) throws IOException;
private static native long cpOpenConnectionWithAdaptiveCompressionTolerance(String url, String connectionString, float adaptiveTolerance) throws IOException;
private static native boolean cpIsCompressionMethodSupported(int compressionMethod);
private static native long cpOpenVDSFile(String filePath) throws IOException;
private static native long cpOpenVDSFile(String filePath, int waveletAdaptiveMode, float waveletAdaptiveTolerance, float waveletAdaptiveRatio) throws IOException;
private static native long cpCreate(OpenOptions options, VolumeDataLayoutDescriptor layoutDescriptor,
VolumeDataAxisDescriptor[] axisDescriptors,
......@@ -82,17 +88,24 @@ public class OpenVDS extends VdsHandle {
public static OpenVDS open(AWSOpenOptions o) throws IOException {
if (o == null) throw new IllegalArgumentException("open option can't be null");
return new OpenVDS(cpOpenAWS(o.bucket, o.key, o.region, o.endPointOverride, o.accessKeyId, o.secretKey, o.sessionToken, o.expiration,
o.logFilenamePrefix, o.logLevel, o.connectionTimeoutMs, o.requestTimeoutMs, o.disableInitApi), true);
o.logFilenamePrefix, o.logLevel, o.connectionTimeoutMs, o.requestTimeoutMs, o.disableInitApi,
o.waveletAdaptiveMode.ordinal(), o.waveletAdaptiveTolerance, o.waveletAdaptiveRatio), true);
}
public static OpenVDS open(AzureOpenOptions o) throws IOException {
if (o == null) throw new IllegalArgumentException("open option can't be null");
return new OpenVDS(cpOpenAzure(o.connectionString, o.container, o.blob, o.parallelism_factor, o.max_execution_time), true);
return new OpenVDS(cpOpenAzure(o.connectionString, o.container, o.blob, o.parallelism_factor, o.max_execution_time,
o.waveletAdaptiveMode.ordinal(), o.waveletAdaptiveTolerance, o.waveletAdaptiveRatio), true);
}
public static OpenVDS open(AzurePresignedOpenOptions o) throws IOException {
if (o == null) throw new IllegalArgumentException("open option can't be null");
return new OpenVDS(cpOpenAzurePresigned(o.baseUrl, o.urlSuffix), true);
return new OpenVDS(cpOpenAzurePresigned(o.baseUrl, o.urlSuffix, o.waveletAdaptiveMode.ordinal(), o.waveletAdaptiveTolerance, o.waveletAdaptiveRatio), true);
}
public static OpenVDS open(GoogleOpenOptions o) throws IOException {
if (o == null) throw new IllegalArgumentException("open option can't be null");
return new OpenVDS(cpOpenGoogle(o.bucket, o.pathPrefix, o.waveletAdaptiveMode.ordinal(), o.waveletAdaptiveTolerance, o.waveletAdaptiveRatio), true);
}
public static OpenVDS open(String url, String connectionString) throws IOException {
......@@ -100,9 +113,19 @@ public class OpenVDS extends VdsHandle {
return new OpenVDS(cpOpenConnection(url, connectionString), true);
}
public static OpenVDS openWithAdaptiveCompressionRatio(String url, String connectionString, float adaptiveRatio) throws IOException {
if ("".equals(url)) throw new IllegalArgumentException("url can't be empty");
return new OpenVDS(cpOpenConnectionWithAdaptiveCompressionRatio(url, connectionString, adaptiveRatio), true);
}
public static OpenVDS openWithAdaptiveCompressionTolerance(String url, String connectionString, float adaptiveTolerance) throws IOException {
if ("".equals(url)) throw new IllegalArgumentException("url can't be empty");
return new OpenVDS(cpOpenConnectionWithAdaptiveCompressionTolerance(url, connectionString, adaptiveTolerance), true);
}
public static OpenVDS open(VDSFileOpenOptions o) throws IOException {
if (o == null) throw new IllegalArgumentException("open option can't be null");
return new OpenVDS(cpOpenVDSFile(o.filePath), true);
return new OpenVDS(cpOpenVDSFile(o.filePath, o.waveletAdaptiveMode.ordinal(), o.waveletAdaptiveTolerance, o.waveletAdaptiveRatio), true);
}
private static void validateCreateArguments(VolumeDataLayoutDescriptor ld,
......
......@@ -38,7 +38,19 @@ public class VDSFileOpenOptions extends OpenOptions {
*/
public VDSFileOpenOptions(String pFilePath) {
super(ConnectionType.File);
this.filePath = pFilePath;
}
/**
* Constructor with wavelet adaptive parameters
*
* @param pFilePath the file path the VDS
* @apram wam wavelet adaptive method
* @param wat wavelet adaptive tolerance
* @param war wavelet adaptive ratio
*/
public VDSFileOpenOptions(String pFilePath, WaveletAdaptiveMode wam, float wat, float war) {
super(ConnectionType.File, wam, wat, war);
this.filePath = pFilePath;
}
}
package org.opengroup.openvds;
/**
* Wavelet adaptative mode, used to select quality when querying samples on compressed data.
*/
public enum WaveletAdaptiveMode {
BestQuality, ///< The best quality available data is loaded (this is the only setting which will load lossless data).
Tolerance, ///< An adaptive level closest to the global compression tolerance is selected when loading wavelet compressed data.
Ratio ///< An adaptive level closest to the global compression ratio is selected when loading wavelet compressed data.
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment