Merge branch 'cassandra-2.1' into cassandra-2.2
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/59a32211 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/59a32211 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/59a32211 Branch: refs/heads/cassandra-2.2 Commit: 59a32211a01c6eb2ae694da0161006332a143947 Parents: f8783b7 ff9b6bb Author: Aleksey Yeschenko <alek...@apache.org> Authored: Fri Nov 6 19:21:28 2015 +0000 Committer: Aleksey Yeschenko <alek...@apache.org> Committed: Fri Nov 6 19:21:28 2015 +0000 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../org/apache/cassandra/tools/SSTableImport.java | 5 +++++ .../org/apache/cassandra/tools/SSTableImportTest.java | 14 +++++++++++--- 3 files changed, 17 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/59a32211/CHANGES.txt ---------------------------------------------------------------------- diff --cc CHANGES.txt index f47e1dd,8ff726e..814a924 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,13 -1,5 +1,14 @@@ -2.1.12 +2.2.4 + * (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645) + * Use most up-to-date version of schema for system tables (CASSANDRA-10652) + * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581,10628) + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: + * Improve json2sstable error reporting on nonexistent columns (CASSANDRA-10401) * (cqlsh) fix COPY using wrong variable name for time_format (CASSANDRA-10633) * Do not run SizeEstimatesRecorder if a node is not a member of the ring (CASSANDRA-9912) * Improve handling of dead nodes in gossip (CASSANDRA-10298) http://git-wip-us.apache.org/repos/asf/cassandra/blob/59a32211/src/java/org/apache/cassandra/tools/SSTableImport.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/59a32211/test/unit/org/apache/cassandra/tools/SSTableImportTest.java ---------------------------------------------------------------------- diff --cc test/unit/org/apache/cassandra/tools/SSTableImportTest.java index 814662c,77036e8..5eaf154 --- a/test/unit/org/apache/cassandra/tools/SSTableImportTest.java +++ b/test/unit/org/apache/cassandra/tools/SSTableImportTest.java @@@ -57,32 -46,20 +57,40 @@@ import org.apache.cassandra.db.columnit import org.apache.cassandra.db.filter.QueryFilter; import org.apache.cassandra.db.marshal.AsciiType; import org.apache.cassandra.db.marshal.BytesType; +import org.apache.cassandra.db.marshal.CounterColumnType; +import org.apache.cassandra.exceptions.ConfigurationException; import org.apache.cassandra.io.sstable.Descriptor; -import org.apache.cassandra.io.sstable.SSTableReader; +import org.apache.cassandra.locator.SimpleStrategy; - import org.apache.thrift.TException; -public class SSTableImportTest extends SchemaLoader +public class SSTableImportTest { + public static final String KEYSPACE1 = "SSTableImportTest"; + public static final String CF_STANDARD = "Standard1"; + public static final String CF_COUNTER = "Counter1"; + public static final String CQL_TABLE = "table1"; + + @BeforeClass + public static void defineSchema() throws ConfigurationException + { + SchemaLoader.prepareServer(); + SchemaLoader.createKeyspace(KEYSPACE1, + SimpleStrategy.class, + KSMetaData.optsWithRF(1), + SchemaLoader.standardCFMD(KEYSPACE1, CF_STANDARD), + SchemaLoader.standardCFMD(KEYSPACE1, CF_COUNTER).defaultValidator(CounterColumnType.instance), + SchemaLoader.standardCFMD(KEYSPACE1, "AsciiKeys").keyValidator(AsciiType.instance), + CFMetaData.compile("CREATE TABLE table1 (k int PRIMARY KEY, v1 text, v2 int)", KEYSPACE1)); + } + + @Test(expected = IllegalArgumentException.class) + public void testImportUnknownCf() throws IOException, URISyntaxException + { + // Import JSON to temp SSTable file + String jsonUrl = resourcePath("SimpleCF.json"); + File tempSS = tempSSTableFile("Keyspace1", "Standard1"); + new SSTableImport(true).importJson(jsonUrl, "UnknownKeyspace", "UnknownCF", tempSS.getPath()); + } + @Test public void testImportSimpleCf() throws IOException, URISyntaxException { @@@ -250,8 -229,8 +258,8 @@@ public void shouldRejectEmptyCellNamesForNonCqlTables() throws IOException, URISyntaxException { String jsonUrl = resourcePath("CQLTable.json"); -- File tempSS = tempSSTableFile("Keyspace1", "Counter1"); -- new SSTableImport(true).importJson(jsonUrl, "Keyspace1", "Counter1", tempSS.getPath()); ++ File tempSS = tempSSTableFile(KEYSPACE1, CF_COUNTER); ++ new SSTableImport(true).importJson(jsonUrl, KEYSPACE1, CF_COUNTER, tempSS.getPath()); } private static Matcher<UntypedResultSet.Row> withElements(final int key, final String v1, final int v2) {