Java Code Examples for com.hazelcast.nio.Address#readData()

The following examples show how to use com.hazelcast.nio.Address#readData() . 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: LogicalNodeTable.java    From snowcast with Apache License 2.0 6 votes vote down vote up
@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);
}
 
Example 2
Source File: BackupAttachLogicalNodeOperation.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 3
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);
}