當前位置: 首頁>>代碼示例>>Golang>>正文


Golang pg.LUint函數代碼示例

本文整理匯總了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])))
}
開發者ID:bhand-mm,項目名稱:keryxlib,代碼行數:8,代碼來源:page.go

示例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{}
}
開發者ID:bhand-mm,項目名稱:keryxlib,代碼行數:11,代碼來源:recordheader.go

示例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
}
開發者ID:bhand-mm,項目名稱:keryxlib,代碼行數:11,代碼來源:recordheader.go

示例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
}
開發者ID:bhand-mm,項目名稱:keryxlib,代碼行數:11,代碼來源:recordheader.go

示例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
}
開發者ID:bhand-mm,項目名稱:keryxlib,代碼行數:11,代碼來源:recordheader.go

示例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
}
開發者ID:bhand-mm,項目名稱:keryxlib,代碼行數:11,代碼來源:recordheader.go

示例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
}
開發者ID:bhand-mm,項目名稱:keryxlib,代碼行數:11,代碼來源:recordheader.go

示例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
}
開發者ID:bhand-mm,項目名稱:keryxlib,代碼行數:11,代碼來源:recordheader.go

示例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
}
開發者ID:bhand-mm,項目名稱:keryxlib,代碼行數:11,代碼來源:heapdata.go

示例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
}
開發者ID:simplyianm,項目名稱:keryxlib,代碼行數:8,代碼來源:page.go

示例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
}
開發者ID:simplyianm,項目名稱:keryxlib,代碼行數:8,代碼來源:page.go

示例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
}
開發者ID:simplyianm,項目名稱:keryxlib,代碼行數:8,代碼來源:page.go

示例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
}
開發者ID:bhand-mm,項目名稱:keryxlib,代碼行數:30,代碼來源:heapdata.go

示例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
}
開發者ID:bhand-mm,項目名稱:keryxlib,代碼行數:24,代碼來源:page.go

示例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
}
開發者ID:simplyianm,項目名稱:keryxlib,代碼行數:17,代碼來源:page.go


注:本文中的github.com/MediaMath/keryxlib/pg.LUint函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。