Java Code Examples for io.protostuff.Input#handleUnknownField()

The following examples show how to use io.protostuff.Input#handleUnknownField() . 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: OffsetDateTimeSchema.java    From joyrpc with Apache License 2.0 6 votes vote down vote up
@Override
public void mergeFrom(final Input input, final OffsetDateTime message) throws IOException {
    while (true) {
        int number = input.readFieldNumber(this);
        switch (number) {
            case 0:
                return;
            case 1:
                LocalDateTime localDateTime = LocalDateTime.now();
                input.mergeObject(localDateTime, LocalDateTimeSchema.INSTANCE);
                setValue(FIELD_DATE_TIME, message, localDateTime);
                break;
            case 2:
                //不能使用0,0会缓存结果对象
                ZoneOffset offset = ZoneOffset.ofTotalSeconds(1);
                input.mergeObject(offset, ZoneOffsetSchema.INSTANCE);
                setValue(FIELD_ZONE_OFFSET, message, offset);
                break;
            default:
                input.handleUnknownField(number, this);
        }
    }
}
 
Example 2
Source File: BulkResultsInfoResponse.java    From datawave with Apache License 2.0 6 votes vote down vote up
public void mergeFrom(Input input, History message) throws IOException {
    int number;
    while ((number = input.readFieldNumber(this)) != 0) {
        switch (number) {
            case 1:
                message.setState(input.readString());
                break;
            case 2:
                message.setTimestamp(input.readUInt64());
                break;
            default:
                input.handleUnknownField(number, this);
                break;
        }
    }
}
 
Example 3
Source File: DefaultFieldCardinality.java    From datawave with Apache License 2.0 6 votes vote down vote up
@Override
public void mergeFrom(Input input, DefaultFieldCardinality message) throws IOException {
    int number;
    while ((number = input.readFieldNumber(this)) != 0) {
        switch (number) {
            case 1:
                message.columnVisibility = input.readString();
                break;
            case 2:
                message.cardinality = input.readUInt64();
                break;
            case 3:
                message.lower = input.readString();
                break;
            case 4:
                message.upper = input.readString();
                break;
            default:
                input.handleUnknownField(number, this);
                break;
        }
    }
}
 
Example 4
Source File: MonthDaySchema.java    From joyrpc with Apache License 2.0 6 votes vote down vote up
@Override
public void mergeFrom(final Input input, final MonthDay message) throws IOException {
    while (true) {
        int number = input.readFieldNumber(this);
        switch (number) {
            case 0:
                return;
            case 1:
                setValue(FIELD_MONTH, message, input.readInt32());
                break;
            case 2:
                setValue(FIELD_DAY, message, input.readInt32());
                break;
            default:
                input.handleUnknownField(number, this);
        }
    }
}
 
Example 5
Source File: ResultFile.java    From datawave with Apache License 2.0 6 votes vote down vote up
public void mergeFrom(Input input, ResultFile message) throws IOException {
    int number;
    while ((number = input.readFieldNumber(this)) != 0) {
        switch (number) {
            case 1:
                message.setFileName(input.readString());
                break;
            case 2:
                message.setLength(input.readUInt64());
                break;
            default:
                input.handleUnknownField(number, this);
                break;
        }
    }
}
 
Example 6
Source File: EdgeSummaryQueryMessage.java    From datawave with Apache License 2.0 6 votes vote down vote up
@Override
public void mergeFrom(Input input, EdgeSummaryQueryMessage message) throws IOException {
    int number;
    while ((number = input.readFieldNumber(this)) != 0) {
        switch (number) {
            case 1:
                message.scanLimitHit = input.readBool();
                break;
            case 2:
                message.queryLogicWarning = input.readString();
                break;
            default:
                input.handleUnknownField(number, this);
                break;
        }
    }
}
 
