mirror of https://github.com/apache/cassandra
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:
parent
a1ef3b5be5
commit
732695503b
|
|
@ -664,7 +664,7 @@ public class ColumnFamilyStore
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
fs = new FileStruct(SequenceFile.bufferedReader(file, bufferSize));
|
fs = new FileStruct(SequenceFile.bufferedReader(file, bufferSize), StorageService.getPartitioner());
|
||||||
fs.advance();
|
fs.advance();
|
||||||
if(fs.isExhausted())
|
if(fs.isExhausted())
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ import org.apache.cassandra.io.DataInputBuffer;
|
||||||
import org.apache.cassandra.io.DataOutputBuffer;
|
import org.apache.cassandra.io.DataOutputBuffer;
|
||||||
import org.apache.cassandra.io.IFileReader;
|
import org.apache.cassandra.io.IFileReader;
|
||||||
import org.apache.cassandra.io.SSTable;
|
import org.apache.cassandra.io.SSTable;
|
||||||
|
import org.apache.cassandra.service.IPartitioner;
|
||||||
|
|
||||||
|
|
||||||
public class FileStruct implements Comparable<FileStruct>
|
public class FileStruct implements Comparable<FileStruct>
|
||||||
|
|
@ -33,10 +34,12 @@ public class FileStruct implements Comparable<FileStruct>
|
||||||
private IFileReader reader;
|
private IFileReader reader;
|
||||||
private DataInputBuffer bufIn;
|
private DataInputBuffer bufIn;
|
||||||
private DataOutputBuffer bufOut;
|
private DataOutputBuffer bufOut;
|
||||||
|
private IPartitioner partitioner;
|
||||||
|
|
||||||
public FileStruct(IFileReader reader)
|
public FileStruct(IFileReader reader, IPartitioner partitioner)
|
||||||
{
|
{
|
||||||
this.reader = reader;
|
this.reader = reader;
|
||||||
|
this.partitioner = partitioner;
|
||||||
bufIn = new DataInputBuffer();
|
bufIn = new DataInputBuffer();
|
||||||
bufOut = new DataOutputBuffer();
|
bufOut = new DataOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|
@ -68,7 +71,7 @@ public class FileStruct implements Comparable<FileStruct>
|
||||||
|
|
||||||
public int compareTo(FileStruct f)
|
public int compareTo(FileStruct f)
|
||||||
{
|
{
|
||||||
return key.compareTo(f.key);
|
return partitioner.getDecoratedKeyComparator().compare(key, f.key);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue