// DeleteSeriesRange removes the values between min and max (inclusive) from all series
178658
func (e *Engine) DeleteSeriesRange(itr tsdb.SeriesIterator, min, max int64) error {
	return e.DeleteSeriesRangeWithPredicate(itr, func(name []byte, tags models.Tags) (int64, int64, bool) {
		return min, max, true
	})
}
728869
func (ms *MaxSeries) Validate() error {
	if ms.InnerSeries == nil {
		return fmt.Errorf("max series requires InnerSeries to be set")
	}
	return nil
}
729773
func (client *WANIPConnection2) DeletePortMappingRange(NewStartPort uint16, NewEndPort uint16, NewProtocol string, NewManage bool) (err error) {
	// Request structure.
	request := &struct {
		NewStartPort string
		NewEndPort   string
		NewProtocol  string
		NewManage    string
	}{}
	// BEGIN Marshal arguments into request.

	if request.NewStartPort, err = soap.MarshalUi2(NewStartPort); err != nil {
		return
	}
	if request.NewEndPort, err = soap.MarshalUi2(NewEndPort); err != nil {
		return
	}
	if request.NewProtocol, err = soap.MarshalString(NewProtocol); err != nil {
		return
	}
	if request.NewManage, err = soap.MarshalBoolean(NewManage); err != nil {
		return
	}
	// END Marshal arguments into request.

	// Response structure.
	response := interface{}(nil)

	// Perform the SOAP call.
	if err = client.SOAPClient.PerformAction(URN_WANIPConnection_2, "DeletePortMappingRange", request, response); err != nil {
		return
	}

	// BEGIN Unmarshal arguments from response.

	// END Unmarshal arguments from response.
	return
}
34972
func FilterUndeletedSeriesIDIterator(sfile *SeriesFile, itr SeriesIDIterator) SeriesIDIterator {
	if itr == nil {
		return nil
	}
	return &filterUndeletedSeriesIDIterator{sfile: sfile, itr: itr}
}
1283179
func (h *ADXL345Driver) SetRange(sensorRange byte) (err error) {
	if sensorRange != ADXL345_RANGE_2G &&
		sensorRange != ADXL345_RANGE_4G &&
		sensorRange != ADXL345_RANGE_8G &&
		sensorRange != ADXL345_RANGE_16G {
		return errors.New("not a valid range")
	}
	h.dataFormat.sensorRange = sensorRange & 0x03
	if _, err := h.connection.Write([]byte{ADXL345_REG_DATA_FORMAT, h.dataFormat.toByte()}); err != nil {
		return err
	}
	return
}
41163
func (c *Connector) RemoveRange(ctx context.Context, ei *dosa.EntityInfo, columnConditions map[string][]*dosa.Condition) error {
	rpcConditions, err := createRPCConditions(columnConditions)
	if err != nil {
		return errors.Wrap(err, "RemoveRange failed: invalid column conditions")
	}

	request := &dosarpc.RemoveRangeRequest{
		Ref:        entityInfoToSchemaRef(ei),
		Conditions: rpcConditions,
	}

	if err := c.client.RemoveRange(ctx, request, getHeaders(c.headers)...); err != nil {
		if !dosarpc.Dosa_RemoveRange_Helper.IsException(err) {
			return errors.Wrap(err, "failed to RemoveRange due to network issue")
		}
		return errors.Wrap(err, "failed to RemoveRange")
	}
	return nil
}
612430
func (l *WAL) DeleteBucketRange(orgID, bucketID influxdb.ID, min, max int64) (int, error) {
	if !l.enabled {
		return -1, nil
	}

	entry := &DeleteBucketRangeWALEntry{
		OrgID:    orgID,
		BucketID: bucketID,
		Min:      min,
		Max:      max,
	}

	id, err := l.writeToLog(entry)
	if err != nil {
		return -1, err
	}
	return id, nil
}
1279343
func (md *MDServerRemote) GetRange(ctx context.Context, id tlf.ID,
	bid kbfsmd.BranchID, mStatus kbfsmd.MergeStatus,
	start, stop kbfsmd.Revision, lockBeforeGet *keybase1.LockID) (
	rmdses []*RootMetadataSigned, err error) {
	ctx = rpc.WithFireNow(ctx)
	md.log.LazyTrace(ctx, "MDServer: GetRange %s %s %s %d-%d", id, bid, mStatus, start, stop)
	defer func() {
		md.deferLog.LazyTrace(ctx, "MDServer: GetRange %s %s %s %d-%d done (err=%v)", id, bid, mStatus, start, stop, err)
	}()

	arg := keybase1.GetMetadataArg{
		FolderID:      id.String(),
		BranchID:      bid.String(),
		Unmerged:      mStatus == kbfsmd.Unmerged,
		StartRevision: start.Number(),
		StopRevision:  stop.Number(),
		LockBeforeGet: lockBeforeGet,
	}

	_, rmds, err := md.get(ctx, arg)
	return rmds, err
}
20684
func (s *Server) InvalidateNodeDataRange(node Node, off int64, size int64) error {
	return s.invalidateNode(node, off, size)
}
882040
func (c *Cache) DeleteBucketRange(name []byte, min, max int64) {
	// TODO(edd/jeff): find a way to optimize lock usage
	c.mu.Lock()
	defer c.mu.Unlock()

	var toDelete [][]byte
	var total uint64

	// applySerial only errors if the closure returns an error.
	_ = c.store.applySerial(func(k []byte, e *entry) error {
		if !bytes.HasPrefix(k, name) {
			return nil
		}
		total += uint64(e.size())

		// if everything is being deleted, just stage it to be deleted and move on.
		if min == math.MinInt64 && max == math.MaxInt64 {
			toDelete = append(toDelete, k)
			return nil
		}

		// filter the values and subtract out the remaining bytes from the reduction.
		e.filter(min, max)
		total -= uint64(e.size())

		// if it has no entries left, flag it to be deleted.
		if e.count() == 0 {
			toDelete = append(toDelete, k)
		}

		return nil
	})

	for _, k := range toDelete {
		total += uint64(len(k))
		c.store.remove(k)
	}

	c.tracker.DecCacheSize(total)
	c.tracker.SetMemBytes(uint64(c.Size()))
}
315956
func (t *Tag) DeleteFrames(id string) []Framer {
	frames := t.Frames(id)
	if frames == nil {
		return nil
	}

	diff := 0
	for _, frame := range frames {
		frame.setOwner(nil)
		diff += t.frameHeaderSize + int(frame.Size())
	}
	t.changeSize(-diff)

	delete(t.frames, id)

	return frames
}
505788
func (c *Connector) RemoveRange(_ context.Context, ei *dosa.EntityInfo, columnConditions map[string][]*dosa.Condition) error {
	c.lock.Lock()
	defer c.lock.Unlock()

	partitionRange, _, err := c.findRange(ei, columnConditions, false)
	if err != nil {
		return err
	}
	if partitionRange != nil {
		for iName, iDef := range ei.Def.Indexes {
			for _, vals := range partitionRange.values() {
				c.removeItem(iName, ei.Def.UniqueKey(iDef.Key), vals)
			}
		}
		partitionRange.remove()
	}

	return nil
}
1296155
func (s *PortableIPService) DeletePortableIpRange(p *DeletePortableIpRangeParams) (*DeletePortableIpRangeResponse, error) {
	resp, err := s.cs.newRequest("deletePortableIpRange", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r DeletePortableIpRangeResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	// If we have a async client, we need to wait for the async result
	if s.cs.async {
		b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout)
		if err != nil {
			if err == AsyncTimeoutErr {
				return &r, err
			}
			return nil, err
		}

		if err := json.Unmarshal(b, &r); err != nil {
			return nil, err
		}
	}

	return &r, nil
}
201674
func (tag *Tag) DeleteAllFrames() {
	if tag.frames == nil || len(tag.frames) > 0 {
		tag.frames = make(map[string]Framer)
	}
	if tag.sequences == nil || len(tag.sequences) > 0 {
		for _, s := range tag.sequences {
			putSequence(s)
		}
		tag.sequences = make(map[string]*sequence)
	}
}
187179
func (e *Engine) deleteMeasurement(name []byte) error {
	// Attempt to find the series keys.
	itr, err := e.index.MeasurementSeriesIDIterator(name)
	if err != nil {
		return err
	} else if itr == nil {
		return nil
	}
	defer itr.Close()
	return e.DeleteSeriesRange(tsdb.NewSeriesIteratorAdapter(e.sfile, itr), math.MinInt64, math.MaxInt64)
}
523139
func (o *GetObjectOptions) SetRange(start, end int64) error {
	switch {
	case start == 0 && end < 0:
		// Read last '-end' bytes. `bytes=-N`.
		o.Set("Range", fmt.Sprintf("bytes=%d", end))
	case 0 < start && end == 0:
		// Read everything starting from offset
		// 'start'. `bytes=N-`.
		o.Set("Range", fmt.Sprintf("bytes=%d-", start))
	case 0 <= start && start <= end:
		// Read everything starting at 'start' till the
		// 'end'. `bytes=N-M`
		o.Set("Range", fmt.Sprintf("bytes=%d-%d", start, end))
	default:
		// All other cases such as
		// bytes=-3-
		// bytes=5-3
		// bytes=-2-4
		// bytes=-3-0
		// bytes=-3--2
		// are invalid.
		return ErrInvalidArgument(
			fmt.Sprintf(
				"Invalid range specified: start=%d end=%d",
				start, end))
	}
	return nil
}
322120
func (c *Connector) RemoveRange(ctx context.Context, ei *dosa.EntityInfo, columnConditions map[string][]*dosa.Condition) error {
	if c.Next == nil {
		return NewErrNoMoreConnector()
	}
	return c.Next.RemoveRange(ctx, ei, columnConditions)
}