]> git.proxmox.com Git - ceph.git/blob - ceph/src/arrow/go/arrow/internal/flatbuf/BodyCompression.go
import quincy 17.2.0
[ceph.git] / ceph / src / arrow / go / arrow / internal / flatbuf / BodyCompression.go
1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16
17 // Code generated by the FlatBuffers compiler. DO NOT EDIT.
18
19 package flatbuf
20
21 import (
22 flatbuffers "github.com/google/flatbuffers/go"
23 )
24
25 /// Optional compression for the memory buffers constituting IPC message
26 /// bodies. Intended for use with RecordBatch but could be used for other
27 /// message types
28 type BodyCompression struct {
29 _tab flatbuffers.Table
30 }
31
32 func GetRootAsBodyCompression(buf []byte, offset flatbuffers.UOffsetT) *BodyCompression {
33 n := flatbuffers.GetUOffsetT(buf[offset:])
34 x := &BodyCompression{}
35 x.Init(buf, n+offset)
36 return x
37 }
38
39 func (rcv *BodyCompression) Init(buf []byte, i flatbuffers.UOffsetT) {
40 rcv._tab.Bytes = buf
41 rcv._tab.Pos = i
42 }
43
44 func (rcv *BodyCompression) Table() flatbuffers.Table {
45 return rcv._tab
46 }
47
48 /// Compressor library
49 func (rcv *BodyCompression) Codec() CompressionType {
50 o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
51 if o != 0 {
52 return CompressionType(rcv._tab.GetInt8(o + rcv._tab.Pos))
53 }
54 return 0
55 }
56
57 /// Compressor library
58 func (rcv *BodyCompression) MutateCodec(n CompressionType) bool {
59 return rcv._tab.MutateInt8Slot(4, int8(n))
60 }
61
62 /// Indicates the way the record batch body was compressed
63 func (rcv *BodyCompression) Method() BodyCompressionMethod {
64 o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
65 if o != 0 {
66 return BodyCompressionMethod(rcv._tab.GetInt8(o + rcv._tab.Pos))
67 }
68 return 0
69 }
70
71 /// Indicates the way the record batch body was compressed
72 func (rcv *BodyCompression) MutateMethod(n BodyCompressionMethod) bool {
73 return rcv._tab.MutateInt8Slot(6, int8(n))
74 }
75
76 func BodyCompressionStart(builder *flatbuffers.Builder) {
77 builder.StartObject(2)
78 }
79 func BodyCompressionAddCodec(builder *flatbuffers.Builder, codec CompressionType) {
80 builder.PrependInt8Slot(0, int8(codec), 0)
81 }
82 func BodyCompressionAddMethod(builder *flatbuffers.Builder, method BodyCompressionMethod) {
83 builder.PrependInt8Slot(1, int8(method), 0)
84 }
85 func BodyCompressionEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
86 return builder.EndObject()
87 }