本文整理汇总了Golang中github.com/MediaMath/keryxlib/pg.LUint函数的典型用法代码示例。如果您正苦于以下问题:Golang LUint函数的具体用法?Golang LUint怎么用?Golang LUint使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LUint函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Location
// Location is the Location this page starts at
func (p Page) Location() Location {
if p.Is91() {
return LocationFromUint32s(uint32(pg.LUint(p.bs[8:12])), uint32(pg.LUint(p.bs[12:16])))
}
return LocationFromUint32s(uint32(pg.LUint(p.bs[12:16])), uint32(pg.LUint(p.bs[8:12])))
}
示例2: Previous
// Previous is the location of the record that preceeds this one
func (r RecordHeader) Previous() Location {
switch r.version {
case 0xD066:
return LocationFromUint32s(uint32(pg.LUint(r.bs[4:8])), uint32(pg.LUint(r.bs[8:12])))
case 0xD07E:
return LocationFromUint32s(uint32(pg.LUint(r.bs[20:24])), uint32(pg.LUint(r.bs[16:20])))
}
return Location{}
}
示例3: Crc
// Crc is the crc of the record
func (r RecordHeader) Crc() uint32 {
switch r.version {
case 0xD066:
return uint32(pg.LUint(r.bs[0:4]))
case 0xD07E:
return uint32(pg.LUint(r.bs[24:28]))
}
return 0
}
示例4: ResourceManagerID
// ResourceManagerID is the ID of the resource manager that created this record
func (r RecordHeader) ResourceManagerID() uint8 {
switch r.version {
case 0xD066:
return uint8(pg.LUint(r.bs[25:26]))
case 0xD07E:
return uint8(pg.LUint(r.bs[13:14]))
}
return 0
}
示例5: Info
// Info contains resource manager specific data
func (r RecordHeader) Info() uint8 {
switch r.version {
case 0xD066:
return uint8(pg.LUint(r.bs[24:25]))
case 0xD07E:
return uint8(pg.LUint(r.bs[12:13]))
}
return 0
}
示例6: Length
// Length is the length of resource manager specific data after the header
func (r RecordHeader) Length() uint32 {
switch r.version {
case 0xD066:
return uint32(pg.LUint(r.bs[20:24]))
case 0xD07E:
return uint32(pg.LUint(r.bs[8:12]))
}
return 0
}
示例7: TotalLength
// TotalLength is the length of the body after the header but before the next record
func (r RecordHeader) TotalLength() uint32 {
switch r.version {
case 0xD066:
return uint32(pg.LUint(r.bs[16:20]))
case 0xD07E:
return uint32(pg.LUint(r.bs[0:4]))
}
return 0
}
示例8: TransactionID
// TransactionID is the transaction that this record is apart of
func (r RecordHeader) TransactionID() uint32 {
switch r.version {
case 0xD066:
return uint32(pg.LUint(r.bs[12:16]))
case 0xD07E:
return uint32(pg.LUint(r.bs[4:8]))
}
return 0
}
示例9: ToOffset
// ToOffset is item number of the new version of this tuple
func (d UpdateData) ToOffset() uint16 {
switch d.version {
case 0xD066:
return uint16(pg.LUint(d.bs[24:26]))
case 0xD07E:
return uint16(pg.LUint(d.bs[32:34]))
}
return 0
}
示例10: BlockSize
// BlockSize is the size of a page in a WAL file
func (p Page) BlockSize() uint32 {
if p.IsLong() {
return uint32(pg.LUint(p.bs[28:32]))
}
return 0
}
示例11: SegmentSize
// SegmentSize is the size in bytes of a single WAL file
func (p Page) SegmentSize() uint32 {
if p.IsLong() {
return uint32(pg.LUint(p.bs[24:28]))
}
return 0
}
示例12: SystemID
// SystemID can be used to determine if a page was written by a particular server
func (p Page) SystemID() uint64 {
if p.IsLong() {
return uint64(pg.LUint(p.bs[16:24]))
}
return 0
}
示例13: parseMultiInsertData
func parseMultiInsertData(isInit bool, d []byte) (multiInserts []HeapData) {
const XlogHeapInitPage = 128
var (
tablespaceID = uint32(pg.LUint(d[0:4]))
databaseID = uint32(pg.LUint(d[4:8]))
relationID = uint32(pg.LUint(d[8:12]))
toBlock = uint32(pg.LUint(d[12:16]))
flags = d[16]
ntuples = uint16(pg.LUint(d[18:20]))
)
isInit = isInit || flags&XlogHeapInitPage > 0
for i := uint16(0); i < ntuples; i++ {
if isInit {
multiInserts = append(multiInserts, MultiInsertData{tablespaceID, databaseID, relationID, toBlock, i + 1})
} else {
var (
start = i*2 + 20
end = start + 2
toOffset = uint16(pg.LUint(d[start:end]))
)
multiInserts = append(multiInserts, MultiInsertData{tablespaceID, databaseID, relationID, toBlock, toOffset})
}
}
return
}
示例14: Continuation
// Continuation will return the bytes of a continuation of the previous record's body if present on the page
func (p Page) Continuation() []byte {
if p.IsCont() {
var contStart, contEnd uint64
if p.Is94() {
contStart = p.HeaderLength()
contEnd = contStart + pg.LUint(p.bs[16:20])
} else {
sizeOffset := p.HeaderLength()
contStart = sizeOffset + 4
contEnd = contStart + pg.LUint(p.bs[sizeOffset:contStart])
}
maxContEnd := uint64(len(p.bs))
if contEnd > maxContEnd {
contEnd = maxContEnd
}
return p.bs[contStart:contEnd]
}
return nil
}
示例15: Continuation
// Continuation will return the bytes of a continuation of the previous record's body if present on the page
func (p Page) Continuation() []byte {
if p.IsCont() {
sizeOffset := p.HeaderLength()
contStart := sizeOffset + 4
contEnd := contStart + uint64(pg.LUint(p.bs[sizeOffset:contStart]))
maxContEnd := uint64(len(p.bs))
if contEnd > maxContEnd {
contEnd = maxContEnd
}
return p.bs[contStart:contEnd]
}
return nil
}