code: func (g *memberSet) LocalState(join bool) []byte {
  	m := &pilosa.NodeStatus{
  		Node:   g.papi.Node(),
  		Schema: &pilosa.Schema{Indexes: g.papi.Schema(context.Background())},
  	}
  	for _, idx := range m.Schema.Indexes {
  		is := &pilosa.IndexStatus{Name: idx.Name}
  		for _, f := range idx.Fields {
  			availableShards := roaring.NewBitmap()
  			if field, _ := g.papi.Field(context.Background(), idx.Name, f.Name); field != nil {
  				availableShards = field.AvailableShards()
  			}
  			is.Fields = append(is.Fields, &pilosa.FieldStatus{
  				Name:            f.Name,
  				AvailableShards: availableShards,
  			})
  		}
  		m.Indexes = append(m.Indexes, is)
  	}
  
  	// Marshal nodestate data to bytes.
  	buf, err := pilosa.MarshalInternalMessage(m, g.papi.Serializer)
  	if err != nil {
  		g.Logger.Printf("error marshalling nodestate data, err=%s", err)
  		return []byte{}
  	}
  	return buf
  }
docs: // LocalState implementation of the memberlist.Delegate interface
  // sends this Node's state data.