Java Code Examples for org.apache.ignite.binary.BinaryWriter#rawWriter()

The following examples show how to use org.apache.ignite.binary.BinaryWriter#rawWriter() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PlatformJavaObjectFactoryProxy.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
    BinaryRawWriterEx rawWriter = (BinaryRawWriterEx)writer.rawWriter();

    rawWriter.writeInt(factoryTyp);
    rawWriter.writeString(clsName);
    rawWriter.writeObjectDetached(payload);

    if (props != null) {
        rawWriter.writeInt(props.size());

        for (Map.Entry<String, Object> prop : props.entrySet()) {
            rawWriter.writeString(prop.getKey());
            rawWriter.writeObjectDetached(prop.getValue());
        }
    }
    else
        rawWriter.writeInt(0);
}
 
Example 2
Source File: PlatformDotNetSessionSetAndUnlockProcessor.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
    BinaryRawWriter raw = writer.rawWriter();

    raw.writeUuid(lockNodeId);
    raw.writeLong(lockId);
    raw.writeBoolean(update);

    if (update) {
        raw.writeBoolean(isDiff);
        raw.writeByteArray(staticData);
        raw.writeInt(timeout);

        if (items != null) {
            raw.writeInt(items.size());

            for (Map.Entry<String, byte[]> e : items.entrySet()) {
                raw.writeString(e.getKey());
                raw.writeByteArray(e.getValue());
            }
        }
        else
            raw.writeInt(-1);
    }
}
 
Example 3
Source File: IgfsMetaFileCreateProcessor.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
    BinaryRawWriter out = writer.rawWriter();

    out.writeLong(accessTime);
    out.writeLong(modificationTime);

    IgfsUtils.writeProperties(out, props);

    out.writeInt(blockSize);
    BinaryUtils.writeIgniteUuid(out, affKey);
    BinaryUtils.writeIgniteUuid(out, lockId);
    out.writeBoolean(evictExclude);

    out.writeLong(len);
}
 
Example 4
Source File: BinaryMarshallerSelfTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
    BinaryRawWriterEx raw = (BinaryRawWriterEx)writer.rawWriter();

    raw.writeObject(inner1);
    raw.writeObjectDetached(inner2);
    raw.writeObjectDetached(inner3);
    raw.writeObject(inner4);
}
 
Example 5
Source File: IgfsClientAbstractCallable.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override public final void writeBinary(BinaryWriter writer) throws BinaryObjectException {
    BinaryRawWriter rawWriter = writer.rawWriter();

    rawWriter.writeString(igfsName);
    rawWriter.writeString(user);
    IgfsUtils.writePath(rawWriter, path);

    writeBinary0(rawWriter);
}
 
Example 6
Source File: BinaryMarshallerSelfTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
    writer.writeDecimal("val", val);
    writer.writeDecimalArray("valArr", valArr);

    BinaryRawWriter rawWriter = writer.rawWriter();

    rawWriter.writeDecimal(rawVal);
    rawWriter.writeDecimalArray(rawValArr);
}
 
Example 7
Source File: IgfsListingEntry.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
    BinaryRawWriter out = writer.rawWriter();

    BinaryUtils.writeIgniteUuid(out, id);
    out.writeBoolean(dir);
}
 
Example 8
Source File: IgfsFileImpl.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
    BinaryRawWriter rawWriter = writer.rawWriter();

    IgfsUtils.writePath(rawWriter, path);
    rawWriter.writeInt(blockSize);
    rawWriter.writeLong(grpBlockSize);
    rawWriter.writeLong(len);
    IgfsUtils.writeProperties(rawWriter, props);
    rawWriter.writeLong(accessTime);
    rawWriter.writeLong(modificationTime);
    rawWriter.writeByte(flags);
}
 
Example 9
Source File: IgfsMetaUpdateTimesProcessor.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
    BinaryRawWriter out = writer.rawWriter();

    out.writeLong(accessTime);
    out.writeLong(modificationTime);
}
 
Example 10
Source File: PlatformDotNetEntityFrameworkCacheKey.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
    final BinaryRawWriter raw = writer.rawWriter();

    raw.writeString(query);

    if (versions != null) {
        raw.writeInt(versions.length);

        for (long ver : versions)
            raw.writeLong(ver);
    }
    else
        raw.writeInt(-1);
}
 
Example 11
Source File: IgfsMetaFileUnlockProcessor.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
    BinaryRawWriter out = writer.rawWriter();

    out.writeLong(modificationTime);

    if (updateSpace) {
        out.writeBoolean(true);
        out.writeLong(space);
        out.writeObject(affRange);
    }
    else
        out.writeBoolean(false);
}
 
Example 12
Source File: IgfsMetaDirectoryListingReplaceProcessor.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
    BinaryRawWriter out = writer.rawWriter();

    out.writeString(name);
    BinaryUtils.writeIgniteUuid(out, id);
}
 
