// if getBlockLocation returns null, close the channel
if (fileSegment == null) {
//ctx.close();
return;
}
File file = fileSegment.file();
if (file.exists()) {
if (!file.isFile()) {
ctx.write(new FileHeader(0, blockId).buffer());
ctx.flush();
return;