fix compaction regression. patch by jbellis; reviewed by Todd Lipcon and Jun Rao

for #80.

git-svn-id: https://svn.apache.org/repos/asf/incubator/cassandra/trunk@764679 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Ellis 2009-04-14 05:12:44 +00:00
parent a1ef3b5be5
commit 732695503b
2 changed files with 6 additions and 3 deletions

View File

@ -664,7 +664,7 @@ public class ColumnFamilyStore
{
try
{
fs = new FileStruct(SequenceFile.bufferedReader(file, bufferSize));
fs = new FileStruct(SequenceFile.bufferedReader(file, bufferSize), StorageService.getPartitioner());
fs.advance();
if(fs.isExhausted())
continue;

View File

@ -24,6 +24,7 @@ import org.apache.cassandra.io.DataInputBuffer;
import org.apache.cassandra.io.DataOutputBuffer;
import org.apache.cassandra.io.IFileReader;
import org.apache.cassandra.io.SSTable;
import org.apache.cassandra.service.IPartitioner;
public class FileStruct implements Comparable<FileStruct>
@ -33,10 +34,12 @@ public class FileStruct implements Comparable<FileStruct>
private IFileReader reader;
private DataInputBuffer bufIn;
private DataOutputBuffer bufOut;
private IPartitioner partitioner;
public FileStruct(IFileReader reader)
public FileStruct(IFileReader reader, IPartitioner partitioner)
{
this.reader = reader;
this.partitioner = partitioner;
bufIn = new DataInputBuffer();
bufOut = new DataOutputBuffer();
}
@ -68,7 +71,7 @@ public class FileStruct implements Comparable<FileStruct>
public int compareTo(FileStruct f)
{
return key.compareTo(f.key);
return partitioner.getDecoratedKeyComparator().compare(key, f.key);
}
/*