Buggy code:
public class ColumnFamilyStore implements ColumnFamilyStoreMBean { private static Logger logger = LoggerFactory . getLogger ( ColumnFamilyStore . class ) ; private static final ScheduledThreadPoolExecutor cacheSavingExecutor = new RetryingScheduledThreadPoolExecutor ( "CACHE-SAVER" , Thread . MIN_PRIORITY ) ; private static final ExecutorService flushSorter = new JMXEnabledThreadPoolExecutor ( 1 , Runtime . getRuntime ( ) . availableProcessors ( ) , StageManager . KEEPALIVE , TimeUnit . SECONDS , new LinkedBlockingQueue < Runnable > ( Runtime . getRuntime ( ) . availableProcessors ( ) ) , new NamedThreadFactory ( "FlushSorter" ) , "internal" ) ; private static final ExecutorService flushWriter = new JMXEnabledThreadPoolExecutor ( 1 , DatabaseDescriptor . getFlushWriters ( ) , StageManager . KEEPALIVE , TimeUnit . SECONDS , new LinkedBlockingQueue < Runnable > ( DatabaseDescriptor . getFlushWriters ( ) ) , new NamedThreadFactory ( "FlushWriter" ) , "internal" ) ; public static final ExecutorService postFlushExecutor = new JMXEnabledThreadPoolExecutor ( "MemtablePostFlusher" ) ; private Set < Memtable > memtablesPendingFlush = new ConcurrentSkipListSet < Memtable > ( ) ; public final Table table ; public final String columnFamily ; public final IPartitioner partitioner ; private final String mbeanName ; private volatile int memtableSwitchCount = 0 ; private AtomicInteger fileIndexGenerator = new AtomicInteger ( 0 ) ; private Memtable memtable ; private final SortedMap < byte [ ] , ColumnFamilyStore > indexedColumns ; private AtomicReference < BinaryMemtable > binaryMemtable ; private SSTableTracker ssTables ; private LatencyTracker readStats = new LatencyTracker ( ) ; private LatencyTracker writeStats = new LatencyTracker ( ) ; public final CFMetaData metadata ; private int minCompactionThreshold ; private int maxCompactionThreshold ; private final Runnable rowCacheSaverTask = new WrappedRunnable ( ) { protected void runMayThrow ( ) throws IOException { } } ; private final Runnable keyCacheSaverTask = new WrappedRunnable ( ) { protected void runMayThrow ( ) throws Exception { } } ; private ColumnFamilyStore ( Table table , String columnFamilyName , IPartitioner partitioner , int generation , CFMetaData metadata ) { } protected Set < DecoratedKey > readSavedCache ( File path ) { } public void addIndex ( final ColumnDefinition info ) { } public void buildSecondaryIndexes ( Collection < SSTableReader > sstables , SortedSet < byte [ ] > columns ) { } void unregisterMBean ( ) { } public long getMinRowSize ( ) { } public long getMaxRowSize ( ) { } public long getMeanRowSize ( ) { } public int getMeanColumns ( ) { } public static ColumnFamilyStore createColumnFamilyStore ( Table table , String columnFamily ) { } public static synchronized ColumnFamilyStore createColumnFamilyStore ( Table table , String columnFamily , IPartitioner partitioner , CFMetaData metadata ) { } public static void scrubDataDirectories ( String table , String columnFamily ) { } public void initRowCache ( ) { } public Future < ? > submitRowCacheWrite ( ) { } public Future < ? > submitKeyCacheWrite ( ) { } private static Map < Descriptor , Set < Component > > files ( String keyspace , final String columnFamily , final boolean includeCompacted ) { } public String getColumnFamilyName ( ) { } public String getFlushPath ( ) { <START_BUG> long guessedSize = ( ( 2 * ( DatabaseDescriptor . getMemtableThroughput ( ) ) ) * 1024 ) * 1024 ; <END_BUG> String location = DatabaseDescriptor . getDataFileLocationForTable ( table . name , guessedSize ) ; if ( location == null ) throw new RuntimeException ( "Insufficient<seq2seq4repair_space>disk<seq2seq4repair_space>space<seq2seq4repair_space>to<seq2seq4repair_space>flush" ) ; return getTempSSTablePath ( location ) ; } public String getTempSSTablePath ( String directory ) { } Future < ? > maybeSwitchMemtable ( Memtable oldMemtable , final boolean writeCommitLog ) { } void switchBinaryMemtable ( DecoratedKey key , byte [ ] buffer ) { } public void forceFlushIfExpired ( ) { } public Future < ? > forceFlush ( ) { } public void forceBlockingFlush ( ) throws InterruptedException , ExecutionException { } public void forceFlushBinary ( ) { } Memtable apply ( DecoratedKey key , ColumnFamily columnFamily ) { } void applyBinary ( DecoratedKey key , byte [ ] buffer ) { } public static ColumnFamily removeDeletedCF ( ColumnFamily cf , int gcBefore ) { } public static ColumnFamily removeDeleted ( ColumnFamily cf , int gcBefore ) { } private static void removeDeletedColumnsOnly ( ColumnFamily cf , int gcBefore ) { } private static void removeDeletedStandard ( ColumnFamily cf , int gcBefore ) { } private static void removeDeletedSuper ( ColumnFamily cf , int gcBefore ) { } public boolean isKeyInRemainingSSTables ( DecoratedKey key , Set < SSTable > sstablesToIgnore ) { } public void addSSTable ( SSTableReader sstable ) { } long getExpectedCompactedFileSize ( Iterable < SSTableReader > sstables ) { } SSTableReader getMaxSizeFile ( Iterable < SSTableReader > sstables ) { } void forceCleanup ( ) throws InterruptedException , ExecutionException { } void markCompacted ( Collection < SSTableReader > sstables ) { } boolean isCompleteSSTables ( Collection < SSTableReader > sstables ) { } void replaceCompactedSSTables ( Collection < SSTableReader > sstables , Iterable < SSTableReader > replacements ) { } public void removeAllSSTables ( ) { } void submitFlush ( IFlushable flushable , CountDownLatch latch ) { } public int getMemtableColumnsCount ( ) { } public int getMemtableDataSize ( ) { } public int getMemtableSwitchCount ( ) { } private Memtable getMemtableThreadSafe ( ) { } public Collection < SSTableReader > getSSTables ( ) { } public long getReadCount ( ) { } public double getRecentReadLatencyMicros ( ) { } public long [ ] getLifetimeReadLatencyHistogramMicros ( ) { } public long [ ] getRecentReadLatencyHistogramMicros ( ) { } public long getTotalReadLatencyMicros ( ) { } public int getPendingTasks ( ) { } public long getWriteCount ( ) { } public long getTotalWriteLatencyMicros ( ) { } public double getRecentWriteLatencyMicros ( ) { } public long [ ] getLifetimeWriteLatencyHistogramMicros ( ) { } public long [ ] getRecentWriteLatencyHistogramMicros ( ) { } public ColumnFamily getColumnFamily ( DecoratedKey key , QueryPath path , byte [ ] start , byte [ ] finish , boolean reversed , int limit ) { }

Fix:
long guessedSize = ( ( 2 * ( metadata . memtableThroughputInMb ) ) * 1024 ) * 1024 ;