add comments

This commit is contained in:
Xavier Léauté 2014-05-19 23:25:20 -07:00
parent 618afd9976
commit be25d67894
1 changed files with 3 additions and 1 deletions

View File

@ -159,7 +159,7 @@ public class GenericIndexed<T> implements Indexed<T>
@Override
protected SizedLRUMap<Integer, T> initialValue()
{
return new SizedLRUMap<>(16384, 1024 * 1024);
return new SizedLRUMap<>(16384, 1024 * 1024); // 1MB cache per column, per thread
}
};
@ -220,6 +220,7 @@ public class GenericIndexed<T> implements Indexed<T>
}
}
// using a cached copy of the buffer instead of making a read-only copy every time get() is called is faster
final ByteBuffer copyBuffer = this.cachedBuffer.get();
final int startOffset;
@ -240,6 +241,7 @@ public class GenericIndexed<T> implements Indexed<T>
copyBuffer.position(valuesOffset + startOffset);
final int size = endOffset - startOffset;
// fromByteBuffer must not modify the buffer limit
final T value = strategy.fromByteBuffer(copyBuffer, size);
if(cacheable) {