diff --git a/handler.go b/handler.go index bb9fbc441..d7536f738 100644 --- a/handler.go +++ b/handler.go @@ -1734,75 +1734,6 @@ type clusterResizeAbortResponse struct { Info string `json:"info"` } -// // InputJSONDataParser validates input json file and executes SetBit. -// func (h *Handler) InputJSONDataParser(req map[string]interface{}, index *Index, name string) (map[string][]*Bit, error) { -// inputDef, err := index.InputDefinition(name) -// if err != nil { -// return nil, err -// } -// // If field in input data is not in defined definition, return error. -// var colValue uint64 -// validFields := make(map[string]bool) -// timestampFrame := make(map[string]int64) -// for _, field := range inputDef.Fields() { -// validFields[field.Name] = true -// if field.PrimaryKey { -// value, ok := req[field.Name] -// if !ok { -// return nil, fmt.Errorf("primary key does not exist") -// } -// rawValue, ok := value.(float64) // The default JSON marshalling will interpret this as a float -// if !ok { -// return nil, fmt.Errorf("float64 require, got value:%s, type: %s", value, reflect.TypeOf(value)) -// } -// colValue = uint64(rawValue) -// } -// // Find frame that need to add timestamp. -// for _, action := range field.Actions { -// if action.ValueDestination == InputSetTimestamp { -// timestampFrame[action.Frame], err = GetTimeStamp(req, field.Name) -// if err != nil { -// return nil, err -// } -// } -// } -// } - -// for key := range req { -// _, ok := validFields[key] -// if !ok { -// return nil, fmt.Errorf("field not found: %s", key) -// } -// } - -// setBits := make(map[string][]*Bit) - -// for _, field := range inputDef.Fields() { -// // skip field that defined in definition but not in input data -// if _, ok := req[field.Name]; !ok { -// continue -// } - -// // Looking into timestampFrame map and set timestamp to the whole frame -// for _, action := range field.Actions { -// frame := action.Frame -// timestamp := timestampFrame[action.Frame] -// // Skip input data field values that are set to null -// if req[field.Name] == nil { -// continue -// } -// bit, err := HandleAction(action, req[field.Name], colValue, timestamp) -// if err != nil { -// return nil, fmt.Errorf("error handling action: %s, err: %s", action.ValueDestination, err) -// } -// if bit != nil { -// setBits[frame] = append(setBits[frame], bit) -// } -// } -// } -// return setBits, nil -// } - func (h *Handler) handleRecalculateCaches(w http.ResponseWriter, r *http.Request) { err := h.API.RecalculateCaches(r.Context()) if err != nil { diff --git a/test/handler.go b/test/handler.go index 167187e0b..cb90cd383 100644 --- a/test/handler.go +++ b/test/handler.go @@ -41,7 +41,7 @@ func NewHandler() *Handler { Handler: pilosa.NewHandler(), } h.API = pilosa.NewAPI() - h.Handler.API = pilosa.NewAPI() + h.Handler.API = h.API h.Handler.API.Executor = &h.Executor // Handler test messages can no-op.