avoid unnecessarily serializations of RowMutations from both CommitLog and RowMutationVerbHandlers. patch by gdusbabek and jbellis; reviewed by goffinet for CASSANDRA-652

git-svn-id: https://svn.apache.org/repos/asf/incubator/cassandra/branches/cassandra-0.5@893619 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Ellis 2009-12-23 20:11:07 +00:00
parent fd69da30b1
commit e2cf8a2887
5 changed files with 8 additions and 10 deletions

View File

@ -16,6 +16,8 @@
* fix bug determining closest neighbor for use in multiple datacenters
(CASSANDRA-648)
* Vast improvements in anticompaction speed (CASSANDRA-607)
* Speed up log replay and writes by avoiding redundant serializations
(CASSANDRA-652)
0.5.0 beta 2

View File

@ -358,7 +358,7 @@ public class CommitLog
{
try
{
rm.apply(false);
Table.open(rm.getTable()).apply(rm, null, false);
}
catch (IOException e)
{
@ -453,7 +453,7 @@ public class CommitLog
* of any problems. This way we can assume that the subsequent commit log
* entry will override the garbage left over by the previous write.
*/
void add(RowMutation rowMutation, DataOutputBuffer serializedRow) throws IOException
void add(RowMutation rowMutation, Object serializedRow) throws IOException
{
Callable<CommitLogContext> task = new LogRecordAdder(rowMutation, serializedRow);
@ -621,7 +621,7 @@ public class CommitLog
final RowMutation rowMutation;
final Object serializedRow;
LogRecordAdder(RowMutation rm, DataOutputBuffer serializedRow)
LogRecordAdder(RowMutation rm, Object serializedRow)
{
this.rowMutation = rm;
this.serializedRow = serializedRow;

View File

@ -200,12 +200,7 @@ public class RowMutation implements Serializable
*/
public void apply() throws IOException
{
apply(true);
}
public void apply(boolean writeCommitLog) throws IOException
{
Table.open(table_).apply(this, this.getSerializedBuffer(), writeCommitLog);
Table.open(table_).apply(this, getSerializedBuffer(), true);
}
/*

View File

@ -58,6 +58,7 @@ public class RowMutationVerbHandler implements IVerbHandler
hintedMutation.apply();
}
Table.open(rm.getTable()).apply(rm, bytes, true);
rm.apply();
WriteResponse response = new WriteResponse(rm.getTable(), rm.key(), true);

View File

@ -428,7 +428,7 @@ public class Table
* Once this happens the data associated with the individual column families
* is also written to the column family store's memtable.
*/
void apply(RowMutation mutation, DataOutputBuffer serializedMutation, boolean writeCommitLog) throws IOException
void apply(RowMutation mutation, Object serializedMutation, boolean writeCommitLog) throws IOException
{
HashMap<ColumnFamilyStore,Memtable> memtablesToFlush = new HashMap<ColumnFamilyStore, Memtable>(2);