skip the system table (keyspace) for cleanup, it's local-only. patch by jbellis; reviewed by Stu Hood for CASSANDRA-579

git-svn-id: https://svn.apache.org/repos/asf/incubator/cassandra/trunk@885572 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Ellis 2009-11-30 20:00:04 +00:00
parent afda4ac49d
commit 8e08487c26
3 changed files with 7 additions and 1 deletions

View File

@ -4,6 +4,7 @@
in clusters with multiple seeds (CASSANDRA-150)
* fix NPE in get_range_slice when no data is found (CASSANDRA-578)
* fix potential NPE in hinted handoff (CASSANDRA-585)
* fix cleanup of local "system" keyspace (CASSANDRA-576)
0.5.0 beta

View File

@ -248,6 +248,9 @@ public class Table
*/
public void forceCleanup()
{
if (table_.equals("system"))
throw new RuntimeException("Cleanup of the system table is neither necessary nor wise");
Set<String> columnFamilies = tableMetadata_.getColumnFamilies();
for ( String columnFamily : columnFamilies )
{

View File

@ -586,8 +586,10 @@ public final class StorageService implements IEndPointStateChangeSubscriber, Sto
public void forceTableCleanup() throws IOException
{
List<String> tables = DatabaseDescriptor.getTables();
for ( String tName : tables )
for (String tName : tables)
{
if (tName.equals("system"))
continue;
Table table = Table.open(tName);
table.forceCleanup();
}