I think the real problem is that the conditionals are spread across a bunch of different files. Seven special cases isn't necessarily unsustainable, but is difficult to manage now because they aren't isolated to one location. I think platform specific customizations are sustainable (as long as someone is committed to maintaining the code for each platform!), but we need to find the right place to isolate those differences. That would probably mean a new class that gets passed to each of the classes affected by the current patch and mediates a few operations against the underlying filesystem.
On Wed, Mar 11, 2015 at 10:34 PM, Jay Kreps (JIRA) <j...@apache.org> wrote: > > [ > https://issues.apache.org/jira/browse/KAFKA-1646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14358125#comment-14358125 > ] > > Jay Kreps commented on KAFKA-1646: > ---------------------------------- > > Hey [~waldenchen] this patch is adding a TON of windows-specific if/else > statements. I don't think that is sustainable. I think if we are going to > do this we need to try to make it the same strategy across OS's just for > maintainability. > > That said, are you sure NTFS can't just be tuned to accomplish the same > thing? > > > Improve consumer read performance for Windows > > --------------------------------------------- > > > > Key: KAFKA-1646 > > URL: https://issues.apache.org/jira/browse/KAFKA-1646 > > Project: Kafka > > Issue Type: Improvement > > Components: log > > Affects Versions: 0.8.1.1 > > Environment: Windows > > Reporter: xueqiang wang > > Assignee: xueqiang wang > > Labels: newbie, patch > > Attachments: Improve consumer read performance for > Windows.patch, > KAFKA-1646-truncate-off-trailing-zeros-on-broker-restart-if-bro.patch, > KAFKA-1646_20141216_163008.patch, KAFKA-1646_20150306_005526.patch > > > > > > This patch is for Window platform only. In Windows platform, if there > are more than one replicas writing to disk, the segment log files will not > be consistent in disk and then consumer reading performance will be dropped > down greatly. This fix allocates more disk spaces when rolling a new > segment, and then it will improve the consumer reading performance in NTFS > file system. > > This patch doesn't affect file allocation of other filesystems, for it > only adds statements like 'if(Os.iswindow)' or adds methods used on Windows. > > > > -- > This message was sent by Atlassian JIRA > (v6.3.4#6332) > -- Thanks, Ewen