mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
missing comments
This commit is contained in:
parent
66496a73d7
commit
3512dd4549
6 changed files with 10 additions and 6 deletions
|
|
@ -58,6 +58,7 @@ func NewHandler() *Handler {
|
|||
return handler
|
||||
}
|
||||
|
||||
// NewRouter creates a Gorilla Mus http router
|
||||
func NewRouter(handler *Handler) *mux.Router {
|
||||
router := mux.NewRouter()
|
||||
router.HandleFunc("/index", handler.handleGetIndexes).Methods("GET")
|
||||
|
|
@ -1315,6 +1316,7 @@ type QueryResponse struct {
|
|||
Err error
|
||||
}
|
||||
|
||||
// MarshalJSON marshals QueryResponse into a JSON-encoded byte slice
|
||||
func (resp *QueryResponse) MarshalJSON() ([]byte, error) {
|
||||
var output struct {
|
||||
Results []interface{} `json:"results,omitempty"`
|
||||
|
|
|
|||
|
|
@ -356,7 +356,7 @@ type HolderSyncer struct {
|
|||
Closing <-chan struct{}
|
||||
}
|
||||
|
||||
// Returns true if the syncer has been marked to close.
|
||||
// IsClosing returns true if the syncer has been marked to close.
|
||||
func (s *HolderSyncer) IsClosing() bool {
|
||||
select {
|
||||
case <-s.Closing:
|
||||
|
|
|
|||
2
index.go
2
index.go
|
|
@ -250,6 +250,7 @@ func (i *Index) MaxSlice() uint64 {
|
|||
return max
|
||||
}
|
||||
|
||||
// SetRemoteMaxSlice sets the remote max slice value received from another node
|
||||
func (i *Index) SetRemoteMaxSlice(newmax uint64) {
|
||||
i.mu.Lock()
|
||||
defer i.mu.Unlock()
|
||||
|
|
@ -273,6 +274,7 @@ func (i *Index) MaxInverseSlice() uint64 {
|
|||
return max
|
||||
}
|
||||
|
||||
// SetRemoteMaxInverseSlice sets the remote max inverse slice value received from another node
|
||||
func (i *Index) SetRemoteMaxInverseSlice(v uint64) {
|
||||
i.mu.Lock()
|
||||
defer i.mu.Unlock()
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ func decodeColumnAttrSet(pb *internal.ColumnAttrSet) *ColumnAttrSet {
|
|||
// TimeFormat is the go-style time format used to parse string dates.
|
||||
const TimeFormat = "2006-01-02T15:04"
|
||||
|
||||
// Restrict name using regex
|
||||
// ValidateName restrict name using regex
|
||||
func ValidateName(name string) error {
|
||||
validName := nameRegexp.Match([]byte(name))
|
||||
if validName == false {
|
||||
|
|
|
|||
|
|
@ -281,13 +281,13 @@ func (s *Server) ReceiveMessage(pb proto.Message) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// Server implements StatusHandler.
|
||||
// LocalStatus returns the state of the local node as well as the
|
||||
// holder (indexes/frames) according to the local node.
|
||||
// In a gossip implementation, memberlist.Delegate.LocalState() uses this.
|
||||
// Server implements StatusHandler.
|
||||
func (s *Server) LocalStatus() (proto.Message, error) {
|
||||
if s.Holder == nil {
|
||||
return nil, errors.New("Server.Holder is nil.")
|
||||
return nil, errors.New("Server.Holder is nil")
|
||||
}
|
||||
return &internal.NodeStatus{
|
||||
Host: s.Host,
|
||||
|
|
|
|||
4
stats.go
4
stats.go
|
|
@ -12,7 +12,7 @@ func init() {
|
|||
NopStatsClient = &nopStatsClient{}
|
||||
}
|
||||
|
||||
// Global expvar.
|
||||
// Expvar Global expvar map.
|
||||
var Expvar = expvar.NewMap("index")
|
||||
|
||||
// StatsClient represents a client to a stats server.
|
||||
|
|
@ -39,9 +39,9 @@ type StatsClient interface {
|
|||
Timing(name string, value time.Duration)
|
||||
}
|
||||
|
||||
// NopStatsClient represents a client that doesn't do anything.
|
||||
var NopStatsClient StatsClient
|
||||
|
||||
// nopStatsClient represents a client that doesn't do anything.
|
||||
type nopStatsClient struct{}
|
||||
|
||||
func (c *nopStatsClient) Tags() []string { return nil }
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue