// DeleteTablet wraps the underlying conn.Delete
// and dispatches the event.
774599
func (ts *Server) DeleteTablet(ctx context.Context, tabletAlias *topodatapb.TabletAlias) error {
	conn, err := ts.ConnForCell(ctx, tabletAlias.Cell)
	if err != nil {
		return err
	}

	// get the current tablet record, if any, to log the deletion
	ti, tErr := ts.GetTablet(ctx, tabletAlias)

	tabletPath := path.Join(TabletsPath, topoproto.TabletAliasString(tabletAlias), TabletFile)
	if err := conn.Delete(ctx, tabletPath, nil); err != nil {
		return err
	}

	// Only try to log if we have the required info.
	if tErr == nil {
		// Only copy the identity info for the tablet. The rest has been deleted.
		event.Dispatch(&events.TabletChange{
			Tablet: topodatapb.Tablet{
				Alias:    tabletAlias,
				Keyspace: ti.Tablet.Keyspace,
				Shard:    ti.Tablet.Shard,
			},
			Status: "deleted",
		})
	}
	return nil
}
1101570
func (b *tableBatch) Delete(key []byte) error {
	return b.batch.Delete(append([]byte(b.prefix), key...))
}
245212
func deleteEvent(e contract.Event) error {
	for _, reading := range e.Readings {
		if err := deleteReadingById(reading.Id); err != nil {
			return err
		}
	}
	if err := dbClient.DeleteEventById(e.ID); err != nil {
		return err
	}

	return nil
}
539373
func (db *Storage) Delete(ctxt Context, val interface{}) error {
	ctxt = debugContext(ctxt)
	t, _, err := db.findType(val, "Delete")
	if err != nil {
		return err
	}

	var buf bytes.Buffer
	var args []interface{}
	rval := reflect.ValueOf(val).Elem()

	fmt.Fprintf(&buf, "delete from %q where ", t.name)
	sep := ""
	for _, col := range t.fields {
		if !col.key {
			continue
		}
		args = append(args, rval.FieldByIndex(col.index).Interface())
		fmt.Fprintf(&buf, "%s%q = ?", sep, col.name)
		sep = " and "
	}

	_, err = ctxt.Exec(buf.String(), args...)
	return err
}
859513
func (s *EventService) DeleteEvents(p *DeleteEventsParams) (*DeleteEventsResponse, error) {
	resp, err := s.cs.newRequest("deleteEvents", p.toURLValues())
	if err != nil {
		return nil, err
	}

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

	return &r, nil
}
1242723
func (a *Allocator) Delete() {
	close(a.stopGC)
	a.mainCache.stop()

	if a.events != nil {
		close(a.events)
	}
}
618673
func (dt *DbfTable) Delete(row int) {
	dt.dataStore[dt.getRowOffset(row)] = 0x2A // set deleted record marker
	dt.delRows = append(dt.delRows, row)
}
376099
func IsDeleteEvent(event notify.Event) bool {
	for _, ev := range EventTypeDelete {
		if event&ev != 0 {
			return true
		}
	}
	return false
}
574259
func (h *sqlHelper) Delete(
	logger lager.Logger,
	q Queryable,
	table string,
	wheres string,
	whereBindings ...interface{},
) (sql.Result, error) {
	query := fmt.Sprintf("DELETE FROM %s\n", table)

	if len(wheres) > 0 {
		query += "WHERE " + wheres
	}

	return q.Exec(h.Rebind(query), whereBindings...)
}
143374
func (s *BatchDeleteTableInput) SetTablesToDelete(v []*string) *BatchDeleteTableInput {
	s.TablesToDelete = v
	return s
}
709646
func (*Service) DeleteHost(c context.Context, req *crimson.DeleteHostRequest) (*empty.Empty, error) {
	if err := deleteHost(c, req.Name); err != nil {
		return nil, err
	}
	return &empty.Empty{}, nil
}
274895
func (s *Service) deleteConnection(id uint64) error {
	conn, ok := s.store.Connection(id)
	if !ok {
		return nil
	}
	return conn.Close()
}
1129762
func (c ConfigDataNode) DeleteItem(k string) {
	c.mutex.Lock()
	defer c.mutex.Unlock()
	delete(c.table, k)
}
1181974
func (nuageTable *NuageTable) DeleteRow(ovs *libovsdb.OvsdbClient, condition []string) error {

	glog.V(2).Infof("Delete from table %s with condition (%+v)", nuageTable.TableName, condition)

	if len(condition) != 3 {
		glog.Errorf("Invalid condition %v", condition)
		return fmt.Errorf("Invalid condition")
	}

	ovsdbCondition := libovsdb.NewCondition(condition[0], condition[1], condition[2])
	deleteOp := libovsdb.Operation{
		Op:    "delete",
		Table: nuageTable.TableName,
		Where: []interface{}{ovsdbCondition},
	}

	operations := []libovsdb.Operation{deleteOp}
	reply, err := ovs.Transact(OvsDBName, operations...)

	glog.V(2).Infof("reply : (%+v) err : (%+v)", reply, err)

	if err != nil || len(reply) != 1 || reply[0].Error != "" {
		errStr := fmt.Sprintf("Problem deleting row from the Nuage table %s (%+v) (%+v) (%+v)",
			nuageTable.TableName, ovsdbCondition, err, reply)
		glog.Errorf(errStr)
		return fmt.Errorf(errStr)
	}

	if reply[0].Count != 1 {
		glog.Errorf("Did not delete a Nuage Table entry for table %s condition %v", nuageTable.TableName, condition)
		return fmt.Errorf("Did not delete a Nuage Table entry for table %s condition %v",
			nuageTable.TableName, condition)
	}

	return nil
}
222712
func (tx *Tx) DeleteBySql(query string, value ...interface{}) *DeleteStmt {
	b := DeleteBySql(query, value...)
	b.runner = tx
	b.EventReceiver = tx.EventReceiver
	b.Dialect = tx.Dialect
	return b
}
468068
func (f *FakeWatcher) Delete(lastValue runtime.Object) {
	f.result <- Event{Deleted, lastValue}
}
1327534
func (tx *Tx) DeleteFrom(table string) *DeleteStmt {
	b := DeleteFrom(table)
	b.runner = tx
	b.EventReceiver = tx.EventReceiver
	b.Dialect = tx.Dialect
	return b
}