LiebingYu commented on code in PR #1380:
URL: https://github.com/apache/fluss/pull/1380#discussion_r2451990557
##########
fluss-client/src/main/java/org/apache/fluss/client/admin/Admin.java:
##########
@@ -492,4 +503,90 @@ ListOffsetsResult listOffsets(
* @return A CompletableFuture indicating completion of the operation.
*/
CompletableFuture<Void> alterClusterConfigs(Collection<AlterConfig>
configs);
+
+ /**
+ * Add server tag to the specified tabletServers, one tabletServer can
only have one serverTag.
+ *
+ * <p>If one tabletServer failed adding tag, none of the tags will take
effect.
+ *
+ * <ul>
+ * <li>{@link AuthorizationException} If the authenticated user doesn't
have reset config
+ * access to the cluster.
+ * <li>{@link ServerNotExistException} If the tabletServer in {@code
tabletServers} does not
+ * exist.
+ * <li>{@link ServerTagAlreadyExistException} If the server tag already
exists when {@code
+ * overWriteIfExists} is false.
+ * </ul>
+ *
+ * @param tabletServers the tabletServers we want to add server tags.
+ * @param serverTag the server tag to be added.
+ */
+ CompletableFuture<Void> addServerTag(List<Integer> tabletServers,
ServerTag serverTag);
+
+ /**
+ * Remove server tag from the specified tabletServers.
+ *
+ * <p>If one tabletServer failed removing tag, none of the tags will be
removed.
+ *
+ * <ul>
+ * <li>{@link AuthorizationException} If the authenticated user doesn't
have reset config
+ * access to the cluster.
+ * <li>{@link ServerNotExistException} If the tabletServer in {@code
tabletServers} does not
+ * exist.
+ * <li>{@link ServerTagNotExistException} If the server tag does not
exist when {@code
+ * overWriteIfExists} is false.
Review Comment:
Maybe `ignoreIfNotExists`? But I also didn't see any related parameter.
##########
fluss-client/src/main/java/org/apache/fluss/client/admin/Admin.java:
##########
@@ -492,4 +503,90 @@ ListOffsetsResult listOffsets(
* @return A CompletableFuture indicating completion of the operation.
*/
CompletableFuture<Void> alterClusterConfigs(Collection<AlterConfig>
configs);
+
+ /**
+ * Add server tag to the specified tabletServers, one tabletServer can
only have one serverTag.
+ *
+ * <p>If one tabletServer failed adding tag, none of the tags will take
effect.
+ *
+ * <ul>
+ * <li>{@link AuthorizationException} If the authenticated user doesn't
have reset config
+ * access to the cluster.
+ * <li>{@link ServerNotExistException} If the tabletServer in {@code
tabletServers} does not
+ * exist.
+ * <li>{@link ServerTagAlreadyExistException} If the server tag already
exists when {@code
+ * overWriteIfExists} is false.
+ * </ul>
+ *
+ * @param tabletServers the tabletServers we want to add server tags.
+ * @param serverTag the server tag to be added.
+ */
+ CompletableFuture<Void> addServerTag(List<Integer> tabletServers,
ServerTag serverTag);
+
+ /**
+ * Remove server tag from the specified tabletServers.
+ *
+ * <p>If one tabletServer failed removing tag, none of the tags will be
removed.
+ *
+ * <ul>
+ * <li>{@link AuthorizationException} If the authenticated user doesn't
have reset config
+ * access to the cluster.
+ * <li>{@link ServerNotExistException} If the tabletServer in {@code
tabletServers} does not
+ * exist.
+ * <li>{@link ServerTagNotExistException} If the server tag does not
exist when {@code
+ * overWriteIfExists} is false.
+ * </ul>
+ *
+ * @param tabletServers the tabletServers we want to remove server tags.
+ */
+ CompletableFuture<Void> removeServerTag(List<Integer> tabletServers,
ServerTag serverTag);
+
+ /**
+ * Based on the provided {@code priorityGoals}, Fluss performs load
balancing on the cluster's
+ * bucket load.
+ *
+ * <p>More details, Fluss collects the cluster's load information and
optimizes to perform load
+ * balancing according to the user-defined {@code priorityGoals}.
+ *
+ * <p>Currently, Fluss only supports one active rebalance task in the
cluster. If an uncompleted
+ * rebalance task exists, an {@link RebalanceFailureException} will be
thrown.
+ *
+ * <ul>
+ * <li>{@link AuthorizationException} If the authenticated user doesn't
have reset config
+ * access to the cluster.
+ * <li>{@link RebalanceFailureException} If the rebalance failed. Such
as there is an ongoing
+ * execution.
+ * </ul>
+ *
+ * @param priorityGoals the goals to be optimized.
+ * @param dryRun Calculate and return the rebalance optimization proposal,
but do not execute
+ * it.
+ * @return the generated rebalance plan for all the tableBuckets which
need to do rebalance.
+ */
+ CompletableFuture<Map<TableBucket, RebalancePlanForBucket>> rebalance(
+ List<GoalType> priorityGoals, boolean dryRun);
+
+ /**
+ * List the rebalance process.
+ *
+ * <ul>
+ * <li>{@link AuthorizationException} If the authenticated user doesn't
have reset config
+ * access to the cluster.
+ * <li>{@link NoRebalanceInProgressException} If there are no rebalance
tasks in progress.
+ * </ul>
+ *
+ * @return the rebalance process for all the tableBuckets doing rebalance.
+ */
+ CompletableFuture<Map<TableBucket, RebalanceResultForBucket>>
listRebalanceProcess();
+
+ /**
+ * Cannel the rebalance task.
+ *
+ * <ul>
+ * <li>{@link AuthorizationException} If the authenticated user doesn't
have reset config
+ * access to the cluster.
+ * <li>{@link NoRebalanceInProgressException} If there are no rebalance
tasks in progress.
Review Comment:
ditto
##########
fluss-rpc/src/main/java/org/apache/fluss/rpc/protocol/Errors.java:
##########
@@ -228,7 +232,15 @@ public enum Errors {
INVALID_ALTER_TABLE_EXCEPTION(
56, "The alter table is invalid.",
InvalidAlterTableException::new),
DELETION_DISABLED_EXCEPTION(
- 57, "Deletion operations are disabled on this table.",
DeletionDisabledException::new);
+ 57, "Deletion operations are disabled on this table.",
DeletionDisabledException::new),
+ SERVER_NOT_EXIST_EXCEPTION(58, "The server is not exist.",
ServerNotExistException::new),
+ SEVER_TAG_ALREADY_EXIST_EXCEPTION(
+ 59, "The server tag already exist.",
ServerTagAlreadyExistException::new),
+ SEVER_TAG_NOT_EXIST_EXCEPTION(
+ 60, "The server tag not exist.",
ServerTagAlreadyExistException::new),
Review Comment:
`ServerTagNotExistException`
##########
fluss-client/src/main/java/org/apache/fluss/client/admin/Admin.java:
##########
@@ -492,4 +503,90 @@ ListOffsetsResult listOffsets(
* @return A CompletableFuture indicating completion of the operation.
*/
CompletableFuture<Void> alterClusterConfigs(Collection<AlterConfig>
configs);
+
+ /**
+ * Add server tag to the specified tabletServers, one tabletServer can
only have one serverTag.
+ *
+ * <p>If one tabletServer failed adding tag, none of the tags will take
effect.
+ *
+ * <ul>
+ * <li>{@link AuthorizationException} If the authenticated user doesn't
have reset config
+ * access to the cluster.
+ * <li>{@link ServerNotExistException} If the tabletServer in {@code
tabletServers} does not
+ * exist.
+ * <li>{@link ServerTagAlreadyExistException} If the server tag already
exists when {@code
+ * overWriteIfExists} is false.
+ * </ul>
+ *
+ * @param tabletServers the tabletServers we want to add server tags.
+ * @param serverTag the server tag to be added.
+ */
+ CompletableFuture<Void> addServerTag(List<Integer> tabletServers,
ServerTag serverTag);
Review Comment:
Is `overWriteIfExists` missed?
##########
fluss-client/src/main/java/org/apache/fluss/client/admin/Admin.java:
##########
@@ -492,4 +503,90 @@ ListOffsetsResult listOffsets(
* @return A CompletableFuture indicating completion of the operation.
*/
CompletableFuture<Void> alterClusterConfigs(Collection<AlterConfig>
configs);
+
+ /**
+ * Add server tag to the specified tabletServers, one tabletServer can
only have one serverTag.
+ *
+ * <p>If one tabletServer failed adding tag, none of the tags will take
effect.
+ *
+ * <ul>
+ * <li>{@link AuthorizationException} If the authenticated user doesn't
have reset config
+ * access to the cluster.
+ * <li>{@link ServerNotExistException} If the tabletServer in {@code
tabletServers} does not
+ * exist.
+ * <li>{@link ServerTagAlreadyExistException} If the server tag already
exists when {@code
+ * overWriteIfExists} is false.
+ * </ul>
+ *
+ * @param tabletServers the tabletServers we want to add server tags.
+ * @param serverTag the server tag to be added.
+ */
+ CompletableFuture<Void> addServerTag(List<Integer> tabletServers,
ServerTag serverTag);
+
+ /**
+ * Remove server tag from the specified tabletServers.
+ *
+ * <p>If one tabletServer failed removing tag, none of the tags will be
removed.
+ *
+ * <ul>
+ * <li>{@link AuthorizationException} If the authenticated user doesn't
have reset config
+ * access to the cluster.
+ * <li>{@link ServerNotExistException} If the tabletServer in {@code
tabletServers} does not
+ * exist.
+ * <li>{@link ServerTagNotExistException} If the server tag does not
exist when {@code
+ * overWriteIfExists} is false.
+ * </ul>
+ *
+ * @param tabletServers the tabletServers we want to remove server tags.
+ */
+ CompletableFuture<Void> removeServerTag(List<Integer> tabletServers,
ServerTag serverTag);
+
+ /**
+ * Based on the provided {@code priorityGoals}, Fluss performs load
balancing on the cluster's
+ * bucket load.
+ *
+ * <p>More details, Fluss collects the cluster's load information and
optimizes to perform load
+ * balancing according to the user-defined {@code priorityGoals}.
+ *
+ * <p>Currently, Fluss only supports one active rebalance task in the
cluster. If an uncompleted
+ * rebalance task exists, an {@link RebalanceFailureException} will be
thrown.
+ *
+ * <ul>
+ * <li>{@link AuthorizationException} If the authenticated user doesn't
have reset config
+ * access to the cluster.
Review Comment:
Not reset config access here?
##########
fluss-client/src/main/java/org/apache/fluss/client/admin/Admin.java:
##########
@@ -492,4 +503,90 @@ ListOffsetsResult listOffsets(
* @return A CompletableFuture indicating completion of the operation.
*/
CompletableFuture<Void> alterClusterConfigs(Collection<AlterConfig>
configs);
+
+ /**
+ * Add server tag to the specified tabletServers, one tabletServer can
only have one serverTag.
+ *
+ * <p>If one tabletServer failed adding tag, none of the tags will take
effect.
+ *
+ * <ul>
+ * <li>{@link AuthorizationException} If the authenticated user doesn't
have reset config
+ * access to the cluster.
+ * <li>{@link ServerNotExistException} If the tabletServer in {@code
tabletServers} does not
+ * exist.
+ * <li>{@link ServerTagAlreadyExistException} If the server tag already
exists when {@code
+ * overWriteIfExists} is false.
+ * </ul>
+ *
+ * @param tabletServers the tabletServers we want to add server tags.
+ * @param serverTag the server tag to be added.
+ */
+ CompletableFuture<Void> addServerTag(List<Integer> tabletServers,
ServerTag serverTag);
+
+ /**
+ * Remove server tag from the specified tabletServers.
+ *
+ * <p>If one tabletServer failed removing tag, none of the tags will be
removed.
+ *
+ * <ul>
+ * <li>{@link AuthorizationException} If the authenticated user doesn't
have reset config
+ * access to the cluster.
+ * <li>{@link ServerNotExistException} If the tabletServer in {@code
tabletServers} does not
+ * exist.
+ * <li>{@link ServerTagNotExistException} If the server tag does not
exist when {@code
+ * overWriteIfExists} is false.
+ * </ul>
+ *
+ * @param tabletServers the tabletServers we want to remove server tags.
+ */
+ CompletableFuture<Void> removeServerTag(List<Integer> tabletServers,
ServerTag serverTag);
+
+ /**
+ * Based on the provided {@code priorityGoals}, Fluss performs load
balancing on the cluster's
+ * bucket load.
+ *
+ * <p>More details, Fluss collects the cluster's load information and
optimizes to perform load
+ * balancing according to the user-defined {@code priorityGoals}.
+ *
+ * <p>Currently, Fluss only supports one active rebalance task in the
cluster. If an uncompleted
+ * rebalance task exists, an {@link RebalanceFailureException} will be
thrown.
+ *
+ * <ul>
+ * <li>{@link AuthorizationException} If the authenticated user doesn't
have reset config
+ * access to the cluster.
+ * <li>{@link RebalanceFailureException} If the rebalance failed. Such
as there is an ongoing
+ * execution.
+ * </ul>
+ *
+ * @param priorityGoals the goals to be optimized.
+ * @param dryRun Calculate and return the rebalance optimization proposal,
but do not execute
+ * it.
+ * @return the generated rebalance plan for all the tableBuckets which
need to do rebalance.
+ */
+ CompletableFuture<Map<TableBucket, RebalancePlanForBucket>> rebalance(
+ List<GoalType> priorityGoals, boolean dryRun);
+
+ /**
+ * List the rebalance process.
+ *
+ * <ul>
+ * <li>{@link AuthorizationException} If the authenticated user doesn't
have reset config
+ * access to the cluster.
Review Comment:
ditto
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]