HBASE-5472 LoadIncrementalHFiles loops forever if the target table misses a CF -- REVERT. BROKE BUILD
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1471137 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e34b0e5723
commit
9b36388597
|
@ -220,26 +220,6 @@ public class LoadIncrementalHFiles extends Configured implements Tool {
|
||||||
Deque<LoadQueueItem> queue = new LinkedList<LoadQueueItem>();
|
Deque<LoadQueueItem> queue = new LinkedList<LoadQueueItem>();
|
||||||
try {
|
try {
|
||||||
discoverLoadQueue(queue, hfofDir);
|
discoverLoadQueue(queue, hfofDir);
|
||||||
// check whether there is invalid family name in HFiles to be bulkloaded
|
|
||||||
Collection<HColumnDescriptor> families = table.getTableDescriptor().getFamilies();
|
|
||||||
ArrayList<String> familyNames = new ArrayList<String>();
|
|
||||||
for (HColumnDescriptor family : families) {
|
|
||||||
familyNames.add(family.getNameAsString());
|
|
||||||
}
|
|
||||||
ArrayList<String> unmatchedFamilies = new ArrayList<String>();
|
|
||||||
for (LoadQueueItem lqi : queue) {
|
|
||||||
String familyNameInHFile = Bytes.toString(lqi.family);
|
|
||||||
if (!familyNames.contains(familyNameInHFile)) {
|
|
||||||
unmatchedFamilies.add(familyNameInHFile);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (unmatchedFamilies.size() > 0) {
|
|
||||||
String msg = "Unmatched family names found: unmatched family names in HFiles to be bulkloaded: "
|
|
||||||
+ unmatchedFamilies + "; valid family names of table "
|
|
||||||
+ Bytes.toString(table.getTableName()) + " are: " + familyNames;
|
|
||||||
LOG.error(msg);
|
|
||||||
throw new IOException(msg);
|
|
||||||
}
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
if (queue.isEmpty()) {
|
if (queue.isEmpty()) {
|
||||||
|
|
|
@ -53,7 +53,6 @@ import org.junit.experimental.categories.Category;
|
||||||
public class TestLoadIncrementalHFiles {
|
public class TestLoadIncrementalHFiles {
|
||||||
private static final byte[] QUALIFIER = Bytes.toBytes("myqual");
|
private static final byte[] QUALIFIER = Bytes.toBytes("myqual");
|
||||||
private static final byte[] FAMILY = Bytes.toBytes("myfam");
|
private static final byte[] FAMILY = Bytes.toBytes("myfam");
|
||||||
private static final String EXPECTED_MSG_FOR_NON_EXISTING_FAMILY = "invalid family name found";
|
|
||||||
|
|
||||||
private static final byte[][] SPLIT_KEYS = new byte[][] {
|
private static final byte[][] SPLIT_KEYS = new byte[][] {
|
||||||
Bytes.toBytes("ddd"),
|
Bytes.toBytes("ddd"),
|
||||||
|
@ -189,11 +188,6 @@ public class TestLoadIncrementalHFiles {
|
||||||
|
|
||||||
HBaseAdmin admin = new HBaseAdmin(util.getConfiguration());
|
HBaseAdmin admin = new HBaseAdmin(util.getConfiguration());
|
||||||
HTableDescriptor htd = new HTableDescriptor(TABLE);
|
HTableDescriptor htd = new HTableDescriptor(TABLE);
|
||||||
// set real family name to upper case in purpose to simulate the case that
|
|
||||||
// family name in HFiles is invalid
|
|
||||||
HColumnDescriptor family =
|
|
||||||
new HColumnDescriptor(Bytes.toBytes(new String(FAMILY).toUpperCase()));
|
|
||||||
htd.addFamily(family);
|
|
||||||
admin.createTable(htd, SPLIT_KEYS);
|
admin.createTable(htd, SPLIT_KEYS);
|
||||||
|
|
||||||
HTable table = new HTable(util.getConfiguration(), TABLE);
|
HTable table = new HTable(util.getConfiguration(), TABLE);
|
||||||
|
@ -204,11 +198,6 @@ public class TestLoadIncrementalHFiles {
|
||||||
assertTrue("Loading into table with non-existent family should have failed", false);
|
assertTrue("Loading into table with non-existent family should have failed", false);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
assertTrue("IOException expected", e instanceof IOException);
|
assertTrue("IOException expected", e instanceof IOException);
|
||||||
// further check whether the exception message is correct
|
|
||||||
String errMsg = e.getMessage();
|
|
||||||
assertTrue("Incorrect exception message, expected message: ["
|
|
||||||
+ EXPECTED_MSG_FOR_NON_EXISTING_FAMILY + "], current message: [" + errMsg + "]",
|
|
||||||
errMsg.contains(EXPECTED_MSG_FOR_NON_EXISTING_FAMILY));
|
|
||||||
}
|
}
|
||||||
table.close();
|
table.close();
|
||||||
admin.close();
|
admin.close();
|
||||||
|
|
Loading…
Reference in New Issue