-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for "vshard_router" option
Closes #463
- Loading branch information
Showing
18 changed files
with
218 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...ain/java/io/tarantool/driver/api/space/options/crud/OperationWithVshardRouterOptions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package io.tarantool.driver.api.space.options.crud; | ||
|
||
import java.util.Optional; | ||
|
||
import io.tarantool.driver.api.space.options.Options; | ||
import io.tarantool.driver.api.space.options.Self; | ||
import io.tarantool.driver.api.space.options.crud.enums.ProxyOption; | ||
|
||
/** | ||
* Base interface for all operation options that may have a configurable "vshard_router" value. | ||
*/ | ||
public interface OperationWithVshardRouterOptions<T extends OperationWithVshardRouterOptions<T>> | ||
extends Options, Self<T> { | ||
|
||
/** | ||
* Sets "vshard_router" option value. Cartridge vshard group name or vshard router instance. Set this parameter | ||
* if your space is not a part of the default vshard cluster. | ||
* | ||
* @param vshardRouter cartridge vshard group name or vshard router instance. Set this parameter if your space | ||
* is not a part of the default vshard cluster. | ||
* @return this options instance. | ||
* @throws IllegalArgumentException if vshardRouter is null or consists only of spaces. | ||
*/ | ||
default T withVshardRouter(String vshardRouter) throws IllegalArgumentException { | ||
if (vshardRouter.trim().isEmpty()) { | ||
throw new IllegalArgumentException("\"vshardRouter\" parameter cannot be empty or consist only of spaces."); | ||
} | ||
addOption(ProxyOption.VSHARD_ROUTER, vshardRouter); | ||
return self(); | ||
} | ||
|
||
/** | ||
* @return "vshard_router" option value. | ||
*/ | ||
default Optional<String> getVshardRouter() { | ||
return getOption(ProxyOption.VSHARD_ROUTER, String.class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.