Evgeny Stanilovsky created IGNITE-17287:
-------------------------------------------

             Summary: SchemaSerializerImpl and ClientMessagePacker have the 
same types (un)pack code functionality, deduplication needed.
                 Key: IGNITE-17287
                 URL: https://issues.apache.org/jira/browse/IGNITE-17287
             Project: Ignite
          Issue Type: Improvement
          Components: sql
            Reporter: Evgeny Stanilovsky


Check for example:

ClientMessagePacker#packDateTime:

{code:java}
    public void packDateTime(LocalDateTime val) {
        packExtensionTypeHeader(ClientMsgPackType.DATETIME);

        buf.writeInt(val.getYear());
        buf.writeByte(val.getMonthValue());
        buf.writeByte(val.getDayOfMonth());
        buf.writeByte(val.getHour());
        buf.writeByte(val.getMinute());
        buf.writeByte(val.getSecond());
        buf.writeInt(val.getNano());
    }
{code}

SchemaSerializerImpl#appendDefaultValue

{code:java}
            case DATETIME: {
                LocalDateTime date = (LocalDateTime) val;

                buf.putInt(date.getYear());
                buf.put((byte) date.getMonthValue());
                buf.put((byte) date.getDayOfMonth());
                buf.put((byte) date.getHour());
                buf.put((byte) date.getMinute());
                buf.put((byte) date.getSecond());
                buf.putInt(date.getNano());

                break;
            }
{code}





--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to