Example 7
Source File: LocalDateTimeSchema.java    From joyrpc with Apache License 2.0 6 votes vote down vote up
@Override
public void mergeFrom(final Input input, final LocalDateTime message) throws IOException {
    while (true) {
        int number = input.readFieldNumber(this);
        switch (number) {
            case 0:
                return;
            case 1:
                LocalDate localDate = LocalDate.now();
                input.mergeObject(localDate, LocalDateSchema.INSTANCE);
                setValue(FIELD_DATE, message, localDate);
                break;
            case 2:
                LocalTime localTime = LocalTime.now();
                input.mergeObject(localTime, LocalTimeSchema.INSTANCE);
                setValue(FIELD_TIME, message, localTime);
                break;
            default:
                input.handleUnknownField(number, this);
        }
    }
}
 
Example 8
Source File: BulkResultsInfoResponse.java    From datawave with Apache License 2.0 6 votes vote down vote up
public void mergeFrom(Input input, Job message) throws IOException {
    int number;
    while ((number = input.readFieldNumber(this)) != 0) {
        switch (number) {
            case 1:
                message.setJobId(input.readString());
                break;
            case 2:
                if (message.history == null)
                    message.history = new TreeSet<History>();
                message.history.add(input.mergeObject(null, History.getSchema()));
                break;
            default:
                input.handleUnknownField(number, this);
                break;
        }
    }
}
 
Example 9
Source File: Metadata.java    From datawave with Apache License 2.0 6 votes vote down vote up
@Override
public void mergeFrom(Input input, Metadata message) throws IOException {
    int number;
    while ((number = input.readFieldNumber(this)) != 0) {
        switch (number) {
            case 1:
                message.dataType = input.readString();
                break;
            case 2:
                message.internalId = input.readString();
                break;
            case 3:
                message.table = input.readString();
                break;
            case 4:
                message.row = input.readString();
                break;
            default:
                input.handleUnknownField(number, this);
                break;
        }
    }
}
 
Example 10
Source File: YearMonthSchema.java    From joyrpc with Apache License 2.0 6 votes vote down vote up
@Override
public void mergeFrom(final Input input, final YearMonth message) throws IOException {
    while (true) {
        int number = input.readFieldNumber(this);
        switch (number) {
            case 0:
                return;
            case 1:
                setValue(FIELD_YEAR, message, input.readInt32());
                break;
            case 2:
                setValue(FIELD_MONTH, message, input.readInt32());
                break;
            default:
                input.handleUnknownField(number, this);
        }
    }
}
 
Example 11
Source File: ZoneIdSchema.java    From joyrpc with Apache License 2.0 5 votes vote down vote up
@Override
public void mergeFrom(final Input input, final ZoneId message) throws IOException {
    while (true) {
        int number = input.readFieldNumber(this);
        switch (number) {
            case 0:
                return;
            case 1:
                setValue(FIELD_ID, message, input.readString());
                break;
            default:
                input.handleUnknownField(number, this);
        }
    }
}
 
Example 12
Source File: BulkResultsInfoResponseList.java    From datawave with Apache License 2.0 5 votes vote down vote up
public void mergeFrom(Input input, BulkResultsInfoResponseList message) throws IOException {
    LinkedList<QueryExceptionType> exceptions = null;
    int number;
    while ((number = input.readFieldNumber(this)) != 0) {
        switch (number) {
            case 1:
                message.setQueryId(input.readString());
                break;
            case 2:
                message.setLogicName(input.readString());
                break;
            case 3:
                message.setOperationTimeMS(input.readUInt64());
                break;
            case 4:
                message.addMessage(input.readString());
                break;
            case 5:
                if (exceptions == null)
                    exceptions = new LinkedList<QueryExceptionType>();
                exceptions.add(input.mergeObject(null, QueryExceptionType.getSchema()));
                break;
            case 6:
                if (message.bulkResults == null)
                    message.bulkResults = new ArrayList<BulkResultsInfoResponse>();
                message.bulkResults.add(input.mergeObject(null, BulkResultsInfoResponse.getSchema()));
                break;
            default:
                input.handleUnknownField(number, this);
                break;
        }
    }
    if (exceptions != null)
        message.setExceptions(exceptions);
}
 
Example 13
Source File: IndexStatsResponse.java    From datawave with Apache License 2.0 5 votes vote down vote up
@Override
public void mergeFrom(Input input, IndexStatsResponse other) throws IOException {
    int number;
    while ((number = input.readFieldNumber(this)) != 0) {
        switch (number) {
            case 1:
                other.fieldStats.add(input.mergeObject(null, FieldStat.SCHEMA));
            default:
                input.handleUnknownField(number, SCHEMA);
        }
    }
}
 
