You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2021/09/07 13:00:51 UTC

[GitHub] [accumulo] EdColeman commented on a change in pull request #2240: Prevent compactions from starting when deleting a table

EdColeman commented on a change in pull request #2240:
URL: https://github.com/apache/accumulo/pull/2240#discussion_r703481006



##########
File path: server/manager/src/main/java/org/apache/accumulo/manager/tableOps/compact/CompactionDriver.java
##########
@@ -82,6 +82,14 @@ public long isReady(long tid, Manager manager) throws Exception {
           TableOperation.COMPACT, TableOperationExceptionType.OTHER, "Compaction canceled");
     }
 
+    String deleteMarkerPath = Constants.ZROOT + "/" + manager.getInstanceID() + Constants.ZTABLES

Review comment:
       Is there a logical place where this could be a static function that takes instanceId and tableId and returns the path?  Its used multiple times in this code and all look correct, but seems it could be cleaner to have it just once.  I know this is common, but maybe something we can start to move away from?

##########
File path: server/manager/src/test/java/org/apache/accumulo/manager/tableOps/compact/CompactionDriverTest.java
##########
@@ -0,0 +1,135 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.accumulo.manager.tableOps.compact;
+
+import static org.junit.Assert.fail;
+
+import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.clientImpl.AcceptableThriftTableOperationException;
+import org.apache.accumulo.core.clientImpl.thrift.TableOperation;
+import org.apache.accumulo.core.clientImpl.thrift.TableOperationExceptionType;
+import org.apache.accumulo.core.data.NamespaceId;
+import org.apache.accumulo.core.data.TableId;
+import org.apache.accumulo.fate.zookeeper.ZooReaderWriter;
+import org.apache.accumulo.manager.Manager;
+import org.apache.accumulo.server.ServerContext;
+import org.easymock.EasyMock;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.powermock.api.easymock.PowerMock;
+import org.powermock.core.classloader.annotations.PowerMockIgnore;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest(CompactionDriver.class)
+@PowerMockIgnore({"org.apache.logging.*", "javax.management.*", "org.slf4j.*"})
+public class CompactionDriverTest {
+
+  @Test
+  public void testCancelId() throws Exception {
+
+    final String instance = "test-instance";

Review comment:
       Could this be:
   ```
      final String instance = UUID.randomUUID().toString();
   ```
   




-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org