Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing dead code from every package except influxql #6879

Merged
merged 1 commit into from
Jun 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions coordinator/points_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,14 @@ import (

// The statistics generated by the "write" mdoule
const (
statWriteReq = "req"
statPointWriteReq = "pointReq"
statPointWriteReqLocal = "pointReqLocal"
statPointWriteReqRemote = "pointReqRemote"
statWriteOK = "writeOk"
statWritePartial = "writePartial"
statWriteTimeout = "writeTimeout"
statWriteErr = "writeError"
statWritePointReqHH = "pointReqHH"
statSubWriteOK = "subWriteOk"
statSubWriteDrop = "subWriteDrop"
statWriteReq = "req"
statPointWriteReq = "pointReq"
statPointWriteReqLocal = "pointReqLocal"
statWriteOK = "writeOk"
statWriteTimeout = "writeTimeout"
statWriteErr = "writeError"
statSubWriteOK = "subWriteOk"
statSubWriteDrop = "subWriteDrop"
)

var (
Expand Down
6 changes: 0 additions & 6 deletions coordinator/statement_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1242,12 +1242,6 @@ func (s stringSet) intersect(o stringSet) stringSet {
return ns
}

type uint64Slice []uint64

func (a uint64Slice) Len() int { return len(a) }
func (a uint64Slice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a uint64Slice) Less(i, j int) bool { return a[i] < a[j] }

type keyValue struct {
key, value string
}
Expand Down
8 changes: 0 additions & 8 deletions influxql/iterator.gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ func (h *floatMergeHeap) Pop() interface{} {

type floatMergeHeapItem struct {
itr *bufFloatIterator
err error
}

// floatSortedMergeIterator is an iterator that sorts and merges multiple iterators into one.
Expand All @@ -308,7 +307,6 @@ type floatSortedMergeIterator struct {
opt IteratorOptions
heap floatSortedMergeHeap
init bool
point FloatPoint
}

// newFloatSortedMergeIterator returns an instance of floatSortedMergeIterator.
Expand Down Expand Up @@ -2357,7 +2355,6 @@ func (h *integerMergeHeap) Pop() interface{} {

type integerMergeHeapItem struct {
itr *bufIntegerIterator
err error
}

// integerSortedMergeIterator is an iterator that sorts and merges multiple iterators into one.
Expand All @@ -2366,7 +2363,6 @@ type integerSortedMergeIterator struct {
opt IteratorOptions
heap integerSortedMergeHeap
init bool
point IntegerPoint
}

// newIntegerSortedMergeIterator returns an instance of integerSortedMergeIterator.
Expand Down Expand Up @@ -4412,7 +4408,6 @@ func (h *stringMergeHeap) Pop() interface{} {

type stringMergeHeapItem struct {
itr *bufStringIterator
err error
}

// stringSortedMergeIterator is an iterator that sorts and merges multiple iterators into one.
Expand All @@ -4421,7 +4416,6 @@ type stringSortedMergeIterator struct {
opt IteratorOptions
heap stringSortedMergeHeap
init bool
point StringPoint
}

// newStringSortedMergeIterator returns an instance of stringSortedMergeIterator.
Expand Down Expand Up @@ -6467,7 +6461,6 @@ func (h *booleanMergeHeap) Pop() interface{} {

type booleanMergeHeapItem struct {
itr *bufBooleanIterator
err error
}

// booleanSortedMergeIterator is an iterator that sorts and merges multiple iterators into one.
Expand All @@ -6476,7 +6469,6 @@ type booleanSortedMergeIterator struct {
opt IteratorOptions
heap booleanSortedMergeHeap
init bool
point BooleanPoint
}

// newBooleanSortedMergeIterator returns an instance of booleanSortedMergeIterator.
Expand Down
2 changes: 0 additions & 2 deletions influxql/iterator.gen.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ func (h *{{$k.name}}MergeHeap) Pop() interface{} {

type {{$k.name}}MergeHeapItem struct {
itr *buf{{$k.Name}}Iterator
err error
}

// {{$k.name}}SortedMergeIterator is an iterator that sorts and merges multiple iterators into one.
Expand All @@ -306,7 +305,6 @@ type {{$k.name}}SortedMergeIterator struct {
opt IteratorOptions
heap {{$k.name}}SortedMergeHeap
init bool
point {{$k.Name}}Point
}

// new{{$k.Name}}SortedMergeIterator returns an instance of {{$k.name}}SortedMergeIterator.
Expand Down
28 changes: 0 additions & 28 deletions models/points.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,15 +548,6 @@ func less(buf []byte, indices []int, i, j int) bool {
return bytes.Compare(a, b) < 0
}

func isFieldEscapeChar(b byte) bool {
for c := range escape.Codes {
if c == b {
return true
}
}
return false
}

// scanFields scans buf, starting at i for the fields section of a point. It returns
// the ending position and the byte slice of the fields within buf
func scanFields(buf []byte, i int) (int, []byte, error) {
Expand Down Expand Up @@ -1589,22 +1580,3 @@ func (p Fields) MarshalBinary() []byte {
}
return b
}

type indexedSlice struct {
indices []int
b []byte
}

func (s *indexedSlice) Less(i, j int) bool {
_, a := scanTo(s.b, s.indices[i], '=')
_, b := scanTo(s.b, s.indices[j], '=')
return bytes.Compare(a, b) < 0
}

func (s *indexedSlice) Swap(i, j int) {
s.indices[i], s.indices[j] = s.indices[j], s.indices[i]
}

func (s *indexedSlice) Len() int {
return len(s.indices)
}
11 changes: 0 additions & 11 deletions monitor/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import (
"github.com/influxdata/influxdb/services/meta"
)

const leaderWaitTimeout = 30 * time.Second

// Policy constants.
const (
MonitorRetentionPolicy = "monitor"
Expand Down Expand Up @@ -405,15 +403,6 @@ type Statistic struct {
Values map[string]interface{} `json:"values"`
}

// newStatistic returns a new statistic object.
func newStatistic(name string, tags map[string]string, values map[string]interface{}) *Statistic {
return &Statistic{
Name: name,
Tags: tags,
Values: values,
}
}

// valueNames returns a sorted list of the value names, if any.
func (s *Statistic) ValueNames() []string {
a := make([]string, 0, len(s.Values))
Expand Down
9 changes: 0 additions & 9 deletions services/collectd/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import (
"github.com/kimor79/gollectd"
)

const leaderWaitTimeout = 30 * time.Second

// statistics gathered by the collectd service.
const (
statPointsReceived = "pointsRx"
Expand Down Expand Up @@ -306,10 +304,3 @@ func (s *Service) UnmarshalCollectd(packet *gollectd.Packet) []models.Point {
}
return points
}

// assert will panic with a given formatted message if the given condition is false.
func assert(condition bool, msg string, v ...interface{}) {
if !condition {
panic(fmt.Sprintf("assert failed: "+msg, v...))
}
}
5 changes: 2 additions & 3 deletions services/continuous_querier/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ const (

// Statistics for the CQ service.
const (
statQueryOK = "queryOk"
statQueryFail = "queryFail"
statPointsWritten = "pointsWritten"
statQueryOK = "queryOk"
statQueryFail = "queryFail"
)

// ContinuousQuerier represents a service that executes continuous queries.
Expand Down
6 changes: 1 addition & 5 deletions services/graphite/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,14 @@ import (
"github.com/influxdata/influxdb/tsdb"
)

const (
udpBufferSize = 65536
leaderWaitTimeout = 30 * time.Second
)
const udpBufferSize = 65536

// statistics gathered by the graphite package.
const (
statPointsReceived = "pointsRx"
statBytesReceived = "bytesRx"
statPointsParseFail = "pointsParseFail"
statPointsNaNFail = "pointsNaNFail"
statPointsUnsupported = "pointsUnsupportedFail"
statBatchesTransmitted = "batchesTx"
statPointsTransmitted = "pointsTx"
statBatchesTransmitFail = "batchesTxFail"
Expand Down
6 changes: 0 additions & 6 deletions services/httpd/response_logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ import (
"github.com/influxdata/influxdb/influxql"
)

type loggingResponseWriter interface {
http.ResponseWriter
Status() int
Size() int
}

// responseLogger is wrapper of http.ResponseWriter that keeps track of its HTTP status
// code and body size
type responseLogger struct {
Expand Down
16 changes: 0 additions & 16 deletions services/meta/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@ import (
)

const (
// errSleep is the time to sleep after we've failed on every metaserver
// before making another pass
errSleep = time.Second

// maxRetries is the maximum number of attemps to make before returning
// a failure to the caller
maxRetries = 10

// SaltBytes is the number of bytes used for salts
SaltBytes = 32

Expand Down Expand Up @@ -1047,14 +1039,6 @@ func (c *Client) Load() error {
return nil
}

type errCommand struct {
msg string
}

func (e errCommand) Error() string {
return e.msg
}

type uint64Slice []uint64

func (a uint64Slice) Len() int { return len(a) }
Expand Down
Loading