Example 14
Source File: DefaultEvent.java    From datawave with Apache License 2.0 5 votes vote down vote up
public void mergeFrom(Input input, DefaultEvent message) throws IOException {
    int number;
    Schema<DefaultField> schema = null;
    while ((number = input.readFieldNumber(this)) != 0) {
        switch (number) {
            case 1:
                message.markings = new HashMap<String,String>();
                input.mergeObject(message.markings, MapSchema.SCHEMA);
                break;
            case 2:
                message.metadata = input.mergeObject(null, Metadata.getSchema());
                break;
            case 3:
                if (message.fields == null)
                    message.fields = new ArrayList<DefaultField>();
                if (null == schema) {
                    DefaultField field = new DefaultField();
                    schema = field.cachedSchema();
                }
                DefaultField f = input.mergeObject(null, schema);
                message.fields.add(f);
                break;
            default:
                input.handleUnknownField(number, this);
                break;
        }
    }
}
 
Example 15
Source File: RuntimePipeSchema.java    From protostuff with Apache License 2.0 5 votes vote down vote up
@Override
protected void transfer(Pipe pipe, Input input, Output output)
        throws IOException
{
    for (int number = input.readFieldNumber(wrappedSchema); number != 0; number = input
            .readFieldNumber(wrappedSchema))
    {
        final Field<T> field = fieldsMap.getFieldByNumber(number);
        if (field == null)
            input.handleUnknownField(number, wrappedSchema);
        else
            field.transfer(pipe, input, output, field.repeated);
    }
}
 
Example 16
Source File: QueryMetricListResponse.java    From datawave with Apache License 2.0 5 votes vote down vote up
public void mergeFrom(Input input, QueryMetricListResponse message) throws IOException {
    LinkedList<QueryExceptionType> exceptions = null;
    int number;
    while ((number = input.readFieldNumber(this)) != 0) {
        switch (number) {
            case 1:
                message.setOperationTimeMS(input.readUInt64());
                break;
            case 2:
                message.addMessage(input.readString());
                break;
            case 3:
                if (exceptions == null)
                    exceptions = new LinkedList<QueryExceptionType>();
                exceptions.add(input.mergeObject(null, QueryExceptionType.getSchema()));
                break;
            case 4:
                if (message.result == null)
                    message.result = new ArrayList<QueryMetric>();
                message.result.add(input.mergeObject(null, QueryMetric.getSchema()));
                break;
            
            case 5:
                message.numResults = input.readInt32();
                break;
            default:
                input.handleUnknownField(number, this);
                break;
        }
    }
    if (exceptions != null)
        message.setExceptions(exceptions);
}
 
Example 17
Source File: FacetQueryResponse.java    From datawave with Apache License 2.0 5 votes vote down vote up
public void mergeFrom(Input input, FacetQueryResponse message) throws IOException {
    LinkedList<QueryExceptionType> exceptions = null;
    int number;
    while ((number = input.readFieldNumber(this)) != 0) {
        switch (number) {
            case 1:
                message.setQueryId(input.readString());
                break;
            case 2:
                message.setLogicName(input.readString());
                break;
            case 3:
                message.setOperationTimeMS(input.readUInt64());
                break;
            case 4:
                message.addMessage(input.readString());
                break;
            case 5:
                if (exceptions == null)
                    exceptions = new LinkedList<QueryExceptionType>();
                exceptions.add(input.mergeObject(null, QueryExceptionType.getSchema()));
                break;
            case 6:
                if (message.facets == null)
                    message.facets = new ArrayList<DefaultFacets>();
                message.facets.add(input.mergeObject(null, DefaultFacets.getSchema()));
                break;
            default:
                input.handleUnknownField(number, this);
                break;
        }
    }
    if (exceptions != null)
        message.setExceptions(exceptions);
}
 
