merge from 0.7

git-svn-id: https://svn.apache.org/repos/asf/cassandra/trunk@1087403 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Ellis 2011-03-31 18:38:10 +00:00
commit e07e88a612
5 changed files with 33 additions and 6 deletions

View File

@ -79,8 +79,7 @@
* fixes for cache save/load (CASSANDRA-2172, -2174)
* Handle whole-row deletions in CFOutputFormat (CASSANDRA-2014)
* Make memtable_flush_writers flush in parallel (CASSANDRA-2178)
* make key cache preheating default to false; enable with
-Dcompaction_preheat_key_cache=true (CASSANDRA-2175)
* Add compaction_preheat_key_cache option (CASSANDRA-2175)
* refactor stress.py to have only one copy of the format string
used for creating row keys (CASSANDRA-2108)
* validate index names for \w+ (CASSANDRA-2196)

View File

@ -119,6 +119,12 @@ public class Session
{
CommandLine cmd = parser.parse(availableOptions, arguments);
if (cmd.getArgs().length > 0)
{
System.err.println("Application does not allow arbitrary arguments: " + StringUtils.join(cmd.getArgList(), ", "));
System.exit(1);
}
if (cmd.hasOption("h"))
throw new IllegalArgumentException("help");

View File

@ -80,11 +80,12 @@ public class DropColumnFamily extends Migration
if (!clientMode)
{
cfs.snapshot(Table.getTimestampedSnapshotName(null));
CompactionManager.instance.getCompactionLock().lock();
cfs.flushLock.lock();
try
{
cfs.snapshot(Table.getTimestampedSnapshotName(null));
Table.open(ksm.name).dropCf(cfm.cfId);
}
finally

View File

@ -63,10 +63,10 @@ public class DropKeyspace extends Migration
CFMetaData.purge(cfm);
if (!clientMode)
{
cfs.snapshot(snapshotName);
cfs.flushLock.lock();
try
{
cfs.snapshot(snapshotName);
Table.open(ksm.name).dropCf(cfm.cfId);
}
finally

View File

@ -430,7 +430,7 @@ public class DefsTest extends CleanupHelper
assert ks != null;
final CFMetaData cfm = ks.cfMetaData().get("Standard2");
assert cfm != null;
// write some data, force a flush, then verify that files exist on disk.
RowMutation rm = new RowMutation(ks.name, dk.key);
for (int i = 0; i < 100; i++)
@ -471,7 +471,28 @@ public class DefsTest extends CleanupHelper
}
assert threw;
}
@Test
public void dropKSUnflushed() throws ConfigurationException, IOException, ExecutionException, InterruptedException
{
DecoratedKey dk = Util.dk("dropKs");
// sanity
final KSMetaData ks = DatabaseDescriptor.getTableDefinition("Keyspace3");
assert ks != null;
final CFMetaData cfm = ks.cfMetaData().get("Standard1");
assert cfm != null;
// write some data
RowMutation rm = new RowMutation(ks.name, dk.key);
for (int i = 0; i < 100; i++)
rm.add(new QueryPath(cfm.cfName, null, ByteBufferUtil.bytes(("col" + i))), ByteBufferUtil.bytes("anyvalue"), 1L);
rm.apply();
new DropKeyspace(ks.name).apply();
assert DatabaseDescriptor.getTableDefinition(ks.name) == null;
}
@Test
public void renameKs() throws ConfigurationException, IOException, ExecutionException, InterruptedException
{