keith-turner commented on code in PR #5334:
URL: https://github.com/apache/accumulo/pull/5334#discussion_r1985662394
##########
server/manager/src/main/java/org/apache/accumulo/manager/tableOps/clone/CloneTable.java:
##########
@@ -34,23 +34,18 @@ public class CloneTable extends ManagerRepo {
private static final long serialVersionUID = 1L;
private final CloneInfo cloneInfo;
- public CloneTable(String user, NamespaceId namespaceId, TableId srcTableId,
String tableName,
- Map<String,String> propertiesToSet, Set<String> propertiesToExclude,
boolean keepOffline) {
- cloneInfo = new CloneInfo();
- cloneInfo.user = user;
- cloneInfo.srcTableId = srcTableId;
- cloneInfo.tableName = tableName;
- cloneInfo.propertiesToExclude = propertiesToExclude;
- cloneInfo.propertiesToSet = propertiesToSet;
- cloneInfo.srcNamespaceId = namespaceId;
- cloneInfo.keepOffline = keepOffline;
+ public CloneTable(String user, NamespaceId srcNamespaceId, TableId
srcTableId,
+ NamespaceId namespaceId, String tableName, Map<String,String>
propertiesToSet,
+ Set<String> propertiesToExclude, boolean keepOffline) {
+ cloneInfo = new CloneInfo(srcNamespaceId, srcTableId, namespaceId,
tableName, propertiesToSet,
+ propertiesToExclude, keepOffline, user);
}
@Override
public long isReady(long tid, Manager environment) throws Exception {
- long val = Utils.reserveNamespace(environment, cloneInfo.srcNamespaceId,
tid, false, true,
+ long val = Utils.reserveNamespace(environment, cloneInfo.getNamespaceId(),
tid, false, true,
TableOperation.CLONE);
- val += Utils.reserveTable(environment, cloneInfo.srcTableId, tid, false,
true,
+ val += Utils.reserveTable(environment, cloneInfo.getSrcTableId(), tid,
false, true,
Review Comment:
> The source namespace can't be deleted because the source table can't be
deleted. I don't think we care about the source namespace being renamed, so
long as we only look up the ID once. If a rename happens, we shouldn't care.
Just saw this comment, did not see when I posted the comment about #5389.
The model I assumed all fate table operations were following was :
1. All table operations get a read lock on the namespace they are operating
on
2. All destructive namespace operations get a write lock on the namespace.
Destructive namespace ops do not lock each table in the namespace, but the
assumption that every table op gets a namespace read lock makes this
unnecessary. If per table ops do not lock the namespace and namepsace ops do
not lock the tables then nothing prevents them from running concurrently.
--
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]