Java Code Examples for com.hazelcast.nio.ObjectDataInput#readInt()

The following examples show how to use com.hazelcast.nio.ObjectDataInput#readInt() . 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: BackupDetachLogicalNodeOperation.java    From snowcast with Apache License 2.0 6 votes vote down vote up
@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);
}
 
Example 2
Source File: AttachLogicalNodeOperation.java    From snowcast with Apache License 2.0 5 votes vote down vote up
@Override
protected void readInternal(ObjectDataInput in)
        throws IOException {

    super.readInternal(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);
}
 
Example 3
Source File: ConversionUtils.java    From vertx-hazelcast with Apache License 2.0 5 votes vote down vote up
@Override
public void readData(ObjectDataInput objectDataInput) throws IOException {
  String className = objectDataInput.readUTF();
  int length = objectDataInput.readInt();
  byte[] bytes = new byte[length];
  objectDataInput.readFully(bytes);
  try {
    Class<?> clazz = loadClass(className);
    clusterSerializable = (ClusterSerializable) clazz.newInstance();
    clusterSerializable.readFromBuffer(0, Buffer.buffer(bytes));
  } catch (Exception e) {
    throw new IOException("Failed to load class " + className, e);
  }
}
 
Example 4
Source File: SequencerDefinitionSerializerHook.java    From snowcast with Apache License 2.0 5 votes vote down vote up
@Override
public SequencerDefinition read(@Nonnull ObjectDataInput in)
        throws IOException {

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

    SnowcastEpoch epoch = SnowcastEpoch.byTimestamp(epochOffset);
    return new SequencerDefinition(sequencerName, epoch, maxLogicalNodeCount, backupCount);
}
 
Example 5
Source File: PartitionReplication.java    From snowcast with Apache License 2.0 5 votes vote down vote up
@Override
public void readData(@Nonnull ObjectDataInput in)
        throws IOException {

    partitionId = in.readInt();
    int size = in.readInt();
    logicalNodeTables = new ArrayList<>(size);
    for (int i = 0; i < size; i++) {
        LogicalNodeTable logicalNodeTable = LogicalNodeTable.readLogicalNodeTable(partitionId, in);
        logicalNodeTables.add(logicalNodeTable);
    }
}
 
Example 6
Source File: DetachLogicalNodeOperation.java    From snowcast with Apache License 2.0 5 votes vote down vote up
@Override
protected void readInternal(ObjectDataInput in)
        throws IOException {

    super.readInternal(in);
    logicalNodeId = in.readInt();

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

    SnowcastEpoch epoch = SnowcastEpoch.byTimestamp(epochOffset);
    definition = new SequencerDefinition(getSequencerName(), epoch, maxLogicalNodeCount, backupCount);
}
 
Example 7
Source File: EntryListenerImpl.java    From hazelcast-simulator with Apache License 2.0 5 votes vote down vote up
@Override
public void readData(ObjectDataInput in) throws IOException {
    addCount = in.readObject();
    removeCount = in.readObject();
    updateCount = in.readObject();
    evictCount = in.readObject();

    minDelayMs = in.readInt();
    maxDelayMs = in.readInt();
}
 
Example 8
Source File: BackupCreateSequencerDefinitionOperation.java    From snowcast with Apache License 2.0 5 votes vote down vote up
@Override
protected void readInternal(ObjectDataInput in)
        throws IOException {

    super.readInternal(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);
}
 
Example 9
Source File: TopicSubscription.java    From lannister with Apache License 2.0 5 votes vote down vote up
@Override
public void readData(ObjectDataInput in) throws IOException {
	clientId = in.readUTF();
	topicFilter = in.readUTF();

	int rawInt = in.readInt();
	qos = rawInt != Integer.MIN_VALUE ? MqttQoS.valueOf(rawInt) : null;
}
 
Example 10
Source File: SerializableIntegerSet.java    From lannister with Apache License 2.0 5 votes vote down vote up
@Override
public void readData(ObjectDataInput in) throws IOException {
	int size = in.readInt();

	for (int i = 0; i < size; ++i) {
		this.add(in.readInt());
	}
}
 
Example 11
Source File: DataSerializableDomainObject.java    From hazelcast-simulator with Apache License 2.0 5 votes vote down vote up
@Override
public void readData(ObjectDataInput in) throws IOException {
    key = in.readUTF();
    stringVal = in.readUTF();
    doubleVal = in.readDouble();
    longVal = in.readLong();
    intVal = in.readInt();
}
 
Example 12
Source File: OutboundMessageStatus.java    From lannister with Apache License 2.0 5 votes vote down vote up
@Override
public void readData(ObjectDataInput in) throws IOException {
	super.readData(in);

	Byte rawByte = in.readByte();
	status = rawByte != Byte.MIN_VALUE ? Status.valueOf(rawByte) : null;

	int rawInt = in.readInt();
	qos = rawInt != Byte.MIN_VALUE ? MqttQoS.valueOf(rawInt) : null;
}
 
Example 13
Source File: MessageStatus.java    From lannister with Apache License 2.0 5 votes vote down vote up
@Override
public void readData(ObjectDataInput in) throws IOException {
	messageKey = in.readUTF();
	clientId = in.readUTF();
	messageId = in.readInt();
	topicName = in.readUTF();

	long rawLong = in.readLong();
	createTime = rawLong != Long.MIN_VALUE ? new Date(rawLong) : null;

	rawLong = in.readLong();
	updateTime = rawLong != Long.MIN_VALUE ? new Date(rawLong) : null;
}
 
Example 14
Source File: Message.java    From lannister with Apache License 2.0 5 votes vote down vote up
@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();
}
 
Example 15
Source File: HostInfo.java    From Knowage-Server with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public void readData(ObjectDataInput in) throws IOException {
	availableProcessors = in.readInt();
	hardwareFingerprint = in.readUTF();
	hardwareId = in.readUTF();
}
 
Example 16
Source File: ExtractorMapTest.java    From hazelcast-simulator with Apache License 2.0 4 votes vote down vote up
@Override
public void readData(ObjectDataInput in) throws IOException {
    count = in.readInt();
    payloadField = in.readObject();
}
 
Example 17
Source File: MapGetVsQueryTest.java    From hazelcast-simulator with Apache License 2.0 4 votes vote down vote up
@Override
public void readData(ObjectDataInput in) throws IOException {
    id = in.readInt();
}
 
Example 18
Source File: HazelcastSerializationAdapter.java    From bucket4j with Apache License 2.0 4 votes vote down vote up
@Override
public int readInt(ObjectDataInput source) throws IOException {
    return source.readInt();
}
 
Example 19
Source File: MultiValueMapTest.java    From hazelcast-simulator with Apache License 2.0 4 votes vote down vote up
@Override
public void readData(ObjectDataInput in) throws IOException {
    count = in.readInt();
    payloadField = in.readObject();
}
 
Example 20
Source File: HazelcastServerID.java    From vertx-hazelcast with Apache License 2.0 4 votes vote down vote up
@Override
public void readData(ObjectDataInput dataInput) throws IOException {
  port = dataInput.readInt();
  host = dataInput.readUTF();
}