Example 18
Source File: ZonedDateTimeSchema.java    From joyrpc with Apache License 2.0 5 votes vote down vote up
@Override
public void mergeFrom(final Input input, final ZonedDateTime message) throws IOException {
    while (true) {
        int number = input.readFieldNumber(this);
        switch (number) {
            case 0:
                return;
            case 1:
                LocalDateTime localDateTime = LocalDateTime.now();
                input.mergeObject(localDateTime, LocalDateTimeSchema.INSTANCE);
                setValue(FIELD_DATE_TIME, message, localDateTime);
                break;
            case 2:
                //不能使用0,0会缓存结果对象
                ZoneOffset offset = ZoneOffset.ofTotalSeconds(1);
                input.mergeObject(offset, ZoneOffsetSchema.INSTANCE);
                setValue(FIELD_ZONE_OFFSET, message, offset);
                break;
            case 3:
                ZoneId zoneId = ZoneId.of("America/New_York");
                input.mergeObject(zoneId, ZoneIdSchema.INSTANCE);
                setValue(FIELD_ZONE_ID, message, zoneId);
                break;
            default:
                input.handleUnknownField(number, this);
        }
    }
}
 
Example 19
Source File: DefaultEventQueryResponse.java    From datawave with Apache License 2.0 4 votes vote down vote up
@Override
public void mergeFrom(Input input, DefaultEventQueryResponse message) throws IOException {
    LinkedList<QueryExceptionType> exceptions = null;
    int number;
    Schema<DefaultEvent> schema = null;
    while ((number = input.readFieldNumber(this)) != 0) {
        switch (number) {
            case 1:
                message.totalEvents = input.readUInt64();
                break;
            case 2:
                message.returnedEvents = input.readUInt64();
                break;
            case 3:
                if (message.fields == null)
                    message.fields = new ArrayList<String>();
                message.fields.add(input.readString());
                break;
            case 4:
                if (message.events == null)
                    message.events = new ArrayList<DefaultEvent>();
                if (null == schema) {
                    DefaultEvent event = new DefaultEvent();
                    schema = event.cachedSchema();
                }
                message.events.add(input.mergeObject(null, schema));
                break;
            case 5:
                message.setQueryId(input.readString());
                break;
            case 6:
                message.setLogicName(input.readString());
                break;
            case 7:
                message.setOperationTimeMS(input.readUInt64());
                break;
            case 8:
                message.addMessage(input.readString());
                break;
            case 9:
                if (exceptions == null)
                    exceptions = new LinkedList<QueryExceptionType>();
                exceptions.add(input.mergeObject(null, QueryExceptionType.getSchema()));
                break;
            default:
                input.handleUnknownField(number, this);
                break;
        }
    }
    if (exceptions != null)
        message.setExceptions(exceptions);
}
 
Example 20
Source File: DefaultEdge.java    From datawave with Apache License 2.0 4 votes vote down vote up
@Override
public void mergeFrom(Input input, DefaultEdge message) throws IOException {
    ArrayList<Long> counts = new ArrayList<Long>();
    int number;
    while ((number = input.readFieldNumber(this)) != 0) {
        switch (number) {
            case 1:
                message.columnVisibility = input.readString();
                break;
            case 2:
                message.source = input.readString();
                break;
            case 3:
                message.sink = input.readString();
                break;
            case 4:
                message.edgeType = input.readString();
                break;
            case 5:
                message.edgeRelationship = input.readString();
                break;
            case 6:
                message.edgeAttribute1Source = input.readString();
                break;
            case 7:
                message.statsType = input.readString();
                break;
            case 8:
                message.date = input.readString();
                break;
            case 9:
                message.count = input.readUInt64();
                break;
            case 10:
                counts.add(input.readUInt64());
                break;
            case 11:
                message.edgeAttribute3 = input.readString();
                break;
            case 12:
                message.edgeAttribute2 = input.readString();
                break;
            case 13:
                message.loadDate = input.readString();
                break;
            case 14:
                message.activityDate = input.readString();
                break;
            default:
                input.handleUnknownField(number, this);
                break;
        }
    }
    if (!counts.isEmpty()) {
        message.counts = new ArrayList<Long>(counts.size());
        for (int i = 0; i < message.counts.size(); ++i) {
            message.counts.set(i, counts.get(i));
        }
    }
}