Java Code Examples for org.apache.ignite.binary.BinaryReader#readString()

The following examples show how to use org.apache.ignite.binary.BinaryReader#readString() . 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: IgniteConsumerConfig.java    From joyqueue with Apache License 2.0 6 votes vote down vote up
@Override
public void readBinary(BinaryReader reader) throws BinaryObjectException {
    id = reader.readString(COLUMN_ID);
    this.consumerPolicy = Consumer.ConsumerPolicy.Builder.build()
            .nearby(reader.readBoolean(COLUMN_NEAR_BY))
            .archive(reader.readBoolean(COLUMN_ARCHIVE))
            .retry(reader.readBoolean(COLUMN_RETRY))
            .ackTimeout(reader.readInt(COLUMN_ACK_TIMEOUT))
            .batchSize(reader.readShort(COLUMN_BATCH_SIZE))
            .concurrent(reader.readInt(COLUMN_CONCURRENT))
            .delay(reader.readInt(COLUMN_DELAY))
            .paused(reader.readBoolean(COLUMN_PAUSED))
            .errTimes(reader.readInt(COLUMN_ERROR_TIMES))
            .maxPartitionNum(reader.readInt(COLUMN_MAX_PARTITION_NUM))
            .retryReadProbability(reader.readInt(COLUMN_RETRY_READ_PROBABILITY))
            .blackList(reader.readString(COLUMN_BLACK_LIST))
            .filters(reader.readMap(COLUMN_FILTERS)).create();
    this.retryPolicy = new RetryPolicy.Builder().build()
            .maxRetrys(reader.readInt(COLUMN_MAX_RETRYS))
            .maxRetryDelay(reader.readInt(COLUMN_MAX_RETRY_DELAY))
            .retryDelay(reader.readInt(COLUMN_RETRY_DELAY))
            .expireTime(reader.readInt(COLUMN_EXPIRE_TIME))
            .create();
    this.limitPolicy = new Consumer.ConsumerLimitPolicy(reader.readInt(COLUMN_LIMIT_TPS), reader.readInt(COLUMN_LIMIT_TRAFFIC));
}
 
Example 2
Source File: IgniteComputeConfigVariationsFullApiTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
    Object arg = reader.readObject("arg");

    setArguments(arg);

    isVal = reader.readBoolean("isVal");
    bVal = reader.readByte("bVal");
    cVal = reader.readChar("cVal");
    sVal = reader.readShort("sVal");
    intVal = reader.readInt("intVal");
    lVal = reader.readLong("lVal");
    fltVal = reader.readFloat("fltVal");
    dblVal = reader.readDouble("dblVal");
    strVal = reader.readString("strVal");
    arrVal = reader.readObjectArray("arrVal");
    eVal = reader.readEnum("eVal");
}
 
Example 3
Source File: IgniteComputeConfigVariationsFullApiTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
    arg = reader.readObject("arg");

    isVal = reader.readBoolean("isVal");
    bVal = reader.readByte("bVal");
    cVal = reader.readChar("cVal");
    sVal = reader.readShort("sVal");
    intVal = reader.readInt("intVal");
    lVal = reader.readLong("lVal");
    fltVal = reader.readFloat("fltVal");
    dblVal = reader.readDouble("dblVal");
    strVal = reader.readString("strVal");
    arrVal = reader.readObjectArray("arrVal");
    eVal = reader.readEnum("eVal");
}
 
Example 4
Source File: IgniteDataCenter.java    From joyqueue with Apache License 2.0 5 votes vote down vote up
@Override
public void readBinary(BinaryReader reader) throws BinaryObjectException {
    this.region = reader.readString(COLUMN_REGION);
    this.code = reader.readString(COLUMN_CODE);
    this.name = reader.readString(COLUMN_NAME);
    this.setUrl(reader.readString(COLUMN_URL));
}
 
Example 5
Source File: IgniteProducer.java    From joyqueue with Apache License 2.0 5 votes vote down vote up
@Override
public void readBinary(BinaryReader reader) throws BinaryObjectException {
    //this.id = reader.readString(COLUMN_ID);
    this.topic = new TopicName(reader.readString(COLUMN_TOPIC), reader.readString(COLUMN_NAMESPACE));
    this.app = reader.readString(COLUMN_APP);
    this.clientType = ClientType.valueOf(reader.readByte(COLUMN_CLIENT_TYPE));
    this.type=Type.PRODUCTION;
}
 
Example 6
Source File: IgniteConfig.java    From joyqueue with Apache License 2.0 5 votes vote down vote up
@Override
public void readBinary(BinaryReader reader) throws BinaryObjectException {
    //this.id = reader.readString(COLUMN_ID);
    this.group = reader.readString(COLUMN_CFG_GROUP);
    this.key = reader.readString(COLUMN_CFG_KEY);
    this.value = reader.readString(COLUMN_CFG_VALUE);
}
 
Example 7
Source File: PersonNoIndex.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
    id = reader.readInt("id");
    orgId = reader.readInt("orgId");
    firstName = reader.readString("firstName");
    lastName = reader.readString("lastName");
    salary = reader.readDouble("salary");
}
 
Example 8
Source File: IgniteConsumer.java    From joyqueue with Apache License 2.0 5 votes vote down vote up
@Override
public void readBinary(BinaryReader reader) throws BinaryObjectException {
    this.id = reader.readString(COLUMN_ID);
    this.topic = new TopicName(reader.readString(COLUMN_TOPIC), reader.readString(COLUMN_NAMESPACE));
    this.app = reader.readString(COLUMN_APP);
    this.clientType = ClientType.valueOf(reader.readByte(COLUMN_CLIENT_TYPE));
    this.type = Type.CONSUMPTION;
    this.topicType = TopicType.valueOf(reader.readByte(COLUMN_TOPIC_TYPE));
}
 