Example 13
Source File: IgfsMetaFileRangeUpdateProcessor.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
    BinaryRawWriter out = writer.rawWriter();

    out.writeObject(range);
    out.writeInt(status);
}
 
Example 14
Source File: IgniteUuid.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
    BinaryRawWriter out = writer.rawWriter();

    out.writeLong(locId);
    out.writeLong(gid.getMostSignificantBits());
    out.writeLong(gid.getLeastSignificantBits());
}
 
Example 15
Source File: WebSessionAttributeProcessor.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override public void writeBinary(final BinaryWriter writer) throws BinaryObjectException {
    final BinaryRawWriter rawWriter = writer.rawWriter();

    rawWriter.writeMap(updatesMap);
    rawWriter.writeLong(accessTime);
    rawWriter.writeBoolean(maxIntervalChanged);

    if (maxIntervalChanged)
        rawWriter.writeInt(maxInactiveInterval);
}
 
Example 16
Source File: IgfsPathSummary.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
    BinaryRawWriter rawWriter = writer.rawWriter();

    rawWriter.writeInt(filesCnt);
    rawWriter.writeInt(dirCnt);
    rawWriter.writeLong(totalLen);

    IgfsUtils.writePath(rawWriter, path);
}
 
Example 17
Source File: IgfsMetaFileRangeDeleteProcessor.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
    BinaryRawWriter out = writer.rawWriter();

    out.writeObject(range);
}
 
Example 18
Source File: BinaryMarshallerSelfTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
    writer.writeByte("_b", b);
    writer.writeShort("_s", s);
    writer.writeInt("_i", i);
    writer.writeLong("_l", l);
    writer.writeFloat("_f", f);
    writer.writeDouble("_d", d);
    writer.writeChar("_c", c);
    writer.writeBoolean("_bool", bool);
    writer.writeString("_str", str);
    writer.writeUuid("_uuid", uuid);
    writer.writeDate("_date", date);
    writer.writeTimestamp("_ts", ts);
    writer.writeTime("_time", time);
    writer.writeByteArray("_bArr", bArr);
    writer.writeShortArray("_sArr", sArr);
    writer.writeIntArray("_iArr", iArr);
    writer.writeLongArray("_lArr", lArr);
    writer.writeFloatArray("_fArr", fArr);
    writer.writeDoubleArray("_dArr", dArr);
    writer.writeCharArray("_cArr", cArr);
    writer.writeBooleanArray("_boolArr", boolArr);
    writer.writeStringArray("_strArr", strArr);
    writer.writeUuidArray("_uuidArr", uuidArr);
    writer.writeDateArray("_dateArr", dateArr);
    writer.writeTimeArray("_timeArr", timeArr);
    writer.writeObjectArray("_objArr", objArr);
    writer.writeCollection("_col", col);
    writer.writeMap("_map", map);
    writer.writeEnum("_enumVal", enumVal);
    writer.writeEnumArray("_enumArr", enumArr);
    writer.writeObject("_simple", simple);
    writer.writeObject("_binary", binary);

    BinaryRawWriter raw = writer.rawWriter();

    raw.writeByte(bRaw);
    raw.writeShort(sRaw);
    raw.writeInt(iRaw);
    raw.writeLong(lRaw);
    raw.writeFloat(fRaw);
    raw.writeDouble(dRaw);
    raw.writeChar(cRaw);
    raw.writeBoolean(boolRaw);
    raw.writeString(strRaw);
    raw.writeUuid(uuidRaw);
    raw.writeDate(dateRaw);
    raw.writeTimestamp(tsRaw);
    raw.writeTime(timeRaw);
    raw.writeByteArray(bArrRaw);
    raw.writeShortArray(sArrRaw);
    raw.writeIntArray(iArrRaw);
    raw.writeLongArray(lArrRaw);
    raw.writeFloatArray(fArrRaw);
    raw.writeDoubleArray(dArrRaw);
    raw.writeCharArray(cArrRaw);
    raw.writeBooleanArray(boolArrRaw);
    raw.writeStringArray(strArrRaw);
    raw.writeUuidArray(uuidArrRaw);
    raw.writeDateArray(dateArrRaw);
    raw.writeTimeArray(timeArrRaw);
    raw.writeObjectArray(objArrRaw);
    raw.writeCollection(colRaw);
    raw.writeMap(mapRaw);
    raw.writeEnum(enumValRaw);
    raw.writeEnumArray(enumArrRaw);
    raw.writeObject(simpleRaw);
    raw.writeObject(binaryRaw);
}
 
Example 19
Source File: IgfsMetaUpdatePropertiesProcessor.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
    BinaryRawWriter out = writer.rawWriter();

    IgfsUtils.writeProperties(out, props);
}
 
Example 20
Source File: GridClosureProcessor.java    From ignite with Apache License 2.0 4 votes vote down vote up
@Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
    BinaryRawWriter rawWriter = writer.rawWriter();

    rawWriter.writeObject(job);
    rawWriter.writeObject(arg);
}