Skip to content

Commit

Permalink
Merge pull request #203 from ballerina-platform/dir-structure-update
Browse files Browse the repository at this point in the history
Make native dir structure consistent with other lib modules
  • Loading branch information
NipunaRanasinghe authored Feb 1, 2024
2 parents e19b3e7 + ee50fa1 commit 7c226c9
Show file tree
Hide file tree
Showing 29 changed files with 236 additions and 238 deletions.
6 changes: 3 additions & 3 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ license = ["Apache-2.0"]
graalvmCompatible = true

[[platform.java17.dependency]]
groupId = "org.ballerinalang"
artifactId = "redis-utils"
module = "redis-utils"
groupId = "io.ballerina.lib"
artifactId = "redis-native"
module = "redis-native"
version="2.6.0-SNAPSHOT"
path = "../native/build/libs/redis-native-2.6.0-SNAPSHOT.jar"

Expand Down
218 changes: 109 additions & 109 deletions ballerina/client.bal

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ballerina/init.bal
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ function init() {
}

function setModule() = @java:Method {
'class: "org.ballerinalang.redis.utils.ModuleUtils"
'class: "io.ballerina.lib.redis.utils.ModuleUtils"
} external;
6 changes: 3 additions & 3 deletions build-config/resources/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ license = ["Apache-2.0"]
graalvmCompatible = true

[[platform.java17.dependency]]
groupId = "org.ballerinalang"
artifactId = "redis-utils"
module = "redis-utils"
groupId = "io.ballerina.lib"
artifactId = "redis-native"
module = "redis-native"
version="@project.version@"
path = "../native/build/libs/redis-native-@project.version@.jar"

Expand Down
2 changes: 1 addition & 1 deletion build-config/spotbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<FindBugsFilter>
<!-- Exclude warning about private method not being called -->
<Match>
<Class name="org.ballerinalang.redis.connection.RedisConnectionManager$ConnectionParam"/>
<Class name="io.ballerina.lib.redis.connection.RedisConnectionManager$ConnectionParam"/>
<Method name="getKey"/>
</Match>
</FindBugsFilter>
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
org.gradle.caching=true
group=org.ballerinalang.redis
group=io.ballerina.lib.redis
version=2.6.0-SNAPSHOT
ballerinaLangVersion=2201.8.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
* under the License.
*/

package org.ballerinalang.redis;
package io.ballerina.lib.redis;

import io.ballerina.lib.redis.connection.RedisConnectionCommandExecutor;
import io.ballerina.runtime.api.values.BObject;
import org.ballerinalang.redis.connection.RedisConnectionCommandExecutor;

import static org.ballerinalang.redis.utils.ConversionUtils.createBError;
import static org.ballerinalang.redis.utils.RedisUtils.getConnection;
import static io.ballerina.lib.redis.utils.ConversionUtils.createBError;
import static io.ballerina.lib.redis.utils.RedisUtils.getConnection;

/**
* Ballerina native util implementation for redis cluster commands.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
* under the License.
*/

package org.ballerinalang.redis;
package io.ballerina.lib.redis;

import io.ballerina.lib.redis.connection.RedisConnectionCommandExecutor;
import io.ballerina.runtime.api.utils.StringUtils;
import io.ballerina.runtime.api.values.BObject;
import io.ballerina.runtime.api.values.BString;
import org.ballerinalang.redis.connection.RedisConnectionCommandExecutor;

import static org.ballerinalang.redis.utils.ConversionUtils.createBError;
import static org.ballerinalang.redis.utils.RedisUtils.getConnection;
import static io.ballerina.lib.redis.utils.ConversionUtils.createBError;
import static io.ballerina.lib.redis.utils.RedisUtils.getConnection;

/**
* Ballerina native util implementation for redis connection commands.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
* under the License.
*/

package org.ballerinalang.redis;
package io.ballerina.lib.redis;

import io.ballerina.lib.redis.connection.RedisHashCommandExecutor;
import io.ballerina.runtime.api.utils.StringUtils;
import io.ballerina.runtime.api.values.BArray;
import io.ballerina.runtime.api.values.BMap;
import io.ballerina.runtime.api.values.BObject;
import io.ballerina.runtime.api.values.BString;
import org.ballerinalang.redis.connection.RedisHashCommandExecutor;

import static org.ballerinalang.redis.utils.ConversionUtils.createBError;
import static org.ballerinalang.redis.utils.ConversionUtils.createMapFromBMap;
import static org.ballerinalang.redis.utils.ConversionUtils.createStringArrayFromBArray;
import static org.ballerinalang.redis.utils.RedisUtils.getConnection;
import static io.ballerina.lib.redis.utils.ConversionUtils.createBError;
import static io.ballerina.lib.redis.utils.ConversionUtils.createMapFromBMap;
import static io.ballerina.lib.redis.utils.ConversionUtils.createStringArrayFromBArray;
import static io.ballerina.lib.redis.utils.RedisUtils.getConnection;