Example 9
Source File: IgniteAppToken.java    From joyqueue with Apache License 2.0 5 votes vote down vote up
@Override
public void readBinary(BinaryReader reader) throws BinaryObjectException {
    this.id = reader.readLong(COLUMN_ID);
    this.app = reader.readString(COLUMN_APP);
    this.token = reader.readString(COLUMN_TOKEN);
    this.effectiveTime = reader.readDate(COLUMN_EFFECTIVE_TIME);
    this.expirationTime = reader.readDate(COLUMN_EXPIRATION_TIME);
}
 
Example 10
Source File: IgniteBroker.java    From joyqueue with Apache License 2.0 5 votes vote down vote up
@Override
public void readBinary(BinaryReader reader) throws BinaryObjectException {
    this.id = reader.readInt(COLUMN_BROKER_ID);
    this.ip = reader.readString(COLUMN_IP);
    this.port = reader.readInt(COLUMN_PORT);
    this.dataCenter = reader.readString(COLUMN_DATA_CENTER);
    this.retryType = reader.readString(COLUMN_RETRY_TYPE);
    this.permission = PermissionEnum.value(reader.readString(COLUMN_PERMISSION));
}
 
Example 11
Source File: IgnitePartitionGroup.java    From joyqueue with Apache License 2.0 5 votes vote down vote up
@Override
public void readBinary(BinaryReader reader) throws BinaryObjectException {
    //this.id = reader.readString(COLUMN_ID);
    this.topic = new TopicName(reader.readString(COLUMN_TOPIC), reader.readString(COLUMN_NAMESPACE));
    this.group = reader.readInt(COLUMN_GROUP);
    this.leader = reader.readInt(COLUMN_LEADER);
    this.term = reader.readInt(COLUMN_TERM);
    String isrStr = reader.readString(COLUMN_ISR);
    String partitionsStr = reader.readString(COLUMN_PARTITIONS);
    String replicasStr = reader.readString(COLUMN_REPLICAS);
    String column_learnersStr = reader.readString(COLUMN_LEARNERS);
    this.isrs = new TreeSet<>();
    this.learners = new TreeSet<>();
    this.partitions = new TreeSet<>();
    this.replicas = new TreeSet<>();
    if (StringUtils.isNoneEmpty(isrStr) && isrStr.length() > 2) {
        isrs.addAll(Arrays.stream(isrStr.substring(1, isrStr.length() - 1).split(",")).map(s -> Integer.parseInt(s.trim())).collect(Collectors.toList()));
    }
    if (StringUtils.isNoneEmpty(column_learnersStr) && column_learnersStr.length() > 2) {
        this.learners.addAll(Arrays.stream(isrStr.substring(1, column_learnersStr.length() - 1).split(",")).map(s -> Integer.parseInt(s.trim())).collect(Collectors.toList()));
    }
    if (StringUtils.isNoneEmpty(partitionsStr) && partitionsStr.length() > 2) {
        this.partitions.addAll(Arrays.stream(partitionsStr.substring(1, partitionsStr.length() - 1).split(",")).map(s -> Short.parseShort(s.trim())).collect(Collectors.toList()));
    }
    if (StringUtils.isNoneEmpty(replicasStr) && replicasStr.length() > 2) {
        this.replicas.addAll(Arrays.stream(replicasStr.substring(1, replicasStr.length() - 1).split(",")).map(s -> Integer.parseInt(s.trim())).collect(Collectors.toList()));
    }
    this.setElectType(ElectType.value(reader.readString(COLUMN_ELECT_TYPE)));
    this.recLeader = reader.readInt(COLUMN_REC_LEADER);
}
 
Example 12
Source File: CacheOffheapBatchIndexingBaseTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
    id = reader.readInt("id");
    orgId = reader.readInt("orgId");
    firstName = reader.readString("firstName");
    lastName = reader.readString("lastName");
    salary = reader.readDouble("salary");
}
 
Example 13
Source File: Address.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
    street = reader.readString("street");
    zip = reader.readInt("zip");
}
 
Example 14
Source File: Organization.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
    id = reader.readInt("id");
    name = reader.readString("name");
}
 
Example 15
Source File: CacheOffheapBatchIndexingBaseTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
    id = reader.readInt("id");
    name = reader.readString("name");
}
 
Example 16
Source File: BinaryArrayIdentityResolverSelfTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
    a = reader.readInt("a");
    b = reader.readString("b");
    c = reader.readLong("c");
}
 
Example 17
Source File: JournalReadItem.java    From spring-boot-akka-event-sourcing-starter with Apache License 2.0 4 votes vote down vote up
@Override
public void readBinary(BinaryReader in) throws BinaryObjectException {
	orderId = in.readString(ORDER_ID);
	status = in.readString(STATUS_FIELD);
}
 
Example 18
Source File: IgniteNamespace.java    From joyqueue with Apache License 2.0 4 votes vote down vote up
@Override
public void readBinary(BinaryReader reader) throws BinaryObjectException {
    this.code = reader.readString(COLUMN_CODE);
    this.name = reader.readString(COLUMN_NAME);
}
 
Example 19
Source File: IgniteConfigVariationsAbstractTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
    val = reader.readInt("val");
    strVal = reader.readString("strVal");
    enumVal = reader.readEnum("enumVal");
}
 
Example 20
Source File: IgniteMessage.java    From joyqueue with Apache License 2.0 4 votes vote down vote up
@Override
public void readBinary(BinaryReader reader) throws BinaryObjectException {
    reader.readInt(COLUMN_MESSAGE_ID);
    type = reader.readString(COLUMN_TYPE);
    content = reader.readString(COLUMN_CONTENT);
}