@@ -0,0 +1,2090 @@
+/*%0A * Copyright (c) 2014. Jordan Williams%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *    http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage com.jordanwilliams.heftydb.table.file;%0A%0Aimport com.jordanwilliams.heftydb.io.DataFile;%0Aimport com.jordanwilliams.heftydb.io.MutableDataFile;%0Aimport com.jordanwilliams.heftydb.offheap.BloomFilter;%0Aimport com.jordanwilliams.heftydb.offheap.Memory;%0Aimport com.jordanwilliams.heftydb.offheap.Offheap;%0Aimport com.jordanwilliams.heftydb.record.Key;%0Aimport com.jordanwilliams.heftydb.state.DataFiles;%0A%0Aimport java.io.IOException;%0Aimport java.nio.ByteBuffer;%0A%0Apublic class Filter implements Offheap %7B%0A%0A    private final BloomFilter bloomFilter;%0A%0A    private Filter(long tableId, DataFiles dataFiles) throws IOException %7B%0A        DataFile filterFile = MutableDataFile.open(dataFiles.filterPath(tableId));%0A        Memory filterMemory = Memory.allocate(filterFile.size());%0A        ByteBuffer filterBuffer = filterMemory.toDirectBuffer();%0A        filterFile.read(filterBuffer, filterFile.size());%0A        this.bloomFilter = new BloomFilter(filterMemory);%0A    %7D%0A%0A    public boolean mightContain(Key key)%7B%0A        return bloomFilter.mightContain(key.data().array());%0A    %7D%0A%0A    @Override%0A    public Memory memory() %7B%0A        return bloomFilter.memory();%0A    %7D%0A%0A    @Override%0A    public long sizeBytes() %7B%0A        return bloomFilter.memory().size();%0A    %7D%0A%0A    @Override%0A    public void releaseMemory() %7B%0A        bloomFilter.memory().release();%0A    %7D%0A%0A    public static Filter open(long tableId, DataFiles dataFiles) throws IOException %7B%0A        return new Filter(tableId, dataFiles);%0A    %7D%0A%7D%0A

Add filter wrapper