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


Java ObjectDataInput.readInt方法代码示例

本文整理汇总了Java中com.hazelcast.nio.ObjectDataInput.readInt方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectDataInput.readInt方法的具体用法?Java ObjectDataInput.readInt怎么用?Java ObjectDataInput.readInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.hazelcast.nio.ObjectDataInput的用法示例。


在下文中一共展示了ObjectDataInput.readInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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();
        EntityMode entityMode = EntityMode.parse(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, ENTITY_MODE_OFFSET, entityMode);
        UNSAFE.putIntVolatile(cacheKey, HASH_CODE_OFFSET, hashCode);
        return cacheKey;

    } catch (Exception e) {
        if (e instanceof IOException) {
            throw (IOException) e;
        }
        throw new IOException(e);
    }
}
 
开发者ID:hazelcast,项目名称:hazelcast-hibernate,代码行数:27,代码来源:Hibernate3CacheKeySerializer.java

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

示例3: readData

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput objectDataInput) throws IOException {
    this.creationTime = objectDataInput.readLong();
    this.lastAccessedTime = objectDataInput.readLong();
    this.maxInactiveInterval = objectDataInput.readInt();
    this.isNew = objectDataInput.readBoolean();
    this.isValid = objectDataInput.readBoolean();
    this.thisAccessedTime = objectDataInput.readLong();
    this.id = objectDataInput.readObject();

    setAttributes(deserializeMap(objectDataInput, true));

    this.notes = deserializeMap(objectDataInput, false);

    if (this.listeners == null) {
        this.listeners = new ArrayList();
    }
}
 
开发者ID:hazelcast,项目名称:hazelcast-tomcat-sessionmanager,代码行数:19,代码来源:HazelcastSession.java

示例4: readInternal

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
protected void readInternal(ObjectDataInput in) throws IOException {
    super.readInternal(in);

    jobId = in.readLong();
    executionId = in.readLong();
    coordinatorMemberListVersion = in.readInt();
    int count = in.readInt();
    participants = new HashSet<>();
    for (int i = 0; i < count; i++) {
        MemberInfo participant = new MemberInfo();
        participant.readData(in);
        participants.add(participant);
    }

    final Data planBlob = in.readData();
    planSupplier = () -> {
        JetService service = getService();
        ClassLoader cl = service.getClassLoader(jobId);
        return deserializeWithCustomClassLoader(getNodeEngine().getSerializationService(), cl, planBlob);
    };
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:23,代码来源:InitExecutionOperation.java

示例5: 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();
    }
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:19,代码来源:SessionWindowP.java

示例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());
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:21,代码来源:DAG.java

示例7: readInternal

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
protected void readInternal(ObjectDataInput in)
        throws IOException {

    super.readInternal(in);
    logicalNodeId = in.readInt();
    address = new Address();
    address.readData(in);

    long epochOffset = in.readLong();
    int maxLogicalNodeCount = in.readInt();
    short backupCount = in.readShort();

    SnowcastEpoch epoch = SnowcastEpoch.byTimestamp(epochOffset);
    definition = new SequencerDefinition(getSequencerName(), epoch, maxLogicalNodeCount, backupCount);
}
 
开发者ID:noctarius,项目名称:snowcast,代码行数:17,代码来源:BackupAttachLogicalNodeOperation.java

示例8: read

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public KryoMarker read(ObjectDataInput in)
        throws IOException {

    String className = in.readUTF();
    int dataLength = in.readInt();
    byte[] data = new byte[dataLength];
    in.readFully(data);

    try (Input input = new UnsafeInput(data)) {
        Class<? extends KryoMarker> clazz = (Class<? extends KryoMarker>) Class.forName(className);
        return getKryo().readObject(input, clazz);

    } catch (ClassNotFoundException e) {
        throw new IOException(e);
    }
}
 
开发者ID:noctarius,项目名称:hazelcast-unaware-serialization,代码行数:18,代码来源:KryoAvailableSerializer.java

示例9: readData

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput in) throws IOException {
	address = in.readUTF();
	partId = in.readInt();
	docCount = in.readInt();
	docCost = in.readLong();
	docInQueue = in.readInt();
	docActive = in.readInt();
	conCost = in.readLong();
	eltCount = in.readInt();
	eltCost = in.readLong();
	idxCount = in.readInt();
	idxCost = in.readLong();
	resCount = in.readInt();
	resCost = in.readLong();
}
 
开发者ID:dsukhoroslov,项目名称:bagri,代码行数:17,代码来源:PartitionStatistics.java

示例10: readData

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput in)
        throws IOException {

    id = in.readInt();
    name = in.readUTF();
    abbreviation = in.readUTF();
    country = in.readUTF();
    type = in.readUTF();
    sort = in.readInt();
    status = in.readUTF();
    occupied = in.readUTF();
    notes = in.readUTF();
    fipsState = in.readInt();
    assocPress = in.readUTF();
    standardFederalRegion = in.readUTF();
    censusRegion = in.readInt();
    censusRegionName = in.readUTF();
    censusDivision = in.readInt();
    censusDevisionName = in.readUTF();
    circuitCourt = in.readInt();
}
 
开发者ID:noctarius,项目名称:hazelcast-mapreduce-presentation,代码行数:23,代码来源:State.java

示例11: readData

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput in) throws IOException {
	hazelcastPort = in.readInt();
	indexName = in.readUTF();
	newMemberToSegmentMap = new HashMap<>();
	int count = in.readInt();

	for (int i = 0; i < count; i++) {
		MemberImpl mi = new MemberImpl();
		mi.readData(in);
		Set<Integer> segments = new HashSet<>();
		int segCount = in.readInt();
		for (int j = 0; j < segCount; j++) {
			segments.add(in.readInt());
		}
		newMemberToSegmentMap.put(mi, segments);
	}

}
 
开发者ID:lumongo,项目名称:lumongo,代码行数:20,代码来源:UpdateSegmentsTask.java

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

示例13: readData

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput in) throws IOException {
    id = in.readUTF();
    bookId = in.readUTF();
    cost = in.readDouble();
    quantity = in.readInt();
    inStock = in.readBoolean();
}
 
开发者ID:ivogm,项目名称:bookstore,代码行数:9,代码来源:BookCartItem.java

示例14: readData

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput in) throws IOException {
    totalPrice = in.readDouble();
    date = new Date(in.readLong());
    id = in.readLong();
    int count = in.readInt();
    items = new ArrayList<>(count);
    for(int i=0; i<count; i++) {
        BookCartItem cartItem = new BookCartItem();
        cartItem.readData(in);
        items.add(cartItem);
    }
}
 
开发者ID:ivogm,项目名称:bookstore,代码行数:14,代码来源:ShoppingCart.java

示例15: readData

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput in) throws IOException {
	id = in.readInt();
	topicName = in.readUTF();
	publisherId = in.readUTF();
	message = in.readByteArray();

	int rawInt = in.readInt();
	qos = rawInt != Byte.MIN_VALUE ? MqttQoS.valueOf(rawInt) : null;

	isRetain = in.readBoolean();
}
 
开发者ID:anyflow,项目名称:lannister,代码行数:13,代码来源:Message.java


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