Ejemplo n.º 1
0
        public override string ToString()
        {
            StringBuilder __sb = new StringBuilder("PageHeader(");

            __sb.Append(", Type: ");
            __sb.Append(Type);
            __sb.Append(", Uncompressed_page_size: ");
            __sb.Append(Uncompressed_page_size);
            __sb.Append(", Compressed_page_size: ");
            __sb.Append(Compressed_page_size);
            if (__isset.crc)
            {
                __sb.Append(", Crc: ");
                __sb.Append(Crc);
            }
            if (Data_page_header != null && __isset.data_page_header)
            {
                __sb.Append(", Data_page_header: ");
                __sb.Append(Data_page_header == null ? "<null>" : Data_page_header.ToString());
            }
            if (Index_page_header != null && __isset.index_page_header)
            {
                __sb.Append(", Index_page_header: ");
                __sb.Append(Index_page_header == null ? "<null>" : Index_page_header.ToString());
            }
            if (Dictionary_page_header != null && __isset.dictionary_page_header)
            {
                __sb.Append(", Dictionary_page_header: ");
                __sb.Append(Dictionary_page_header == null ? "<null>" : Dictionary_page_header.ToString());
            }
            if (Data_page_header_v2 != null && __isset.data_page_header_v2)
            {
                __sb.Append(", Data_page_header_v2: ");
                __sb.Append(Data_page_header_v2 == null ? "<null>" : Data_page_header_v2.ToString());
            }
            __sb.Append(")");
            return(__sb.ToString());
        }
Ejemplo n.º 2
0
 public void Write(TProtocol oprot)
 {
     oprot.IncrementRecursionDepth();
     try
     {
         TStruct struc = new TStruct("PageHeader");
         oprot.WriteStructBegin(struc);
         TField field = new TField();
         field.Name = "type";
         field.Type = TType.I32;
         field.ID   = 1;
         oprot.WriteFieldBegin(field);
         oprot.WriteI32((int)Type);
         oprot.WriteFieldEnd();
         field.Name = "uncompressed_page_size";
         field.Type = TType.I32;
         field.ID   = 2;
         oprot.WriteFieldBegin(field);
         oprot.WriteI32(Uncompressed_page_size);
         oprot.WriteFieldEnd();
         field.Name = "compressed_page_size";
         field.Type = TType.I32;
         field.ID   = 3;
         oprot.WriteFieldBegin(field);
         oprot.WriteI32(Compressed_page_size);
         oprot.WriteFieldEnd();
         if (__isset.crc)
         {
             field.Name = "crc";
             field.Type = TType.I32;
             field.ID   = 4;
             oprot.WriteFieldBegin(field);
             oprot.WriteI32(Crc);
             oprot.WriteFieldEnd();
         }
         if (Data_page_header != null && __isset.data_page_header)
         {
             field.Name = "data_page_header";
             field.Type = TType.Struct;
             field.ID   = 5;
             oprot.WriteFieldBegin(field);
             Data_page_header.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (Index_page_header != null && __isset.index_page_header)
         {
             field.Name = "index_page_header";
             field.Type = TType.Struct;
             field.ID   = 6;
             oprot.WriteFieldBegin(field);
             Index_page_header.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (Dictionary_page_header != null && __isset.dictionary_page_header)
         {
             field.Name = "dictionary_page_header";
             field.Type = TType.Struct;
             field.ID   = 7;
             oprot.WriteFieldBegin(field);
             Dictionary_page_header.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (Data_page_header_v2 != null && __isset.data_page_header_v2)
         {
             field.Name = "data_page_header_v2";
             field.Type = TType.Struct;
             field.ID   = 8;
             oprot.WriteFieldBegin(field);
             Data_page_header_v2.Write(oprot);
             oprot.WriteFieldEnd();
         }
         oprot.WriteFieldStop();
         oprot.WriteStructEnd();
     }
     finally
     {
         oprot.DecrementRecursionDepth();
     }
 }
Ejemplo n.º 3
0
        public async Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken)
        {
            oprot.IncrementRecursionDepth();
            try
            {
                var struc = new TStruct("PageHeader");
                await oprot.WriteStructBeginAsync(struc, cancellationToken);

                var field = new TField();
                field.Name = "type";
                field.Type = TType.I32;
                field.ID   = 1;
                await oprot.WriteFieldBeginAsync(field, cancellationToken);

                await oprot.WriteI32Async((int)Type, cancellationToken);

                await oprot.WriteFieldEndAsync(cancellationToken);

                field.Name = "uncompressed_page_size";
                field.Type = TType.I32;
                field.ID   = 2;
                await oprot.WriteFieldBeginAsync(field, cancellationToken);

                await oprot.WriteI32Async(Uncompressed_page_size, cancellationToken);

                await oprot.WriteFieldEndAsync(cancellationToken);

                field.Name = "compressed_page_size";
                field.Type = TType.I32;
                field.ID   = 3;
                await oprot.WriteFieldBeginAsync(field, cancellationToken);

                await oprot.WriteI32Async(Compressed_page_size, cancellationToken);

                await oprot.WriteFieldEndAsync(cancellationToken);

                if (__isset.crc)
                {
                    field.Name = "crc";
                    field.Type = TType.I32;
                    field.ID   = 4;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await oprot.WriteI32Async(Crc, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (Data_page_header != null && __isset.data_page_header)
                {
                    field.Name = "data_page_header";
                    field.Type = TType.Struct;
                    field.ID   = 5;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await Data_page_header.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (Index_page_header != null && __isset.index_page_header)
                {
                    field.Name = "index_page_header";
                    field.Type = TType.Struct;
                    field.ID   = 6;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await Index_page_header.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (Dictionary_page_header != null && __isset.dictionary_page_header)
                {
                    field.Name = "dictionary_page_header";
                    field.Type = TType.Struct;
                    field.ID   = 7;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await Dictionary_page_header.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (Data_page_header_v2 != null && __isset.data_page_header_v2)
                {
                    field.Name = "data_page_header_v2";
                    field.Type = TType.Struct;
                    field.ID   = 8;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await Data_page_header_v2.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                await oprot.WriteFieldStopAsync(cancellationToken);

                await oprot.WriteStructEndAsync(cancellationToken);
            }
            finally
            {
                oprot.DecrementRecursionDepth();
            }
        }