Permalink
Browse files

merge from 2.0

  • Loading branch information...
2 parents 38a3181 + 319b42e commit b41eb4ad7216c844a229ff8b90e268ccfcb596c9 @jbellis jbellis committed Feb 28, 2014
View
@@ -10,6 +10,7 @@
Merged from 2.0:
* Pool CqlRecordWriter clients by inetaddress rather than Range
(CASSANDRA-6665)
+ * Fix compaction_history timestamps (CASSANDRA-6784)
2.1.0-beta1
@@ -423,12 +423,12 @@ public int getMeanColumns()
return data.getMeanColumns();
}
- public static ColumnFamilyStore createColumnFamilyStore(Keyspace keyspace, String columnFamily, boolean loadSSTables)
+ public static ColumnFamilyStore createColumnFamilyStore(Keyspace keyspace, String columnFamily, boolean loadSSTables) throws ConfigurationException
{
return createColumnFamilyStore(keyspace, columnFamily, StorageService.getPartitioner(), Schema.instance.getCFMetaData(keyspace.getName(), columnFamily), loadSSTables);
}
- public static ColumnFamilyStore createColumnFamilyStore(Keyspace keyspace, String columnFamily, IPartitioner partitioner, CFMetaData metadata)
+ public static ColumnFamilyStore createColumnFamilyStore(Keyspace keyspace, String columnFamily, IPartitioner partitioner, CFMetaData metadata) throws ConfigurationException
{
return createColumnFamilyStore(keyspace, columnFamily, partitioner, metadata, true);
}
@@ -437,7 +437,7 @@ private static synchronized ColumnFamilyStore createColumnFamilyStore(Keyspace k
String columnFamily,
IPartitioner partitioner,
CFMetaData metadata,
- boolean loadSSTables)
+ boolean loadSSTables) throws ConfigurationException
{
// get the max generation number, to prevent generation conflicts
Directories directories = new Directories(metadata);
@@ -448,7 +448,8 @@ private static synchronized ColumnFamilyStore createColumnFamilyStore(Keyspace k
Descriptor desc = entry.getKey();
generations.add(desc.generation);
if (!desc.isCompatible())
- throw new RuntimeException(String.format("Can't open incompatible SSTable! Current version %s, found file: %s", Descriptor.Version.CURRENT, desc));
+ throw new ConfigurationException(String.format("Incompatible SSTable found. Current version %s is unable to read file: %s. Please run upgradesstables.",
+ Descriptor.Version.CURRENT, desc));
}
Collections.sort(generations);
int value = (generations.size() > 0) ? (generations.get(generations.size() - 1)) : 0;
@@ -283,7 +283,7 @@ public boolean apply(SSTableReader sstable)
mergedRows.put(rows, count);
}
- SystemKeyspace.updateCompactionHistory(cfs.keyspace.getName(), cfs.name, start, startsize, endsize, mergedRows);
+ SystemKeyspace.updateCompactionHistory(cfs.keyspace.getName(), cfs.name, System.currentTimeMillis(), startsize, endsize, mergedRows);
logger.info(String.format("Compacted %d sstables to [%s]. %,d bytes to %,d (~%d%% of original) in %,dms = %fMB/s. %,d total partitions merged to %,d. Partition merge counts were {%s}",
toCompact.size(), builder.toString(), startsize, endsize, (int) (ratio * 100), dTime, mbps, totalSourceRows, totalKeysWritten, mergeSummary.toString()));
logger.debug(String.format("CF Total Bytes Compacted: %,d", CompactionTask.addToTotalBytesCompacted(endsize)));

0 comments on commit b41eb4a

Please sign in to comment.