本文整理汇总了Java中com.hazelcast.nio.ObjectDataOutput.writeInt方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectDataOutput.writeInt方法的具体用法?Java ObjectDataOutput.writeInt怎么用?Java ObjectDataOutput.writeInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.hazelcast.nio.ObjectDataOutput
的用法示例。
在下文中一共展示了ObjectDataOutput.writeInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeData
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public void writeData(ObjectDataOutput out) throws IOException {
out.writeUTF(clientId);
out.writeUTF(ip);
out.writeInt(port);
out.writeBoolean(isConnected);
out.writeInt(currentMessageId);
out.writeBoolean(will != null);
if (will != null) {
will.writeData(out);
}
out.writeBoolean(cleanSession);
out.writeInt(keepAliveSeconds);
out.writeLong(createTime != null ? createTime.getTime() : Long.MIN_VALUE);
out.writeLong(lastIncomingTime != null ? lastIncomingTime.getTime() : Long.MIN_VALUE);
}
示例2: write
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public void write(ObjectDataOutput out, CacheEntry object)
throws IOException {
try {
Serializable[] disassembledState = (Serializable[]) UNSAFE.getObject(object, DISASSEMBLED_STATE_OFFSET);
String subclass = (String) UNSAFE.getObject(object, SUBCLASS_OFFSET);
boolean lazyPropertiesAreUnfetched = UNSAFE.getBoolean(object, LAZY_PROPERTIES_ARE_UNFETCHED);
Object version = UNSAFE.getObject(object, VERSION_OFFSET);
out.writeInt(disassembledState.length);
for (Serializable state : disassembledState) {
out.writeObject(state);
}
out.writeUTF(subclass);
out.writeBoolean(lazyPropertiesAreUnfetched);
out.writeObject(version);
} catch (Exception e) {
if (e instanceof IOException) {
throw (IOException) e;
}
throw new IOException(e);
}
}
示例3: write
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public void write(ObjectDataOutput out, CacheKey object)
throws IOException {
try {
Object key = UNSAFE.getObject(object, KEY_OFFSET);
Type type = (Type) UNSAFE.getObject(object, TYPE_OFFSET);
String entityOrRoleName = (String) UNSAFE.getObject(object, ENTITY_OR_ROLE_NAME_OFFSET);
EntityMode entityMode = (EntityMode) UNSAFE.getObject(object, ENTITY_MODE_OFFSET);
int hashCode = UNSAFE.getInt(object, HASH_CODE_OFFSET);
out.writeObject(key);
out.writeObject(type);
out.writeUTF(entityOrRoleName);
out.writeUTF(entityMode.toString());
out.writeInt(hashCode);
} catch (Exception e) {
if (e instanceof IOException) {
throw (IOException) e;
}
throw new IOException(e);
}
}
示例4: write
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public void write(ObjectDataOutput out, CacheKey object)
throws IOException {
try {
Object key = UNSAFE.getObject(object, KEY_OFFSET);
Type type = (Type) UNSAFE.getObject(object, TYPE_OFFSET);
String entityOrRoleName = (String) UNSAFE.getObject(object, ENTITY_OR_ROLE_NAME_OFFSET);
String tenantId = (String) UNSAFE.getObject(object, TENANT_ID_OFFSET);
int hashCode = UNSAFE.getInt(object, HASH_CODE_OFFSET);
out.writeObject(key);
out.writeObject(type);
out.writeUTF(entityOrRoleName);
out.writeUTF(tenantId);
out.writeInt(hashCode);
} catch (Exception e) {
if (e instanceof IOException) {
throw (IOException) e;
}
throw new IOException(e);
}
}
示例5: createSerializer
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public Serializer createSerializer() {
return new StreamSerializer<Tag>() {
@Override
public void write(ObjectDataOutput out, Tag tag) throws IOException {
out.writeInt(tag.index());
}
@Override
public Tag read(ObjectDataInput in) throws IOException {
return Tag.tag(in.readInt());
}
@Override
public int getTypeId() {
return SerializerHookConstants.TAG;
}
@Override
public void destroy() {
}
};
}
示例6: createFlowControlPacket
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
private byte[] createFlowControlPacket(Address member) throws IOException {
final ObjectDataOutput out = createObjectDataOutput(nodeEngine);
final boolean[] hasData = {false};
Map<Long, ExecutionContext> executionContexts = jobExecutionService.getExecutionContexts();
out.writeInt(executionContexts.size());
executionContexts.forEach((execId, exeCtx) -> uncheckRun(() -> {
if (!exeCtx.hasParticipant(member)) {
return;
}
out.writeLong(execId);
out.writeInt(exeCtx.receiverMap().values().stream().mapToInt(Map::size).sum());
exeCtx.receiverMap().forEach((vertexId, ordinalToSenderToTasklet) ->
ordinalToSenderToTasklet.forEach((ordinal, senderToTasklet) -> uncheckRun(() -> {
out.writeInt(vertexId);
out.writeInt(ordinal);
out.writeInt(senderToTasklet.get(member).updateAndGetSendSeqLimitCompressed());
hasData[0] = true;
})));
}));
return hasData[0] ? out.toByteArray() : EMPTY_BYTES;
}
示例7: write
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public void write(ObjectDataOutput out, KryoMarker object)
throws IOException {
if (object instanceof KryoEnvelope) {
KryoEnvelope envelope = (KryoEnvelope) object;
out.writeUTF(envelope.getClassName());
byte[] data = envelope.getData();
out.writeInt(data.length);
out.write(data);
} else {
throw new IllegalStateException("KryoMarker value cannot be serialized since kryo isn't available");
}
}
示例8: writeData
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public void writeData(ObjectDataOutput out) throws IOException {
out.writeUTF(id);
out.writeUTF(bookId);
out.writeDouble(cost);
out.writeInt(quantity);
out.writeBoolean(inStock);
}
示例9: writeData
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public void writeData(ObjectDataOutput out) throws IOException {
out.writeDouble(totalPrice);
out.writeLong(date.getTime());
out.writeLong(id);
out.writeInt(items.size());
items.forEach(item -> {
try{
item.writeData(out);
} catch (IOException ex) {
ex.printStackTrace();
}
});
}
示例10: writeData
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public void writeData(ObjectDataOutput out) throws IOException {
out.writeInt(id);
out.writeUTF(topicName);
out.writeUTF(publisherId);
out.writeByteArray(message);
out.writeInt(qos != null ? qos.value() : Byte.MIN_VALUE);
out.writeBoolean(isRetain);
}
示例11: writeData
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public void writeData(ObjectDataOutput out) throws IOException {
out.writeUTF(messageKey);
out.writeUTF(clientId);
out.writeInt(messageId);
out.writeUTF(topicName);
out.writeLong(createTime != null ? createTime.getTime() : Long.MIN_VALUE);
out.writeLong(updateTime != null ? updateTime.getTime() : Long.MIN_VALUE);
}
示例12: writeData
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public void writeData(ObjectDataOutput objectDataOutput) throws IOException {
objectDataOutput.writeLong(creationTime);
objectDataOutput.writeLong(lastAccessedTime);
objectDataOutput.writeInt(maxInactiveInterval);
objectDataOutput.writeBoolean(isNew);
objectDataOutput.writeBoolean(isValid);
objectDataOutput.writeLong(thisAccessedTime);
objectDataOutput.writeObject(id);
serializeMap(getAttributes(), objectDataOutput);
serializeMap(notes, objectDataOutput);
}
示例13: writeDisassembled
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
private static void writeDisassembled(ObjectDataOutput out, CacheEntry object)
throws IOException {
Serializable[] disassembledState = object.getDisassembledState();
out.writeInt(disassembledState.length);
for (Serializable state : disassembledState) {
out.writeObject(state);
}
out.writeUTF(object.getSubclass());
out.writeBoolean(object.areLazyPropertiesUnfetched());
out.writeObject(object.getVersion());
}
示例14: writeData
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public void writeData(ObjectDataOutput out) throws IOException {
out.writeInt(size());
for (Integer item : this) {
out.writeInt(item);
}
}
示例15: writeData
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public void writeData(ObjectDataOutput out) throws IOException {
super.writeData(out);
out.writeBoolean(concurrent);
out.writeUTF(markerId);
out.writeInt(multiplicity);
out.writeLong(timeout);
out.writeLong(expiredTimestamp);
}