mirror of https://github.com/apache/cassandra
Merge from 0.8
git-svn-id: https://svn.apache.org/repos/asf/cassandra/trunk@1096065 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
33573ea224
commit
fb85fcecaf
|
|
@ -1,3 +1,7 @@
|
|||
0.8.0-?
|
||||
* fix NPE compacting index CFs (CASSANDRA-2528)
|
||||
* Remove checking all column families on startup for compaction candidates (CASSANDRA-2444)
|
||||
|
||||
0.8.0-beta1
|
||||
* remove Avro RPC support (CASSANDRA-926)
|
||||
* adds support for columns that act as incr/decr counters
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ h2. UPDATE
|
|||
_Synopsis:_
|
||||
|
||||
bc.
|
||||
UPDATE <COLUMN FAMILY> [USING CONSISTENCY <CL>]
|
||||
UPDATE <COLUMN FAMILY> [USING <CONSISTENCY>]
|
||||
SET name1 = value1, name2 = value2 WHERE KEY = keyname;
|
||||
|
||||
An @UPDATE@ is used to write one or more columns to a record in a Cassandra column family. No results are returned.
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ import org.slf4j.LoggerFactory;
|
|||
import org.apache.cassandra.config.CFMetaData;
|
||||
import org.apache.cassandra.config.DatabaseDescriptor;
|
||||
import org.apache.cassandra.db.filter.QueryPath;
|
||||
import org.apache.cassandra.db.marshal.AbstractCommutativeType;
|
||||
import org.apache.cassandra.db.marshal.AbstractType;
|
||||
import org.apache.cassandra.db.marshal.MarshalException;
|
||||
import org.apache.cassandra.io.IColumnSerializer;
|
||||
|
|
@ -49,6 +48,7 @@ public class ColumnFamily implements IColumnContainer, IIterableColumns
|
|||
|
||||
/* The column serializer for this Column Family. Create based on config. */
|
||||
private static ColumnFamilySerializer serializer = new ColumnFamilySerializer();
|
||||
private final CFMetaData cfm;
|
||||
|
||||
public static ColumnFamilySerializer serializer()
|
||||
{
|
||||
|
|
@ -67,29 +67,25 @@ public class ColumnFamily implements IColumnContainer, IIterableColumns
|
|||
|
||||
public static ColumnFamily create(CFMetaData cfm)
|
||||
{
|
||||
assert cfm != null;
|
||||
return new ColumnFamily(cfm.cfType, cfm.comparator, cfm.subcolumnComparator, cfm.cfId);
|
||||
return new ColumnFamily(cfm);
|
||||
}
|
||||
|
||||
private final Integer cfid;
|
||||
private final ColumnFamilyType type;
|
||||
|
||||
private transient IColumnSerializer columnSerializer;
|
||||
final AtomicLong markedForDeleteAt = new AtomicLong(Long.MIN_VALUE);
|
||||
final AtomicInteger localDeletionTime = new AtomicInteger(Integer.MIN_VALUE);
|
||||
private ConcurrentSkipListMap<ByteBuffer, IColumn> columns;
|
||||
|
||||
public ColumnFamily(ColumnFamilyType type, AbstractType comparator, AbstractType subcolumnComparator, Integer cfid)
|
||||
public ColumnFamily(CFMetaData cfm)
|
||||
{
|
||||
this.type = type;
|
||||
columnSerializer = type == ColumnFamilyType.Standard ? Column.serializer() : SuperColumn.serializer(subcolumnComparator);
|
||||
columns = new ConcurrentSkipListMap<ByteBuffer, IColumn>(comparator);
|
||||
this.cfid = cfid;
|
||||
assert cfm != null;
|
||||
this.cfm = cfm;
|
||||
columnSerializer = cfm.cfType == ColumnFamilyType.Standard ? Column.serializer() : SuperColumn.serializer(cfm.subcolumnComparator);
|
||||
columns = new ConcurrentSkipListMap<ByteBuffer, IColumn>(cfm.comparator);
|
||||
}
|
||||
|
||||
public ColumnFamily cloneMeShallow()
|
||||
{
|
||||
ColumnFamily cf = new ColumnFamily(type, getComparator(), getSubComparator(), cfid);
|
||||
ColumnFamily cf = new ColumnFamily(cfm);
|
||||
cf.markedForDeleteAt.set(markedForDeleteAt.get());
|
||||
cf.localDeletionTime.set(localDeletionTime.get());
|
||||
return cf;
|
||||
|
|
@ -100,9 +96,9 @@ public class ColumnFamily implements IColumnContainer, IIterableColumns
|
|||
return (columnSerializer instanceof SuperColumnSerializer) ? ((SuperColumnSerializer)columnSerializer).getComparator() : null;
|
||||
}
|
||||
|
||||
public ColumnFamilyType getColumnFamilyType()
|
||||
public ColumnFamilyType getType()
|
||||
{
|
||||
return type;
|
||||
return cfm.cfType;
|
||||
}
|
||||
|
||||
public ColumnFamily cloneMe()
|
||||
|
|
@ -114,15 +110,15 @@ public class ColumnFamily implements IColumnContainer, IIterableColumns
|
|||
|
||||
public Integer id()
|
||||
{
|
||||
return cfid;
|
||||
return cfm.cfId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The CFMetaData for this row, or null if the column family was dropped.
|
||||
* @return The CFMetaData for this row
|
||||
*/
|
||||
public CFMetaData metadata()
|
||||
{
|
||||
return DatabaseDescriptor.getCFMetaData(cfid);
|
||||
return cfm;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -148,7 +144,7 @@ public class ColumnFamily implements IColumnContainer, IIterableColumns
|
|||
|
||||
public boolean isSuper()
|
||||
{
|
||||
return type == ColumnFamilyType.Super;
|
||||
return getType() == ColumnFamilyType.Super;
|
||||
}
|
||||
|
||||
public void addColumn(QueryPath path, ByteBuffer value, long timestamp)
|
||||
|
|
@ -294,7 +290,8 @@ public class ColumnFamily implements IColumnContainer, IIterableColumns
|
|||
*/
|
||||
public ColumnFamily diff(ColumnFamily cfComposite)
|
||||
{
|
||||
ColumnFamily cfDiff = new ColumnFamily(cfComposite.type, getComparator(), getSubComparator(), cfComposite.id());
|
||||
assert cfComposite.id().equals(id());
|
||||
ColumnFamily cfDiff = new ColumnFamily(cfm);
|
||||
if (cfComposite.getMarkedForDeleteAt() > getMarkedForDeleteAt())
|
||||
{
|
||||
cfDiff.delete(cfComposite.getLocalDeletionTime(), cfComposite.getMarkedForDeleteAt());
|
||||
|
|
|
|||
|
|
@ -169,10 +169,9 @@ public abstract class AbstractCassandraDaemon implements CassandraDaemon
|
|||
logger.warn("Unable to start GCInspector (currently only supported on the Sun JVM)");
|
||||
}
|
||||
|
||||
// replay the log if necessary and check for compaction candidates
|
||||
// replay the log if necessary
|
||||
CommitLog.recover();
|
||||
CompactionManager.instance.checkAllColumnFamilies();
|
||||
|
||||
|
||||
// check to see if CL.recovery modified the lastMigrationId. if it did, we need to re apply migrations. this isn't
|
||||
// the same as merely reloading the schema (which wouldn't perform file deletion after a DROP). The solution
|
||||
// is to read those migrations from disk and apply them.
|
||||
|
|
|
|||
|
|
@ -278,7 +278,7 @@ public class SSTableImport
|
|||
|
||||
for (Map.Entry<DecoratedKey, String> rowKey : decoratedKeys.entrySet())
|
||||
{
|
||||
if (columnFamily.getColumnFamilyType() == ColumnFamilyType.Super)
|
||||
if (columnFamily.getType() == ColumnFamilyType.Super)
|
||||
{
|
||||
addToSuperCF((Map<?, ?>) data.get(rowKey.getValue()), columnFamily);
|
||||
}
|
||||
|
|
@ -350,7 +350,7 @@ public class SSTableImport
|
|||
|
||||
if (tokenName.equals("START_ARRAY"))
|
||||
{
|
||||
if (columnFamily.getColumnFamilyType() == ColumnFamilyType.Super)
|
||||
if (columnFamily.getType() == ColumnFamilyType.Super)
|
||||
{
|
||||
throw new RuntimeException("Can't write Standard columns to the Super Column Family.");
|
||||
}
|
||||
|
|
@ -360,7 +360,7 @@ public class SSTableImport
|
|||
}
|
||||
else if (tokenName.equals("START_OBJECT"))
|
||||
{
|
||||
if (columnFamily.getColumnFamilyType() == ColumnFamilyType.Standard)
|
||||
if (columnFamily.getType() == ColumnFamilyType.Standard)
|
||||
{
|
||||
throw new RuntimeException("Can't write Super columns to the Standard Column Family.");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue