protected void init(int keyLen, long sizeMemBytes, int numberOfElems) { checkThread(); numElem = 0; bytezOffset = FILE_HEADER_LEN; freeList = new FreeList(); // FIXME: missing merge/split of different block sizes alloc = new MallocBytezAllocator(); memory = alloc.alloc(sizeMemBytes); customHeader = memory.slice(CORE_HEADER_LEN,CUSTOM_FILEHEADER_LEN); tmpValueBytez = new BytezByteSource(memory,0,0); this.keyLen = keyLen; index = new OffHeapByteTree(keyLen,OffHeapByteTree.estimateMBytesForIndex(keyLen,numberOfElems)); memory.putInt(4, HEADER_TAG); }
public void free() { checkThread(); mutationCount++; if ( alloc != null ) { alloc.freeAll(); alloc = null; } if ( memory instanceof MMFBytez ) { ((MMFBytez) memory).freeAndClose(); memory = null; } // index.free(); index = null; }
retransTemplate.setSeqNo(-1); packetAllocator = new FSTStructAllocator(10, new MallocBytezAllocator()); readBuffer = packetAllocator.newArray(historySize,template); this.nodeId = packetAllocator.newStruct( new StructString(Packet.MAX_NODE_NAME_LEN) );
retransTemplate.setSeqNo(-1); packetAllocator = new FSTStructAllocator(10, new MallocBytezAllocator()); readBuffer = packetAllocator.newArray(historySize,template); this.nodeId = packetAllocator.newStruct( new StructString(Packet.MAX_NODE_NAME_LEN) );
protected void init(int keyLen, long sizeMemBytes, int numberOfElems) { checkThread(); numElem = 0; bytezOffset = FILE_HEADER_LEN; freeList = new FreeList(); // FIXME: missing merge/split of different block sizes alloc = new MallocBytezAllocator(); memory = alloc.alloc(sizeMemBytes); customHeader = memory.slice(CORE_HEADER_LEN,CUSTOM_FILEHEADER_LEN); tmpValueBytez = new BytezByteSource(memory,0,0); this.keyLen = keyLen; index = new OffHeapByteTree(keyLen,OffHeapByteTree.estimateMBytesForIndex(keyLen,numberOfElems)); memory.putInt(4, HEADER_TAG); }
template.setTopic(topic); offheapAllocator = new FSTStructAllocator(0, new MallocBytezAllocator()); heapAllocator = new FSTStructAllocator(0);
public void free() { checkThread(); mutationCount++; if ( alloc != null ) { alloc.freeAll(); alloc = null; } if ( memory instanceof MMFBytez ) { ((MMFBytez) memory).freeAndClose(); memory = null; } // index.free(); index = null; }
template.setTopic(topic); offheapAllocator = new FSTStructAllocator(0, new MallocBytezAllocator()); heapAllocator = new FSTStructAllocator(0);