public void putLong(long index, long data) { buf.putLong((int) index, data); } }
@Override public void writeLong(int offset, long v) { assert buffer != null; buffer.putLong((int) (start + offset), v); }
@Override public void writeLong(long v) { assert buffer != null; buffer.putLong((int) position, v); position += 8; }
private void writeLong(int processNumber, int offset, long value) { mappedByteBuffer.putLong(offset(processNumber) + offset, value); }
@Override public void add(long id) { if (numRecords == MAX_NUM_RECORDS) { throw new IllegalStateException( String.format("DmaIdList reaches its maximum number of records: %d", numRecords)); } if (numRecords == capacity) { buffer = ByteBufferUtil.expandBuffer(filename, buffer, META_DATA_SIZE + Math.min(MAX_NUM_RECORDS, 2 * capacity) * SIZE_OF_DATA); capacity *= 2; } buffer.putLong(id); buffer.putInt(0, ++numRecords); }
public void add(T t) { int currentBufferIndex = (int) (maxId / numRecordsPerFile); ByteBuffer duplicate = buffers.getUnchecked(currentBufferIndex).duplicate(); duplicate.position((int) (maxId % numRecordsPerFile) * schema.getObjectSize()); duplicate.put(schema.toBytes(t)); metaDataBuffer.putLong(0, ++maxId); }
public void putLong(long index, long data) { dumpBuffer[getBufferIndex(index)].putLong(getBufferOffset(index),data); }
@Override public void setIndexData(long indexId, long indexData) { long indexOffset = indexId << indexBitSize(); MappedMemory indexBuffer = acquireIndexBuffer(indexOffset); indexBuffer.buffer().putLong((int) (indexOffset & indexLowMask), indexData); if (synchronousMode()) indexBuffer.force(); indexBuffer.release(); }
this.mappedByteBuffer.putLong(absIndexPos + 4, phyOffset); this.mappedByteBuffer.putInt(absIndexPos + 4 + 8, (int) timeDiff); this.mappedByteBuffer.putInt(absIndexPos + 4 + 8 + 4, slotValue);
@Override public void writeLong(long v) { assert buffer != null; buffer.putLong((int) position, v); position += 8; }
this.mappedByteBuffer.putLong(absIndexPos + 4, phyOffset); this.mappedByteBuffer.putInt(absIndexPos + 4 + 8, (int) timeDiff); this.mappedByteBuffer.putInt(absIndexPos + 4 + 8 + 4, slotValue);
public long increaseMessageCount(int delta){ try { lock.lock(); buffer.position(MessageCountPos); long count = messageCount.getAndAdd(delta); buffer.putLong(count+delta); return count; } finally { lock.unlock(); } }
@Override protected void writeDefaultData() throws IOException { buffer.position(WindowPos); buffer.putInt(this.window); buffer.putLong(this.timeout); for(int i=0;i<MaxWindowCount;i++) { availableEntries.add(i); } }
void set(int i, byte[] k, long v) { int index = pos(i); for (int j = 0; j < keySize; j++) { byte a = 0; if (j < k.length) a = k[j]; buffer.put(index + j, a); } buffer.putLong(index + keySize, v); }
void set(int i, byte[] k, long v) { int index = pos(i); for (int j = 0; j < keySize; j++) { byte a = 0; if (j < k.length) a = k[j]; buffer.put(index + j, a); } buffer.putLong(index + keySize, v); }
void set(int i, byte[] k, long v) { int index = pos(i); for (int j = 0; j < keySize; j++) { byte a = 0; if (j < k.length) a = k[j]; buffer.put(index + j, a); } buffer.putLong(index + keySize, v); }
public void switchToSlaver() { this.writable.position(identifier.length + 2 + 8 + 4); this.writable.put((byte) 0x0); this.writable.put((byte) 0x0); this.master = false; this.marked = false; writable.position(identifier.length + 2 + 8 + 4 + 2); this.writable.putLong(System.currentTimeMillis()); this.endIndex = this.startIdx; this.writable.putInt(this.endIndex); }