当前位置: 首页>>代码示例>>Java>>正文


Java GridUnsafe.putInt方法代码示例

本文整理汇总了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);
}
 
开发者ID:apache,项目名称:ignite,代码行数:9,代码来源:PlatformOutputStreamImpl.java

示例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;
}
 
开发者ID:apache,项目名称:ignite,代码行数:16,代码来源:PagePartitionCountersIO.java

示例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);
}
 
开发者ID:apache,项目名称:ignite,代码行数:13,代码来源:PageMemoryImpl.java

示例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);
}
 
开发者ID:apache,项目名称:ignite,代码行数:12,代码来源:BinaryHeapOutputStream.java

示例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);
}
 
开发者ID:apache,项目名称:ignite,代码行数:12,代码来源:FullPageIdTable.java

示例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);
}
 
开发者ID:apache,项目名称:ignite,代码行数:12,代码来源:BinaryOffheapOutputStream.java

示例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);
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:13,代码来源:DirectByteBufferStreamImplV1.java

示例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);
}
 
开发者ID:apache,项目名称:ignite,代码行数:12,代码来源:BinaryPrimitives.java

示例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);
}
 
开发者ID:apache,项目名称:ignite,代码行数:10,代码来源:BinaryOffheapOutputStream.java

示例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);
}
 
开发者ID:apache,项目名称:ignite,代码行数:7,代码来源:HadoopDirectDataOutput.java

示例11: unsafeWriteInt

import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void unsafeWriteInt(int val) {
    GridUnsafe.putInt(data + pos, val);

    shift(4);
}
 
开发者ID:apache,项目名称:ignite,代码行数:7,代码来源:PlatformOutputStreamImpl.java

示例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);
}
 
开发者ID:apache,项目名称:ignite,代码行数:17,代码来源:PlatformBigEndianOutputStreamImpl.java

示例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);
}
 
开发者ID:apache,项目名称:ignite,代码行数:17,代码来源:PlatformBigEndianOutputStreamImpl.java

示例14: incrementSize

import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/**
 *
 */
private void incrementSize() {
    GridUnsafe.putInt(valPtr, GridUnsafe.getInt(valPtr) + 1);
}
 
开发者ID:apache,项目名称:ignite,代码行数:7,代码来源:FullPageIdTable.java

示例15: decrementSize

import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/**
 *
 */
private void decrementSize() {
    GridUnsafe.putInt(valPtr, GridUnsafe.getInt(valPtr) - 1);
}
 
开发者ID:apache,项目名称:ignite,代码行数:7,代码来源:FullPageIdTable.java


注:本文中的org.apache.ignite.internal.util.GridUnsafe.putInt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。