func (m *metadata) getHead() (int, int) {
	return int(m.aa.ReadUint64At(8)), int(m.aa.ReadUint64At(16))
}
getHead reads the value of head of the queue from the metadata.
head points to the first element that is still not deleted yet.
Head of a bigqueue can be identified using:
1. Arena ID
2. Position (offset) in the arena

<------- head aid ------> <------- head pos ------>
+------------+------------+------------+------------+
| byte 08-11 | byte 12-15 | byte 16-19 | byte 20-23 |
+------------+------------+------------+------------+
package bigqueue
import (
	"errors"
	"fmt"
	"os"
	"path/filepath"
	"strings"
	"syscall"
	"github.com/grandecola/mmap"
)
const (
	cMetadataVersion  = 1
	cMetadataFileName = "metadata.dat"
	cMetadataSize = 56
)
var (
	ErrIncompatibleVersion = errors.New("incompatible format of the code and data")
)
type metadata struct {
	aa   *mmap.File
	co   map[string]int64
	file string
	size int64
}
func newMetadata(dataDir string, arenaSize int) (*metadata, error) {
	metaPath := filepath.Join(dataDir, cMetadataFileName)
	info, err := os.Stat(metaPath)
	switch {
	case err != nil && !os.IsNotExist(err):
		return nil, fmt.Errorf("error in reading metadata file :: %w", err)
	case err != nil && os.IsNotExist(err):
		return createFile(metaPath)
	default:
		return loadFile(metaPath, info.Size())
	}
}
func loadFile(metaPath string, size int64) (*metadata, error) {
	aa, err := newArena(metaPath, int(size))
	if err != nil {
		return nil, fmt.Errorf("error in creating arena for metadata file :: %w", err)
	}
	md := &metadata{
		aa:   aa,
		co:   make(map[string]int64),
		file: metaPath,
		size: size,
	}
	if md.getVersion() != cMetadataVersion {
		return nil, ErrIncompatibleVersion
	}
	base := int64(cMetadataSize)
	for i := 0; i < md.getNumConsumers(); i++ {
		name := md.getConsumerName(base)
		md.co[name] = base
		base += int64(len(name)) + 24
	}
	return md, nil
}
func createFile(metaPath string) (*metadata, error) {
	aa, err := newArena(metaPath, cMetadataSize)
	if err != nil {
		return nil, fmt.Errorf("error in creating arena for metadata file :: %w", err)
	}
	md := &metadata{
		aa:   aa,
		co:   make(map[string]int64),
		file: metaPath,
		size: cMetadataSize,
	}
	md.putVersion()
	return md, nil
}
func (m *metadata) getVersion() int {
	return int(m.aa.ReadUint64At(0))
}
func (m *metadata) putVersion() {
	m.aa.WriteUint64At(cMetadataVersion, 0)
}