/**
* Ballerina native util implementation for redis hash commands.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@
* under the License.
*/

package org.ballerinalang.redis;
package io.ballerina.lib.redis;

import io.ballerina.lib.redis.connection.RedisKeyCommandExecutor;
import io.ballerina.runtime.api.utils.StringUtils;
import io.ballerina.runtime.api.values.BArray;
import io.ballerina.runtime.api.values.BObject;
import io.ballerina.runtime.api.values.BString;
import org.ballerinalang.redis.connection.RedisKeyCommandExecutor;

import static org.ballerinalang.redis.utils.ConversionUtils.createBError;
import static org.ballerinalang.redis.utils.ConversionUtils.createStringArrayFromBArray;
import static org.ballerinalang.redis.utils.RedisUtils.getConnection;
import static io.ballerina.lib.redis.utils.ConversionUtils.createBError;
import static io.ballerina.lib.redis.utils.ConversionUtils.createStringArrayFromBArray;
import static io.ballerina.lib.redis.utils.RedisUtils.getConnection;

/**
* Ballerina native util implementation for redis key commands.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@
* under the License.
*/

package org.ballerinalang.redis;
package io.ballerina.lib.redis;

import io.ballerina.lib.redis.connection.RedisListCommandsExecutor;
import io.ballerina.runtime.api.utils.StringUtils;
import io.ballerina.runtime.api.values.BArray;
import io.ballerina.runtime.api.values.BObject;
import io.ballerina.runtime.api.values.BString;
import org.ballerinalang.redis.connection.RedisListCommandsExecutor;

import static org.ballerinalang.redis.utils.ConversionUtils.createBError;
import static org.ballerinalang.redis.utils.ConversionUtils.createStringArrayFromBArray;
import static org.ballerinalang.redis.utils.RedisUtils.getConnection;
import static io.ballerina.lib.redis.utils.ConversionUtils.createBError;
import static io.ballerina.lib.redis.utils.ConversionUtils.createStringArrayFromBArray;
import static io.ballerina.lib.redis.utils.RedisUtils.getConnection;

/**
* Ballerina native util implementation for redis list commands.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
* under the License.
*/

package org.ballerinalang.redis;
package io.ballerina.lib.redis;

import io.ballerina.lib.redis.connection.RedisSetCommandExecutor;
import io.ballerina.runtime.api.values.BArray;
import io.ballerina.runtime.api.values.BObject;
import io.ballerina.runtime.api.values.BString;
import org.ballerinalang.redis.connection.RedisSetCommandExecutor;

import static org.ballerinalang.redis.utils.ConversionUtils.createBError;
import static org.ballerinalang.redis.utils.ConversionUtils.createStringArrayFromBArray;
import static org.ballerinalang.redis.utils.RedisUtils.getConnection;
import static io.ballerina.lib.redis.utils.ConversionUtils.createBError;
import static io.ballerina.lib.redis.utils.ConversionUtils.createStringArrayFromBArray;
import static io.ballerina.lib.redis.utils.RedisUtils.getConnection;

/**
* Ballerina native util implementation for redis set commands.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@
* under the License.
*/

package org.ballerinalang.redis;
package io.ballerina.lib.redis;

import io.ballerina.lib.redis.connection.RedisSortedSetCommandExecutor;
import io.ballerina.runtime.api.values.BArray;
import io.ballerina.runtime.api.values.BMap;
import io.ballerina.runtime.api.values.BObject;
import io.ballerina.runtime.api.values.BString;
import org.ballerinalang.redis.connection.RedisSortedSetCommandExecutor;

import java.util.LinkedHashMap;
import java.util.Map;

import static org.ballerinalang.redis.utils.ConversionUtils.createBError;
import static org.ballerinalang.redis.utils.ConversionUtils.createStringArrayFromBArray;
import static org.ballerinalang.redis.utils.RedisUtils.getConnection;
import static io.ballerina.lib.redis.utils.ConversionUtils.createBError;
import static io.ballerina.lib.redis.utils.ConversionUtils.createStringArrayFromBArray;
import static io.ballerina.lib.redis.utils.RedisUtils.getConnection;

/**
* Ballerina native util implementation for redis sorted set commands.
Expand Down Expand Up @@ -242,7 +242,7 @@ public static Object zRank(BObject redisClient, BString key, BString member) {
*
* @param redisClient Client from the Ballerina redis client
* @param key The key of the sorted set
* @param members The members to be removed
* @param members The members to be removed
* @return The number of members removed from the sorted set, not including non-existing members
*/
public static Object zRem(BObject redisClient, BString key, BArray members) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@
* under the License.
*/

