本文整理汇总了Java中org.apache.ignite.internal.util.GridUnsafe.putInt方法的典型用法代码示例。如果您正苦于以下问题:Java GridUnsafe.putInt方法的具体用法?Java GridUnsafe.putInt怎么用?Java GridUnsafe.putInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ignite.internal.util.GridUnsafe
的用法示例。
在下文中一共展示了GridUnsafe.putInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeInt
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void writeInt(int val) {
ensureCapacity(pos + 4);
GridUnsafe.putInt(data + pos, val);
shift(4);
}
示例2: serializeCacheSizes
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/**
* @param cacheSizes Cache sizes: cache Id in shared group mapped to its size. Not null.
* @return Serialized cache sizes or 0-byte length array if map was empty.
*/
public byte[] serializeCacheSizes(Map<Integer, Long> cacheSizes) {
byte[] data = new byte[cacheSizes.size() * ITEM_SIZE];
long off = GridUnsafe.BYTE_ARR_OFF;
for (Map.Entry<Integer, Long> entry : cacheSizes.entrySet()) {
GridUnsafe.putInt(data, off, entry.getKey()); off += CACHE_ID_SIZE;
GridUnsafe.putLong(data, off, entry.getValue()); off += CACHE_SIZE_SIZE;
}
return data;
}
示例3: initNew
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/**
* @param absPtr Absolute pointer to initialize.
* @param relative Relative pointer to write.
*/
private static void initNew(long absPtr, long relative) {
relative(absPtr, relative);
tempBufferPointer(absPtr, INVALID_REL_PTR);
GridUnsafe.putLong(absPtr, PAGE_MARKER);
GridUnsafe.putInt(absPtr + PAGE_PIN_CNT_OFFSET, 0);
}
示例4: unsafeWriteInt
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void unsafeWriteInt(int val) {
long off = GridUnsafe.BYTE_ARR_OFF + pos;
if (BIG_ENDIAN)
GridUnsafe.putIntLE(data, off, val);
else
GridUnsafe.putInt(data, off, val);
shift(4);
}
示例5: setKeyAt
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/**
* @param index Entry index.
* @param grpId Cache group ID to write.
* @param pageId Page ID to write.
*/
private void setKeyAt(int index, int grpId, long pageId) {
long base = entryBase(index);
GridUnsafe.putInt(base, grpId);
GridUnsafe.putLong(base + 8, pageId);
}
示例6: unsafeWriteInt
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void unsafeWriteInt(int val) {
long addr = ptr + pos;
if (BIG_ENDIAN)
GridUnsafe.putIntLE(addr, val);
else
GridUnsafe.putInt(addr, val);
shift(4);
}
示例7: writeInt
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void writeInt(int val) {
lastFinished = buf.remaining() >= 4;
if (lastFinished) {
int pos = buf.position();
GridUnsafe.putInt(heapArr, baseOff + pos, val);
buf.position(pos + 4);
}
}
示例8: writeInt
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/**
* @param ptr Pointer.
* @param off Offset.
* @param val Value.
*/
public static void writeInt(long ptr, int off, int val) {
if (BIG_ENDIAN)
GridUnsafe.putIntLE(ptr + off, val);
else
GridUnsafe.putInt(ptr + off, val);
}
示例9: writeIntFast
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected void writeIntFast(int val) {
long addr = ptr + pos;
if (BIG_ENDIAN)
GridUnsafe.putIntLE(addr, val);
else
GridUnsafe.putInt(addr, val);
}
示例10: writeInt
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void writeInt(int val) throws IOException {
int writePos = ensure(4);
GridUnsafe.putInt(buf, BYTE_ARR_OFF + writePos, val);
}
示例11: unsafeWriteInt
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void unsafeWriteInt(int val) {
GridUnsafe.putInt(data + pos, val);
shift(4);
}
示例12: writeIntArray
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void writeIntArray(int[] val) {
int cnt = val.length << 2;
ensureCapacity(pos + cnt);
long startPos = data + pos;
for (int item : val) {
GridUnsafe.putInt(startPos, Integer.reverseBytes(item));
startPos += 4;
}
shift(cnt);
}
示例13: writeFloatArray
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void writeFloatArray(float[] val) {
int cnt = val.length << 2;
ensureCapacity(pos + cnt);
long startPos = data + pos;
for (float item : val) {
GridUnsafe.putInt(startPos, Integer.reverseBytes(Float.floatToIntBits(item)));
startPos += 4;
}
shift(cnt);
}
示例14: incrementSize
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/**
*
*/
private void incrementSize() {
GridUnsafe.putInt(valPtr, GridUnsafe.getInt(valPtr) + 1);
}
示例15: decrementSize
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/**
*
*/
private void decrementSize() {
GridUnsafe.putInt(valPtr, GridUnsafe.getInt(valPtr) - 1);
}