keith-turner commented on code in PR #3294:
URL: https://github.com/apache/accumulo/pull/3294#discussion_r1165790730
##########
core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java:
##########
@@ -1014,39 +1014,15 @@ default TimeType getTimeType(String tableName) throws
TableNotFoundException {
}
/**
- * Initiates setting a table to an on-demand state, but does not wait for
action to complete
+ * Sets the hosting goal for a range of Tablets in the specified table.
*
- * @param tableName the table to set to an on-demand state
- * @throws AccumuloException when there is a general accumulo error
- * @throws AccumuloSecurityException when the user does not have the proper
permissions
- * @since 3.1.0
- */
- void onDemand(String tableName)
- throws AccumuloSecurityException, AccumuloException,
TableNotFoundException;
-
- /**
- * Initiates setting a table to an on-demand state, optionally waits for
action to complete
- *
- * @param tableName the table to set to an on-demand state
- * @param wait if true, then will not return until table state is set to an
on-demand state
- * @throws AccumuloException when there is a general accumulo error
- * @throws AccumuloSecurityException when the user does not have the proper
permissions
- * @since 3.1.0
- */
- void onDemand(String tableName, boolean wait)
- throws AccumuloSecurityException, AccumuloException,
TableNotFoundException;
-
- /**
- * Check if a table is on-demand through its current goal state only. Could
run into issues if the
- * current state of the table is in between states. If you require a
specific state, call
- * <code>onDemand(tableName, true)</code>, this will wait until the table
reaches the desired
- * state before proceeding.
- *
- * @param tableName the table to check if in an on-demand state
- * @throws AccumuloException when there is a general accumulo error
- * @return true if table's goal state is online
- * @since 3.1.0
+ * @param tableName table name
+ * @param range tablet range
+ * @param goal hosting goal (one of {@literal ALWAYS, DEFAULT, NEVER})
Review Comment:
> When a tablet is unloaded, it's hosting_goal column value is set to
default.
Seems like this should only change when a user changes it. If a user
specifies they want a tablet to always be hosted and the balancer moves the
tablet then its goal state should still be ALWAYS after the move.
> So there are 3 user states and 4 internal states. We need an internal
state for on-demand and don't host (default) and on-demand and host (ondemand)
Maybe we could have three user facing states `NEVER,ONDEMAND,ALWAYS` and two
columns in the metadata table. A `hosting_goal` column that stores the user
facing goal states. A `hosting_needed` column that is used to indicate a
tablet with an ondemand goal state needs hosting. The `hosting_goal` is only
modified by user operations. The `hosting_needed` is modified by the system as
needed.
> A non-existent hosting_goal column, or one with an empty Value, is treated
like default.
We could also treat any tablet with an unspecified hosting goal as an error
if we set them on upgrade and in initialization. Setting it on upgrade can
make the code simpler as it can be written with the expectation that its always
set.
--
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]