package org.ballerinalang.redis;
package io.ballerina.lib.redis;

import io.ballerina.lib.redis.connection.RedisStringCommandExecutor;
import io.ballerina.runtime.api.utils.StringUtils;
import io.ballerina.runtime.api.values.BArray;
import io.ballerina.runtime.api.values.BMap;
import io.ballerina.runtime.api.values.BObject;
import io.ballerina.runtime.api.values.BString;
import org.ballerinalang.redis.connection.RedisStringCommandExecutor;

import static org.ballerinalang.redis.utils.ConversionUtils.createBError;
import static org.ballerinalang.redis.utils.ConversionUtils.createBStringArrayFromBMap;
import static org.ballerinalang.redis.utils.ConversionUtils.createMapFromBMap;
import static org.ballerinalang.redis.utils.ConversionUtils.createStringArrayFromBArray;
import static org.ballerinalang.redis.utils.RedisUtils.getConnection;
import static io.ballerina.lib.redis.utils.ConversionUtils.createBError;
import static io.ballerina.lib.redis.utils.ConversionUtils.createBStringArrayFromBMap;
import static io.ballerina.lib.redis.utils.ConversionUtils.createMapFromBMap;
import static io.ballerina.lib.redis.utils.ConversionUtils.createStringArrayFromBArray;
import static io.ballerina.lib.redis.utils.RedisUtils.getConnection;

/**
* Ballerina native util implementation for redis string commands.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
* under the License.
*/

package org.ballerinalang.redis.connection;
package io.ballerina.lib.redis.connection;

import io.ballerina.lib.redis.exceptions.RedisConnectorException;
import io.ballerina.lib.redis.utils.ConversionUtils;
import io.ballerina.runtime.api.values.BArray;
import io.lettuce.core.RedisException;
import io.lettuce.core.api.sync.BaseRedisCommands;
import io.lettuce.core.api.sync.RedisCommands;
import io.lettuce.core.cluster.api.sync.RedisAdvancedClusterCommands;
import io.lettuce.core.cluster.api.sync.RedisClusterCommands;
import org.ballerinalang.redis.exceptions.RedisConnectorException;
import org.ballerinalang.redis.utils.ConversionUtils;

import static org.ballerinalang.redis.utils.Constants.MUST_NOT_BE_NULL;
import static org.ballerinalang.redis.utils.Constants.REDIS_SERVER_ERROR;
import static io.ballerina.lib.redis.utils.Constants.MUST_NOT_BE_NULL;
import static io.ballerina.lib.redis.utils.Constants.REDIS_SERVER_ERROR;

/**
* Executor implementation for Redis connection commands.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
* under the License.
*/

package org.ballerinalang.redis.connection;
package io.ballerina.lib.redis.connection;

import io.ballerina.lib.redis.exceptions.RedisConnectorException;
import io.ballerina.runtime.api.utils.StringUtils;
import io.ballerina.runtime.api.values.BMap;
import io.ballerina.runtime.api.values.BString;
Expand All @@ -40,7 +41,6 @@
import io.lettuce.core.support.ConnectionPoolSupport;
import org.apache.commons.pool2.impl.GenericObjectPool;
import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
import org.ballerinalang.redis.exceptions.RedisConnectorException;

import java.time.Duration;
import java.util.ArrayList;
Expand All @@ -49,12 +49,12 @@
import java.util.function.Supplier;
import java.util.stream.Collectors;

import static org.ballerinalang.redis.utils.Constants.CONFIG_CLIENT_NAME;
import static org.ballerinalang.redis.utils.Constants.CONFIG_CONNECTION_TIMEOUT;
import static org.ballerinalang.redis.utils.Constants.CONFIG_DATABASE;
import static org.ballerinalang.redis.utils.Constants.CONFIG_SSL_ENABLED;
import static org.ballerinalang.redis.utils.Constants.CONFIG_START_TLS_ENABLED;
import static org.ballerinalang.redis.utils.Constants.CONFIG_VERIFY_PEER_ENABLED;
import static io.ballerina.lib.redis.utils.Constants.CONFIG_CLIENT_NAME;
import static io.ballerina.lib.redis.utils.Constants.CONFIG_CONNECTION_TIMEOUT;
import static io.ballerina.lib.redis.utils.Constants.CONFIG_DATABASE;
import static io.ballerina.lib.redis.utils.Constants.CONFIG_SSL_ENABLED;
import static io.ballerina.lib.redis.utils.Constants.CONFIG_START_TLS_ENABLED;
import static io.ballerina.lib.redis.utils.Constants.CONFIG_VERIFY_PEER_ENABLED;

/**
* Connection manager implementation for Redis connections.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@
* under the License.
*/

package org.ballerinalang.redis.connection;
package io.ballerina.lib.redis.connection;

