本文整理汇总了Java中com.hazelcast.nio.ObjectDataInput.readObject方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectDataInput.readObject方法的具体用法?Java ObjectDataInput.readObject怎么用?Java ObjectDataInput.readObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.hazelcast.nio.ObjectDataInput
的用法示例。
在下文中一共展示了ObjectDataInput.readObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: read
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public CacheEntry read(ObjectDataInput in)
throws IOException {
try {
int length = in.readInt();
Serializable[] disassembledState = new Serializable[length];
for (int i = 0; i < length; i++) {
disassembledState[i] = in.readObject();
}
String subclass = in.readUTF();
boolean lazyPropertiesAreUnfetched = in.readBoolean();
Object version = in.readObject();
return CACHE_ENTRY_CONSTRUCTOR.newInstance(disassembledState, subclass, lazyPropertiesAreUnfetched, version);
} catch (Exception e) {
if (e instanceof IOException) {
throw (IOException) e;
}
throw new IOException(e);
}
}
示例2: read
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public CacheKey read(ObjectDataInput in)
throws IOException {
try {
Object key = in.readObject();
Type type = in.readObject();
String entityOrRoleName = in.readUTF();
String tenantId = in.readUTF();
int hashCode = in.readInt();
CacheKey cacheKey = (CacheKey) UNSAFE.allocateInstance(CacheKey.class);
UNSAFE.putObjectVolatile(cacheKey, KEY_OFFSET, key);
UNSAFE.putObjectVolatile(cacheKey, TYPE_OFFSET, type);
UNSAFE.putObjectVolatile(cacheKey, ENTITY_OR_ROLE_NAME_OFFSET, entityOrRoleName);
UNSAFE.putObjectVolatile(cacheKey, TENANT_ID_OFFSET, tenantId);
UNSAFE.putIntVolatile(cacheKey, HASH_CODE_OFFSET, hashCode);
return cacheKey;
} catch (Exception e) {
if (e instanceof IOException) {
throw (IOException) e;
}
throw new IOException(e);
}
}
示例3: createSerializer
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public Serializer createSerializer() {
return new StreamSerializer<MutableReference>() {
@Override
public int getTypeId() {
return SerializerHookConstants.MUTABLE_REFERENCE;
}
@Override
public void destroy() {
}
@Override
public void write(ObjectDataOutput out, MutableReference object) throws IOException {
out.writeObject(object.get());
}
@Override
public MutableReference read(ObjectDataInput in) throws IOException {
return new MutableReference<>(in.readObject());
}
};
}
示例4: readData
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput in) throws IOException {
size = in.readInt();
if (size > starts.length) {
// round to next power of 2
@SuppressWarnings("checkstyle:magicnumber")
int newSize = 1 << (32 - Integer.numberOfLeadingZeros(size - 1));
starts = new long[newSize];
ends = new long[newSize];
accs = (A[]) new Object[newSize];
}
for (int i = 0; i < size; i++) {
starts[i] = in.readLong();
ends[i] = in.readLong();
accs[i] = in.readObject();
}
}
示例5: createSerializer
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public Serializer createSerializer() {
return new StreamSerializer<BroadcastEntry>() {
@Override
public int getTypeId() {
return SerializerHookConstants.BROADCAST_ENTRY;
}
@Override
public void destroy() {
}
@Override
public void write(ObjectDataOutput out, BroadcastEntry object) throws IOException {
out.writeObject(object.getKey());
out.writeObject(object.getValue());
}
@Override
public BroadcastEntry read(ObjectDataInput in) throws IOException {
return new BroadcastEntry(in.readObject(), in.readObject());
}
};
}
示例6: readData
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput in) throws IOException {
int vertexCount = in.readInt();
for (int i = 0; i < vertexCount; i++) {
String key = in.readObject();
Vertex value = in.readObject();
nameToVertex.put(key, value);
}
int edgeCount = in.readInt();
for (int i = 0; i < edgeCount; i++) {
Edge edge = in.readObject();
edge.restoreSourceAndDest(nameToVertex);
edges.add(edge);
}
verticesByIdentity.addAll(nameToVertex.values());
}
示例7: readLogicalNodeTable
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Nonnull
static LogicalNodeTable readLogicalNodeTable(@Nonnegative int partitionId, @Nonnull ObjectDataInput in)
throws IOException {
SequencerDefinition definition = in.readObject();
short size = in.readShort();
Object[] assignmentTable = new Object[definition.getBoundedMaxLogicalNodeCount()];
for (int i = 0; i < size; i++) {
short index = in.readShort();
Address address = new Address();
address.readData(in);
assignmentTable[index] = address;
}
return new LogicalNodeTable(partitionId, definition, assignmentTable);
}
示例8: read
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public Role read(ObjectDataInput in) throws IOException {
Object[] entity = super.readEntity(in);
String name = in.readUTF();
String description = in.readUTF();
List<Permission> perms = (List<Permission>) in.readObject();
Set<String> roles = (Set<String>) in.readObject();
Map<String, Permission> mPerms = new HashMap<String, Permission>(perms.size());
for (Permission xpm: perms) {
mPerms.put(xpm.getResource(), xpm);
}
Role xRole = new Role(
(int) entity[0],
(Date) entity[1],
(String) entity[2],
mPerms,
roles,
name,
description);
return xRole;
}
示例9: read
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public Expression read(ObjectDataInput in) throws IOException {
int clnId = in.readInt();
Comparison compType = Comparison.values()[in.readInt()];
byte type = in.readByte();
if (type == 0) {
return new AlwaysExpression(clnId);
}
PathBuilder path = in.readObject();
if (type == 1) {
return new BinaryExpression(clnId, compType, path);
} else {
return new PathExpression(clnId, compType, path, in.readUTF(),
(QueriedPath) in.readObject());
}
}
示例10: readDisassembled
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
private static CacheEntry readDisassembled(final ObjectDataInput in)
throws IOException, IllegalAccessException, InvocationTargetException, InstantiationException {
int length = in.readInt();
Serializable[] disassembledState = new Serializable[length];
for (int i = 0; i < length; i++) {
disassembledState[i] = in.readObject();
}
String subclass = in.readUTF();
boolean lazyPropertiesAreUnfetched = in.readBoolean();
Object version = in.readObject();
return CACHE_ENTRY_CONSTRUCTOR.newInstance(disassembledState, subclass, lazyPropertiesAreUnfetched, version);
}
示例11: readData
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput in) throws IOException {
lock = in.readObject();
newValue = in.readObject();
newVersion = in.readObject();
nextMarkerId = in.readUTF();
timestamp = in.readLong();
}
示例12: readData
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(final ObjectDataInput in) throws IOException {
lock = in.readObject();
newValue = in.readObject();
newVersion = in.readObject();
nextMarkerId = in.readUTF();
timestamp = in.readLong();
}
示例13: createSerializer
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public Serializer createSerializer() {
return new StreamSerializer<TimestampedEntry>() {
@Override
public void write(ObjectDataOutput out, TimestampedEntry object) throws IOException {
out.writeLong(object.getTimestamp());
out.writeObject(object.getKey());
out.writeObject(object.getValue());
}
@Override
public TimestampedEntry read(ObjectDataInput in) throws IOException {
long timestamp = in.readLong();
Object key = in.readObject();
Object value = in.readObject();
return new TimestampedEntry<>(timestamp, key, value);
}
@Override
public int getTypeId() {
return SerializerHookConstants.TIMESTAMPED_ENTRY;
}
@Override
public void destroy() {
}
};
}
示例14: readData
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput in) throws IOException {
oppositeVertexId = in.readInt();
destOrdinal = in.readInt();
sourceOrdinal = in.readInt();
priority = in.readInt();
isDistributed = in.readBoolean();
routingPolicy = in.readObject();
partitioner = CustomClassLoadedObject.read(in);
config = in.readObject();
}
示例15: readData
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput in) throws IOException {
vertices = readList(in);
int len = in.readInt();
partitionOwners = new Address[len];
lastSnapshotId = in.readLong();
for (int i = 0; i < len; i++) {
partitionOwners[i] = in.readObject();
}
jobConfig = in.readObject();
}