You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by kt...@apache.org on 2013/09/12 00:51:40 UTC
[2/3] git commit: ACCUMULO-1558 made import table fail when files do
not exist
ACCUMULO-1558 made import table fail when files do not exist
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/05206860
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/05206860
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/05206860
Branch: refs/heads/master
Commit: 052068601041f9d97a882ef3db0cc99f46cbf38a
Parents: f9efaf1
Author: Keith Turner <kt...@apache.org>
Authored: Wed Sep 11 18:43:19 2013 -0400
Committer: Keith Turner <kt...@apache.org>
Committed: Wed Sep 11 18:43:19 2013 -0400
----------------------------------------------------------------------
.../src/test/java/org/apache/accumulo/proxy/SimpleTest.java | 8 ++++++++
.../apache/accumulo/server/master/tableOps/ImportTable.java | 5 +++++
2 files changed, 13 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/05206860/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java
----------------------------------------------------------------------
diff --git a/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java b/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java
index 3e7e977..3fd0a8f 100644
--- a/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java
+++ b/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java
@@ -1031,6 +1031,14 @@ public class SimpleTest {
client.closeScanner(scanner);
assertEquals(10, more.results.size());
+ try {
+ // ACCUMULO-1558 a second import from the same dir should fail, the first import moved the files
+ client.importTable(creds, "testify2", destDir);
+ fail();
+ } catch (Exception e) {}
+
+ assertFalse(client.listTables(creds).contains("testify2"));
+
// Locality groups
client.createTable(creds, "test", true, TimeType.MILLIS);
Map<String,Set<String>> groups = new HashMap<String,Set<String>>();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/05206860/server/src/main/java/org/apache/accumulo/server/master/tableOps/ImportTable.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/master/tableOps/ImportTable.java b/server/src/main/java/org/apache/accumulo/server/master/tableOps/ImportTable.java
index 6c66ea4..b54e543 100644
--- a/server/src/main/java/org/apache/accumulo/server/master/tableOps/ImportTable.java
+++ b/server/src/main/java/org/apache/accumulo/server/master/tableOps/ImportTable.java
@@ -238,6 +238,11 @@ class PopulateMetadataTable extends MasterRepo {
String oldName = new Path(key.getColumnQualifier().toString()).getName();
String newName = fileNameMappings.get(oldName);
+ if (newName == null) {
+ throw new ThriftTableOperationException(tableInfo.tableId, tableInfo.tableName, TableOperation.IMPORT, TableOperationExceptionType.OTHER,
+ "File " + oldName + " does not exist in import dir");
+ }
+
cq = new Text("/" + bulkDir + "/" + newName);
} else {
cq = key.getColumnQualifier();