import io.ballerina.lib.redis.exceptions.RedisConnectorException;
import io.ballerina.runtime.api.values.BArray;
import io.ballerina.runtime.api.values.BMap;
import io.ballerina.runtime.api.values.BString;
import io.lettuce.core.KeyValue;
import io.lettuce.core.RedisException;
import io.lettuce.core.api.sync.RedisHashCommands;
import org.ballerinalang.redis.exceptions.RedisConnectorException;

import java.util.List;
import java.util.Map;

import static org.ballerinalang.redis.utils.Constants.KEY_MUST_NOT_BE_NULL;
import static org.ballerinalang.redis.utils.Constants.MUST_NOT_BE_NULL;
import static org.ballerinalang.redis.utils.Constants.REDIS_SERVER_ERROR;
import static org.ballerinalang.redis.utils.ConversionUtils.createBMapFromKeyValueList;
import static org.ballerinalang.redis.utils.ConversionUtils.createBMapFromMap;
import static org.ballerinalang.redis.utils.ConversionUtils.createBStringArrayFromList;
import static io.ballerina.lib.redis.utils.Constants.KEY_MUST_NOT_BE_NULL;
import static io.ballerina.lib.redis.utils.Constants.MUST_NOT_BE_NULL;
import static io.ballerina.lib.redis.utils.Constants.REDIS_SERVER_ERROR;
import static io.ballerina.lib.redis.utils.ConversionUtils.createBMapFromKeyValueList;
import static io.ballerina.lib.redis.utils.ConversionUtils.createBMapFromMap;
import static io.ballerina.lib.redis.utils.ConversionUtils.createBStringArrayFromList;

/**
* Executor implementation for Redis hash commands.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
* under the License.
*/

package org.ballerinalang.redis.connection;
package io.ballerina.lib.redis.connection;

import io.ballerina.lib.redis.exceptions.RedisConnectorException;
import io.ballerina.runtime.api.values.BArray;
import io.lettuce.core.RedisException;
import io.lettuce.core.api.sync.RedisKeyCommands;
import org.ballerinalang.redis.exceptions.RedisConnectorException;

import java.util.List;

import static org.ballerinalang.redis.utils.Constants.KEYS_MUST_NOT_BE_NULL;
import static org.ballerinalang.redis.utils.Constants.KEY_MUST_NOT_BE_NULL;
import static org.ballerinalang.redis.utils.Constants.REDIS_SERVER_ERROR;
import static org.ballerinalang.redis.utils.ConversionUtils.createBStringArrayFromList;
import static io.ballerina.lib.redis.utils.Constants.KEYS_MUST_NOT_BE_NULL;
import static io.ballerina.lib.redis.utils.Constants.KEY_MUST_NOT_BE_NULL;
import static io.ballerina.lib.redis.utils.Constants.REDIS_SERVER_ERROR;
import static io.ballerina.lib.redis.utils.ConversionUtils.createBStringArrayFromList;

/**
* Executor implementation for Redis key commands.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
* under the License.
*/

package org.ballerinalang.redis.connection;
package io.ballerina.lib.redis.connection;

import io.ballerina.lib.redis.exceptions.RedisConnectorException;
import io.ballerina.runtime.api.creators.ValueCreator;
import io.ballerina.runtime.api.utils.StringUtils;
import io.ballerina.runtime.api.values.BArray;
Expand All @@ -26,15 +27,14 @@
import io.lettuce.core.KeyValue;
import io.lettuce.core.RedisException;
import io.lettuce.core.api.sync.RedisListCommands;
import org.ballerinalang.redis.exceptions.RedisConnectorException;

import java.util.List;

import static org.ballerinalang.redis.utils.Constants.ARGUMENTS_MUST_NOT_BE_NULL;
import static org.ballerinalang.redis.utils.Constants.KEYS_MUST_NOT_BE_NULL;
import static org.ballerinalang.redis.utils.Constants.KEY_MUST_NOT_BE_NULL;
import static org.ballerinalang.redis.utils.Constants.REDIS_SERVER_ERROR;
import static org.ballerinalang.redis.utils.ConversionUtils.createBStringArrayFromList;
import static io.ballerina.lib.redis.utils.Constants.ARGUMENTS_MUST_NOT_BE_NULL;
import static io.ballerina.lib.redis.utils.Constants.KEYS_MUST_NOT_BE_NULL;
import static io.ballerina.lib.redis.utils.Constants.KEY_MUST_NOT_BE_NULL;
import static io.ballerina.lib.redis.utils.Constants.REDIS_SERVER_ERROR;
import static io.ballerina.lib.redis.utils.ConversionUtils.createBStringArrayFromList;

/**
* Executor implementation for Redis key commands.
Expand Down
Loading

0 comments on commit 7c226c9

Please sign in to comment.